]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/52173 (internal compiler error: verify_ssa failed possibly caused...
authorRichard Guenther <rguenther@suse.de>
Mon, 24 Sep 2012 08:57:08 +0000 (08:57 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 24 Sep 2012 08:57:08 +0000 (08:57 +0000)
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

gcc/ChangeLog
gcc/gimple.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tm/pr52173-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tm/pr52173-2.c [new file with mode: 0644]

index 9602625ace446e1d4d69890c21f4577d02aabf76..8af0732838b5be4639c6d704c0e7b7ae3a1931de 100644 (file)
@@ -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
index 7065040eb31e97974597c4082d62f0e1b69974e6..6088682e04c760dcca216c4c14a7f705551de64f 100644 (file)
@@ -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);
index a677859668ab8e2fea51bd2675364f775de22557..a2ea50843678867b3bad3d103bc877293b9a92d7 100644 (file)
@@ -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 (file)
index 0000000..9ffa4d6
--- /dev/null
@@ -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 (file)
index 0000000..ca64893
--- /dev/null
@@ -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;
+}