diff options
author | Richard Henderson <rth@redhat.com> | 2012-11-06 15:55:11 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2012-11-06 15:55:11 -0800 |
commit | 7ec887015f685ed3d6146b1fd464b7bf31dc7a19 (patch) | |
tree | 0785f2785ae84b5b812bfe805741e7d95249c3b9 /gcc/tree-ssa-tail-merge.c | |
parent | 99ea153e45c86a1b0318e3f5e983624c3336445e (diff) | |
download | gcc-7ec887015f685ed3d6146b1fd464b7bf31dc7a19.zip gcc-7ec887015f685ed3d6146b1fd464b7bf31dc7a19.tar.gz gcc-7ec887015f685ed3d6146b1fd464b7bf31dc7a19.tar.bz2 |
Prevent "illegal" block sharing within transactions.
* tree-ssa-tail-merge.c (find_duplicate): Do not consider
is_tm_ending_fndecl calls as mergable.
From-SVN: r193268
Diffstat (limited to 'gcc/tree-ssa-tail-merge.c')
-rw-r--r-- | gcc/tree-ssa-tail-merge.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index f9dc880..1521bad 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); |