diff options
author | Torvald Riegel <triegel@redhat.com> | 2011-12-12 12:04:46 +0000 |
---|---|---|
committer | Torvald Riegel <torvald@gcc.gnu.org> | 2011-12-12 12:04:46 +0000 |
commit | feca8f5a964a16efbe7c9ca22cd8c2539e0f00e9 (patch) | |
tree | 01c3a64df50b4d63d221525ca12332c822cb18b8 /gcc/tree-ssa-tail-merge.c | |
parent | 033eaf8501b9611c04430e4f1bf458435fdd1171 (diff) | |
download | gcc-feca8f5a964a16efbe7c9ca22cd8c2539e0f00e9.zip gcc-feca8f5a964a16efbe7c9ca22cd8c2539e0f00e9.tar.gz gcc-feca8f5a964a16efbe7c9ca22cd8c2539e0f00e9.tar.bz2 |
Prevent sharing of commit calls among transactions.
gcc/
* tree-ssa-tail-merge.c (gimple_equal_p): Don't treat transaction
commits as equal.
gcc/testsuite/
* c-c++-common/tm/20111206.c: New test.
From-SVN: r182231
Diffstat (limited to 'gcc/tree-ssa-tail-merge.c')
-rw-r--r-- | gcc/tree-ssa-tail-merge.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index a501b07..7452266 100644 --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -1051,6 +1051,14 @@ gimple_equal_p (same_succ same_succ, gimple s1, gimple s2) if (!gimple_call_same_target_p (s1, s2)) return false; + /* Eventually, we'll significantly complicate the CFG by adding + back edges to properly model the effects of transaction restart. + For the bulk of optimization this does not matter, but what we + cannot recover from is tail merging blocks between two separate + transactions. Avoid that by making commit not match. */ + if (gimple_call_builtin_p (s1, BUILT_IN_TM_COMMIT)) + return false; + equal = true; for (i = 0; i < gimple_call_num_args (s1); ++i) { |