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

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