re PR middle-end/80823 (ICE: verify_flow_info failed)
authorPeter Bergner <bergner@vnet.ibm.com>
Wed, 24 May 2017 12:10:54 +0000 (07:10 -0500)
committerPeter Bergner <bergner@gcc.gnu.org>
Wed, 24 May 2017 12:10:54 +0000 (07:10 -0500)
gcc/
PR middle-end/80823
* tree-cfg.c (group_case_labels_stmt): Delete increment of "i";

gcc/testsuite/
PR middle-end/80823
* gcc.dg/pr80823.c: New test.

From-SVN: r248408

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr80823.c [new file with mode: 0644]
gcc/tree-cfg.c

index 0d212ab9930abf0ba5edff8837d5afe13ce8e9b7..a08d45c0a4c9c2210b09ac61975fa6545d417340 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-24  Peter Bergner  <bergner@vnet.ibm.com>
+
+       PR middle-end/80823
+       * tree-cfg.c (group_case_labels_stmt): Delete increment of "i";
+
 2017-05-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        PR target/80725
index 78756318c34447139344b641e038aa4feb77acc8..f2929ad0e9cfb3f4799f8995979a763590999ddb 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-24  Peter Bergner  <bergner@vnet.ibm.com>
+
+       PR middle-end/80823
+       * gcc.dg/pr80823.c: New test.
+
 2017-05-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * gcc.target/s390/pr80725.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr80823.c b/gcc/testsuite/gcc.dg/pr80823.c
new file mode 100644 (file)
index 0000000..0a48764
--- /dev/null
@@ -0,0 +1,23 @@
+/* PR middle-end/80823 ICE: verify_flow_info failed  */
+/* { dg-do compile }  */
+/* { dg-options "-O3" }  */
+
+int a, c;
+int b[1];
+static inline int
+fn1() {
+  switch (a)
+  case 0:
+  case 2:
+    return 1;
+  return 0;
+}
+void fn2() {
+  int i;
+  for (;; ++i) {
+    c = b[i];
+    int d = !fn1();
+    if (d)
+      __asm__("");
+  }
+}
index ba19661b860c430108c946dca31f3b41f17c5c25..63532a82acbb17fdd7d76801e2c40a1f23b6ca64 100644 (file)
@@ -1726,7 +1726,6 @@ group_case_labels_stmt (gswitch *stmt)
            remove_edge_and_dominated_blocks (base_edge);
          gimple_switch_set_label (stmt, base_index, NULL_TREE);
          new_size--;
-         i++;
        }
     }