re PR debug/47780 (-fcompare-debug failure with -O -fgcse -fgcse-las -fstack-protecto...
authorJakub Jelinek <jakub@redhat.com>
Fri, 18 Feb 2011 10:42:48 +0000 (11:42 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 18 Feb 2011 10:42:48 +0000 (11:42 +0100)
PR debug/47780
* cfgexpand.c (expand_debug_expr) <case SSA_NAME>: Call copy_rtx to
avoid invalid rtx sharing.

* gcc.target/i386/pr47780.c: New test.

From-SVN: r170270

gcc/ChangeLog
gcc/cfgexpand.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr47780.c [new file with mode: 0644]

index f44708140de57f33b8540b8aae9c200ceb55b01d..41c09ff5a61bc3706254bfe72e4517a3cc007ca8 100644 (file)
@@ -1,3 +1,9 @@
+2011-02-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/47780
+       * cfgexpand.c (expand_debug_expr) <case SSA_NAME>: Call copy_rtx to
+       avoid invalid rtx sharing.
+
 2011-02-18  Gerald Pfeifer  <gerald@pfeifer.com>
 
        * doc/cpp.texi (Obsolete Features): Add background on the
index 897d0f9f2b3af7eee91f8861e60ff6d30f194aa5..ee51ba9f9c0302495f5d8ecce367f1b9a745d81b 100644 (file)
@@ -3104,7 +3104,7 @@ expand_debug_expr (tree exp)
 
            gcc_assert (part >= 0 && (unsigned)part < SA.map->num_partitions);
 
-           op0 = SA.partition_to_pseudo[part];
+           op0 = copy_rtx (SA.partition_to_pseudo[part]);
          }
        goto adjust_mode;
       }
index 998cfc211fab62bc66ec865d6c216be60fa2f73e..40e2553cfc7f6e62b176eb246e8a55a18b8082c3 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/47780
+       * gcc.target/i386/pr47780.c: New test.
+
 2011-02-18  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/47767
diff --git a/gcc/testsuite/gcc.target/i386/pr47780.c b/gcc/testsuite/gcc.target/i386/pr47780.c
new file mode 100644 (file)
index 0000000..89fe409
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR debug/47780 */
+/* { dg-do compile } */
+/* { dg-options "-O -fgcse -fgcse-las -fstack-protector-all -fno-tree-ccp -fno-tree-dominator-opts -fcompare-debug -Wno-psabi" } */
+
+typedef int V2SF __attribute__ ((vector_size (128)));
+
+V2SF
+foo (int x, V2SF a)
+{
+  V2SF b = a + (V2SF) {};
+  while (x--)
+    a += b;
+  return a;
+}