https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110671
Bug ID: 110671 Summary: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in gimple_phi_arg_def_from_edge, at gimple.h:4699 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zhendong.su at inf dot ethz.ch Target Milestone: --- It appears to be a very recent regression. [631] % gcctk -v Using built-in specs. COLLECT_GCC=gcctk COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk --enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 20230714 (experimental) (GCC) [632] % [632] % gcctk -O2 -c small.c during GIMPLE pass: sccp small.c: In function ‘main’: small.c:3:5: internal compiler error: in gimple_phi_arg_def_from_edge, at gimple.h:4699 3 | int main() { | ^~~~ 0x80ec9d gimple_phi_arg_def_from_edge(gphi const*, edge_def const*) ../../gcc-trunk/gcc/gimple.h:4699 0x8101ae gimple_phi_arg_def_from_edge(gphi const*, edge_def const*) ../../gcc-trunk/gcc/tree.h:3700 0x8101ae final_value_replacement_loop(loop*) ../../gcc-trunk/gcc/tree-scalar-evolution.cc:3732 0x118a1a5 execute ../../gcc-trunk/gcc/tree-ssa-loop.cc:411 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. [633] % [633] % cat small.c extern void f(); int a; int main() { int *b = &a, c = 1, d; L: if (a) for (; d < 1; d++) { if (a) f(); *b |= c; } c = 0; if (a) goto L; return 0; }