Blame SOURCES/gcc32-null-pointer-check-noncc0.patch

727081
2004-02-26  Alan Modra  <amodra@bigpond.net.au>
727081
727081
	PR rtl-optimization/14279
727081
	* gcse.c (delete_null_pointer_checks_1): Do not delete CC setter
727081
	unless HAVE_cc0.
727081
727081
2004-12-22  Jakub Jelinek  <jakub@redhat.com>
727081
727081
	* gcc.c-torture/execute/20041222-1.c: New test.
727081
727081
--- gcc/gcse.c.jj	2003-03-10 17:42:09.000000000 +0100
727081
+++ gcc/gcse.c	2004-12-22 12:03:32.272762070 +0100
727081
@@ -5428,8 +5428,10 @@ delete_null_pointer_checks_1 (block_reg,
727081
 	}
727081
 
727081
       delete_insn (last_insn);
727081
+#ifdef HAVE_cc0
727081
       if (compare_and_branch == 2)
727081
         delete_insn (earliest);
727081
+#endif
727081
       purge_dead_edges (BASIC_BLOCK (bb));
727081
 
727081
       /* Don't check this block again.  (Note that BLOCK_END is
727081
--- gcc/testsuite/gcc.c-torture/execute/20041222-1.c.jj	2004-12-22 12:07:50.446611220 +0100
727081
+++ gcc/testsuite/gcc.c-torture/execute/20041222-1.c	2004-12-22 11:34:45.000000000 +0100
727081
@@ -0,0 +1,41 @@
727081
+extern void abort (void);
727081
+extern void exit (int);
727081
+
727081
+struct S
727081
+{
727081
+  void *a;
727081
+  unsigned int b;
727081
+};
727081
+
727081
+void
727081
+__attribute__((noinline))
727081
+bar (struct S *x)
727081
+{
727081
+  if (x->b != 2)
727081
+    abort ();
727081
+}
727081
+
727081
+void
727081
+__attribute__((noinline))
727081
+foo (struct S *x)
727081
+{
727081
+  if (! x->a)
727081
+    {
727081
+      struct S *y, *z;
727081
+      y = x;
727081
+      if (y)
727081
+	++y->b;
727081
+      z = x;
727081
+      if (z)
727081
+	++z->b;
727081
+      bar (x);
727081
+    }
727081
+}
727081
+
727081
+int
727081
+main (void)
727081
+{
727081
+  struct S s = { 0, 0 };
727081
+  foo (&s);
727081
+  exit (0);
727081
+}