Detection of Transactional Memory Anomalies Using Static Analysis