This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix PR20204



I've committed the attached to mainline and 4.0. The only change is that the test now runs only on x86. That's enough to trigger the bug.


Bootstrapped and tested x86, x86-64, ppc and ia64.


Diego.
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  Diego Novillo  <dnovillo@redhat.com>

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

Index: tree-into-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-into-ssa.c,v
retrieving revision 2.41
diff -d -u -p -r2.41 tree-into-ssa.c
--- tree-into-ssa.c	24 Feb 2005 14:18:46 -0000	2.41
+++ tree-into-ssa.c	25 Feb 2005 19:58:46 -0000
@@ -591,9 +591,6 @@ insert_phi_nodes_for (tree var, bitmap p
 	  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_wal
   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);
     }
 }
 
Index: testsuite/gcc.dg/pr20204.c
===================================================================
RCS file: testsuite/gcc.dg/pr20204.c
diff -N testsuite/gcc.dg/pr20204.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gcc.dg/pr20204.c	25 Feb 2005 19:58:55 -0000
@@ -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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]