re PR tree-optimization/20204 (miscompilation of asm-declared registers)
authorDiego Novillo <dnovillo@redhat.com>
Fri, 25 Feb 2005 21:12:34 +0000 (21:12 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Fri, 25 Feb 2005 21:12:34 +0000 (16:12 -0500)
PR tree-optimization/20204
* tree-into-ssa.c (insert_phi_nodes_for): Do not use
REWRITE_THIS_STMT markers on PHI nodes.
(rewrite_initialize_block): Likewise.

testsuite/ChangeLog

PR tree-optimization/20204
* testsuite/gcc.dg/pr20204.c: New test.

From-SVN: r95547

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr20204.c [new file with mode: 0644]
gcc/tree-into-ssa.c

index 3f3b478..b45dc87 100644 (file)
@@ -1,3 +1,10 @@
+2005-02-25  Diego Novillo  <dnovillo@redhat.com>
+
+       PR tree-optimization/20204
+       * tree-into-ssa.c (insert_phi_nodes_for): Do not use
+       REWRITE_THIS_STMT markers on PHI nodes.
+       (rewrite_initialize_block): Likewise.
+
 2005-02-25  Mark Mitchell  <mark@codesourcery.com>
 
        * version.c (version_string): Update to 4.1.
index 192a460..5210413 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-25  Diego Novillo  <dnovillo@redhat.com>
+
+       PR tree-optimization/20204
+       * testsuite/gcc.dg/pr20204.c: New test.
+
 2005-02-24  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/20196
diff --git a/gcc/testsuite/gcc.dg/pr20204.c b/gcc/testsuite/gcc.dg/pr20204.c
new file mode 100644 (file)
index 0000000..ad85af5
--- /dev/null
@@ -0,0 +1,34 @@
+/* { dg-do run { target i?86-*-* } } */
+/* { dg-options "-O2" } */
+
+void *x (void *pdst, const void *psrc, unsigned int pn)
+{
+  register void *return_dst = pdst;
+  register unsigned char *dst = pdst;
+  register unsigned const char *src = psrc;
+  register int n __asm__ ("ebx") = pn;
+
+  if (src < dst && dst < src + n)
+    {
+      src += n;
+      dst += n;
+      while (n--)
+        *--dst = *--src;
+      return return_dst;
+    }
+
+  while (n >= 16) n--;
+
+  return return_dst;
+}
+extern void abort ();
+extern void exit (int);
+char xx[30] = "abc";
+int main (void)
+{
+  char yy[30] = "aab";
+
+  if (x (xx + 1, xx, 2) != xx + 1 || memcmp (xx, yy, sizeof (yy)) != 0)
+    abort ();
+  exit (0);
+}
index bdc7623..271c1ff 100644 (file)
@@ -591,9 +591,6 @@ insert_phi_nodes_for (tree var, bitmap phi_insertion_points)
          FOR_EACH_EDGE (e, ei, bb->preds)
            add_phi_arg (phi, var, e);
        }
-
-      /* Mark this PHI node as interesting for the rename process.  */
-      REWRITE_THIS_STMT (phi) = 1;
     }
 }
 
@@ -745,8 +742,7 @@ rewrite_initialize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
   for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
     {
       tree result = PHI_RESULT (phi);
-      if (REWRITE_THIS_STMT (phi))
-       register_new_def (result, &block_defs_stack);
+      register_new_def (result, &block_defs_stack);
     }
 }