re PR middle-end/68570 (ICE on valid code at -O1, -O2 and -O3 on x86_64-linux-gnu)
authorMarek Polacek <polacek@redhat.com>
Wed, 2 Dec 2015 10:22:23 +0000 (10:22 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 2 Dec 2015 10:22:23 +0000 (10:22 +0000)
PR middle-end/68570
* gcc.dg/torture/pr68570.c: New test.

From-SVN: r231163

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr68570.c [new file with mode: 0644]

index 81fcff16945486fdbbb0eb62cf3d7401dc82702c..d3ca274515b342f8e7bef54451ef8b3f012c69fc 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-02  Marek Polacek  <polacek@redhat.com>
+
+       PR middle-end/68570
+       * gcc.dg/torture/pr68570.c: New test.
+
 2015-12-02  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/68625
diff --git a/gcc/testsuite/gcc.dg/torture/pr68570.c b/gcc/testsuite/gcc.dg/torture/pr68570.c
new file mode 100644 (file)
index 0000000..a8f2843
--- /dev/null
@@ -0,0 +1,35 @@
+/* PR middle-end/68570 */
+/* { dg-do compile } */
+
+int a, d, e, f, h, i, k;
+
+void
+fn1 ()
+{
+  char m;
+  for (;;)
+    {
+      for (;;)
+        {
+          e = f = 1;
+          if (i)
+            d = h = 0;
+          else
+            a = 0;
+          break;
+        }
+      k = 0;
+      if (f)
+        a = 3;
+      if (d)
+        f = 0;
+      if (a > (i < 1))
+        {
+          if (e)
+            break;
+        }
+      else
+        i = m;
+      k = i ? a : i;
+    }
+}