Since r247844: trippels@gcc2-power8 ~ % cat tzfmt.ii struct A { int m_fn1(int &) const; }; int A::m_fn1(int &p1) const { int a[6]; int b = 0; for (int i;; i++) { if (a[i]) break; b++; } while (b) { int c; switch (b) { case 1: c = 0; break; case 5: c = a[0]; } if (c) p1 = 0; b--; } } trippels@gcc2-power8 ~ % g++ -c -O3 tzfmt.ii tzfmt.ii: In member function ‘int A::m_fn1(int&) const’: tzfmt.ii:4:5: error: extra outgoing edge 43->33 int A::m_fn1(int &p1) const { ^ tzfmt.ii:4:5: error: extra outgoing edge 44->33 tzfmt.ii:4:5: internal compiler error: verify_flow_info failed 0x105d8db3 verify_flow_info() ../../gcc/gcc/cfghooks.c:260 0x10bb613b checking_verify_flow_info ../../gcc/gcc/cfghooks.h:198 0x10bb613b cleanup_tree_cfg_noloop ../../gcc/gcc/tree-cfgcleanup.c:837 0x10bb613b cleanup_tree_cfg() ../../gcc/gcc/tree-cfgcleanup.c:883 0x10a3c147 execute_function_todo ../../gcc/gcc/passes.c:1921 0x10a3ced3 do_per_function ../../gcc/gcc/passes.c:1652 0x10a3d153 execute_todo ../../gcc/gcc/passes.c:2018
Confirmed. I'll have a look.
Also causes my local gcc bootstrap to fail. I think it's the -O3 -march=native causing it. I'll try a bootstrap with the usual -O2 instead.
*** Bug 80714 has been marked as a duplicate of this bug. ***
David and HJ, the following patch fixes the ICE Markus reported, so can you try the following patch to see if it fixes your bootstrap issues? Index: tree-cfg.c =================================================================== --- tree-cfg.c (revision 247845) +++ tree-cfg.c (working copy) @@ -1684,6 +1684,10 @@ group_case_labels_stmt (gswitch *stmt) || (EDGE_COUNT (base_bb->succs) == 0 && gimple_seq_unreachable_p (bb_seq (base_bb)))) { + edge e; + if (base_bb != default_bb + && (e = find_edge (gimple_bb (stmt), base_bb)) != NULL) + remove_edge_and_dominated_blocks (e); gimple_switch_set_label (stmt, i, NULL_TREE); i++; new_size--;
Seems to work for me.
It works. Thanks.
Patch submitted.
Author: bergner Date: Fri May 12 17:13:07 2017 New Revision: 247984 URL: https://gcc.gnu.org/viewcvs?rev=247984&root=gcc&view=rev Log: gcc/ PR middle-end/80707 * tree-cfg.c: Remove cfg edges of unreachable case statements. gcc/testsuite/ PR middle-end/80707 * g++.dg/pr80707.C: New test. Added: trunk/gcc/testsuite/g++.dg/pr80707.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-cfg.c
Fixed.
Closing as fixed.