* gcc.dg/20020201-2.c: New test.
authorJakub Jelinek <jakub@redhat.com>
Sat, 2 Feb 2002 00:16:39 +0000 (01:16 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 2 Feb 2002 00:16:39 +0000 (01:16 +0100)
From-SVN: r49421

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20020201-2.c [new file with mode: 0644]

index 56d0268fd77eb309186639c1eccb60e383573492..c58eb79335efe5c93729ecbec8870f0049adbe8c 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-02  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.dg/20020201-2.c: New test.
+
 2002-02-02  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * gcc.dg/bitfld-1.c: Update.
diff --git a/gcc/testsuite/gcc.dg/20020201-2.c b/gcc/testsuite/gcc.dg/20020201-2.c
new file mode 100644 (file)
index 0000000..2a13c8d
--- /dev/null
@@ -0,0 +1,30 @@
+/* This testcase caused ICE because gcc was not able to add instructions
+   on edge from ENTRY block successor to itself.  */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fssa" } */
+
+struct A { int a1; int a2; };
+struct B { long int b[32]; };
+
+extern int bar (struct B *, struct A *);
+
+int
+foo (struct B x)
+{
+  struct A a, b;
+  struct B c;
+  int d;
+
+  while (1)
+    {
+      a.a1 = 0;
+      a.a2 = 0;
+      b = a;
+      c = x;
+      d = bar (&c, &b);
+      if (d >= 0)
+        return d;
+    }
+
+  return 0;
+}