aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-09-24 08:57:08 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-09-24 08:57:08 +0000
commit483ef49f9a3b2079bea28358185391a79ebf4fa7 (patch)
tree51aecd8b2f2c3befb06643fdb25f37d339b19690
parentdd9b0e0d28bac4ac782b980fa15ad1a8501d9add (diff)
downloadgcc-483ef49f9a3b2079bea28358185391a79ebf4fa7.zip
gcc-483ef49f9a3b2079bea28358185391a79ebf4fa7.tar.gz
gcc-483ef49f9a3b2079bea28358185391a79ebf4fa7.tar.bz2
re PR middle-end/52173 (internal compiler error: verify_ssa failed possibly caused by itm)
2012-09-24 Richard Guenther <rguenther@suse.de> PR middle-end/52173 * gimple.c (gimple_copy): Properly mark the copy modified if SSA operands are present. * gcc.dg/tm/pr52173-1.c: New. * gcc.dg/tm/pr52173-2.c: New. From-SVN: r191658
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimple.c27
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/tm/pr52173-1.c19
-rw-r--r--gcc/testsuite/gcc.dg/tm/pr52173-2.c12
5 files changed, 55 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9602625..8af0732 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-24 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/52173
+ * gimple.c (gimple_copy): Properly mark the copy modified
+ if SSA operands are present.
+
2012-09-23 Eric Botcazou <ebotcazou@adacore.com>
PR tree-optimization/54669
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 7065040..6088682 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2333,23 +2333,20 @@ gimple_copy (gimple stmt)
}
/* Make copy of operands. */
- if (num_ops > 0)
- {
- for (i = 0; i < num_ops; i++)
- gimple_set_op (copy, i, unshare_expr (gimple_op (stmt, i)));
+ for (i = 0; i < num_ops; i++)
+ gimple_set_op (copy, i, unshare_expr (gimple_op (stmt, i)));
- /* Clear out SSA operand vectors on COPY. */
- if (gimple_has_ops (stmt))
- {
- gimple_set_def_ops (copy, NULL);
- gimple_set_use_ops (copy, NULL);
- }
+ if (gimple_has_mem_ops (stmt))
+ {
+ gimple_set_vdef (copy, gimple_vdef (stmt));
+ gimple_set_vuse (copy, gimple_vuse (stmt));
+ }
- if (gimple_has_mem_ops (stmt))
- {
- gimple_set_vdef (copy, gimple_vdef (stmt));
- gimple_set_vuse (copy, gimple_vuse (stmt));
- }
+ /* Clear out SSA operand vectors on COPY. */
+ if (gimple_has_ops (stmt))
+ {
+ gimple_set_def_ops (copy, NULL);
+ gimple_set_use_ops (copy, NULL);
/* SSA operands need to be updated. */
gimple_set_modified (copy, true);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a677859..a2ea508 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-24 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/52173
+ * gcc.dg/tm/pr52173-1.c: New.
+ * gcc.dg/tm/pr52173-2.c: New.
+
2012-09-23 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/pr54669.c: New test.
diff --git a/gcc/testsuite/gcc.dg/tm/pr52173-1.c b/gcc/testsuite/gcc.dg/tm/pr52173-1.c
new file mode 100644
index 0000000..9ffa4d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tm/pr52173-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O3" } */
+
+int vec[500];
+
+void func()
+{
+ __transaction_relaxed
+ {
+ vec[123] = 456;
+ }
+}
+
+main()
+{
+ int i;
+ for(i = 0; i < 10; ++i)
+ func();
+}
diff --git a/gcc/testsuite/gcc.dg/tm/pr52173-2.c b/gcc/testsuite/gcc.dg/tm/pr52173-2.c
new file mode 100644
index 0000000..ca64893
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tm/pr52173-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O2" } */
+
+int a;
+
+int main()
+{
+ int i;
+ for (i = 0; i < 1; ++i)
+ __transaction_atomic { ++a; }
+ return 0;
+}