https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103458
Bug ID: 103458 Summary: [12 Regression] ICE in verify_loop_structure, at cfgloop.c:1736 (error: loop with header 4 not in loop tree) Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- gcc-12.0.0-alpha20211121 snapshot (g:da17c304e22ba256eba0b03710aa329115163b08) ICEs when compiling the following testcase w/ -O2: __attribute__ ((returns_twice)) int bar (void); void foo (int *p, int x) { *p = 0; while (*p < 1) { x = 0; while (x < 1) bar (); x /= 0; } foo (p, x); } % gcc-12.0.0 -O2 -w -c xiksrvsw.c xiksrvsw.c: In function 'foo': xiksrvsw.c:5:1: error: loop with header 4 not in loop tree 5 | foo (int *p, int x) | ^~~ during GIMPLE pass: cddce xiksrvsw.c:5:1: internal compiler error: in verify_loop_structure, at cfgloop.c:1736 0x6816e7 verify_loop_structure() /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211121/work/gcc-12-20211121/gcc/cfgloop.c:1736 0xdb8457 execute_function_todo /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211121/work/gcc-12-20211121/gcc/passes.c:2058 0xdb8cbe execute_todo /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211121/work/gcc-12-20211121/gcc/passes.c:2096