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
This commit is contained in:
Richard Henderson 2012-11-06 15:55:11 -08:00 committed by Richard Henderson
parent 99ea153e45
commit 7ec887015f
2 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-11-06 Richard Henderson <rth@redhat.com>
* tree-ssa-tail-merge.c (find_duplicate): Do not consider
is_tm_ending_fndecl calls as mergable.
2012-11-06 Sterling Augustine <saugustine@google.com>
Cary Coutant <ccoutant@google.com>

View File

@ -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);