summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-tail-merge.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-06 23:55:11 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-06 23:55:11 +0000
commit4b9d47898a80491086e529ed002f199fa3814533 (patch)
tree0785f2785ae84b5b812bfe805741e7d95249c3b9 /gcc/tree-ssa-tail-merge.c
parentb35329c7fe71b2c466a2071d414613b3e3273827 (diff)
downloadlinaro-gcc-4b9d47898a80491086e529ed002f199fa3814533.tar.gz
linaro-gcc-4b9d47898a80491086e529ed002f199fa3814533.tar.bz2
linaro-gcc-4b9d47898a80491086e529ed002f199fa3814533.zip
Prevent "illegal" block sharing within transactions.
* tree-ssa-tail-merge.c (find_duplicate): Do not consider is_tm_ending_fndecl calls as mergable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193268 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-tail-merge.c')
-rw-r--r--gcc/tree-ssa-tail-merge.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index f9dc8806439..1521badebf8 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -1213,7 +1213,18 @@ find_duplicate (same_succ same_succ, basic_block bb1, basic_block bb2)
while (!gsi_end_p (gsi1) && !gsi_end_p (gsi2))
{
- if (!gimple_equal_p (same_succ, gsi_stmt (gsi1), gsi_stmt (gsi2)))
+ gimple stmt1 = gsi_stmt (gsi1);
+ gimple stmt2 = gsi_stmt (gsi2);
+
+ if (!gimple_equal_p (same_succ, stmt1, stmt2))
+ return;
+
+ // We cannot tail-merge the builtins that end transactions.
+ // ??? The alternative being unsharing of BBs in the tm_init pass.
+ if (flag_tm
+ && is_gimple_call (stmt1)
+ && (gimple_call_flags (stmt1) & ECF_TM_BUILTIN)
+ && is_tm_ending_fndecl (gimple_call_fndecl (stmt1)))
return;
gsi_prev_nondebug (&gsi1);