summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog.tm6
-rw-r--r--gcc/testsuite/gcc.dg/tm/pr47905.c14
-rw-r--r--gcc/trans-mem.c6
3 files changed, 24 insertions, 2 deletions
diff --git a/gcc/ChangeLog.tm b/gcc/ChangeLog.tm
index 5be365821bb..71f136b3c54 100644
--- a/gcc/ChangeLog.tm
+++ b/gcc/ChangeLog.tm
@@ -1,3 +1,9 @@
+2011-02-28 Aldy Hernandez <aldyh@redhat.com>
+
+ PR 47905
+ * trans-mem.c (ipa_tm_propagate_irr): Do not propagate to blocks
+ outside of a TM region.
+
2011-02-21 Aldy Hernandez <aldyh@redhat.com>
PR 47746
diff --git a/gcc/testsuite/gcc.dg/tm/pr47905.c b/gcc/testsuite/gcc.dg/tm/pr47905.c
new file mode 100644
index 00000000000..fac82db2847
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tm/pr47905.c
@@ -0,0 +1,14 @@
+/* { dg-do compile }
+ { dg-options "-fgnu-tm" } */
+
+void funcA();
+void funcB();
+
+void *thread()
+{
+ __transaction [[relaxed]]
+ {
+ funcA();
+ };
+ funcB();
+}
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index aa3f4e27631..9e685710a8d 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -3752,8 +3752,10 @@ ipa_tm_propagate_irr (basic_block entry_block, bitmap new_irr, bitmap old_irr,
son;
son = next_dom_son (CDI_DOMINATORS, son))
{
- /* Make sure a block isn't already in old_irr. */
- if (!old_irr || !bitmap_bit_p (old_irr, son->index))
+ /* Make sure block is actually in a TM region, and it
+ isn't already in old_irr. */
+ if ((!old_irr || !bitmap_bit_p (old_irr, son->index))
+ && bitmap_bit_p (bb_in_TM_region, son->index))
bitmap_set_bit (new_irr, son->index);
}
}