From 3f3fb6c91306b8f703842c785535aa074be1acee Mon Sep 17 00:00:00 2001 From: Peter Bergner Date: Wed, 24 May 2017 07:10:54 -0500 Subject: [PATCH] re PR middle-end/80823 (ICE: verify_flow_info failed) 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 | 5 +++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr80823.c | 23 +++++++++++++++++++++++ gcc/tree-cfg.c | 1 - 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr80823.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d212ab9930..a08d45c0a4c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-05-24 Peter Bergner + + PR middle-end/80823 + * tree-cfg.c (group_case_labels_stmt): Delete increment of "i"; + 2017-05-24 Andreas Krebbel PR target/80725 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 78756318c34..f2929ad0e9c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-05-24 Peter Bergner + + PR middle-end/80823 + * gcc.dg/pr80823.c: New test. + 2017-05-24 Andreas Krebbel * 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 index 00000000000..0a48764bfde --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr80823.c @@ -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__(""); + } +} diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index ba19661b860..63532a82acb 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -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++; } } -- 2.30.2