Commit 7ec88701 by Richard Henderson Committed by Richard Henderson

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
parent 99ea153e
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>
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment