Detection of transactional memory anomalies using static analysis