summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2012-11-06 10:55:39 -0800
committerRichard Henderson <rth@redhat.com>2012-11-06 10:55:39 -0800
commitb84906199b59e04769339e7d29c962394252f422 (patch)
tree02e0338d91d5a9e051c9d739671bd915df8dc156
parent396ae1efe2f2432901fc4a82a7eeca4e1ed11a26 (diff)
downloadgcc-aldyh/uninst.tar.gz
Prevent "illegal" block sharing within transactions.aldyh/uninst
-rw-r--r--gcc/trans-mem.c3
-rw-r--r--gcc/tree-ssa-pre.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index 9a582af672d..531396191de 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -2486,6 +2486,9 @@ collect_bb2reg (struct tm_region *region, void *data)
// Note that the optimizers were locally correct with their transformation,
// as we have no info within the program that suggests that the blocks cannot
// be shared.
+//
+// ??? There is currently a hack inside tree-ssa-pre.c to work around the
+// only known instance of this block sharing.
static VEC(tm_region_p, heap) *
get_bb_regions_instrumented (void)
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 191de51b75d..b3edc670bf8 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -3805,6 +3805,13 @@ compute_avail (void)
if (gimple_call_internal_p (stmt))
continue;
+ // We cannot value number the builtins that end transactions.
+ // ??? The alternative being unsharing BBs in the tm_init pass.
+ if (flag_tm
+ && (gimple_call_flags (stmt) & ECF_TM_BUILTIN)
+ && is_tm_ending_fndecl (gimple_call_fndecl (stmt)))
+ continue;
+
copy_reference_ops_from_call (stmt, &ops);
vn_reference_lookup_pieces (gimple_vuse (stmt), 0,
gimple_expr_type (stmt),