https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117113
Bug ID: 117113 Summary: ICE on valid code at -O3 with "-fno-tree-dce -fno-inline" on x86_64-linux-gnu: verify_ssa failed 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 long latent as it reproduces with 8.* and later (with -fchecking). Compiler Explorer: https://godbolt.org/z/aMxdW58Gs [508] % gcctk -v Using built-in specs. COLLECT_GCC=gcctk COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/15.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 15.0.0 20241013 (experimental) (GCC) [509] % [509] % gcctk -O3 -fno-tree-dce -fno-inline small.c small.c: In function ‘main’: small.c:5:5: error: stmt with wrong VUSE 5 | int main() { | ^~~~ # VUSE <.MEM_21> _95 ={v} d[0]; expected .MEM_85 small.c:5:5: error: stmt with wrong VUSE # VUSE <.MEM_21> vol.0_96 ={v} d[0]; expected .MEM_85 small.c:5:5: error: PHI node with wrong VUSE on edge from BB 56 .MEM_99 = PHI <.MEM_21(53), .MEM_21(56)> expected .MEM_85 small.c:5:5: error: stmt with wrong VUSE # VUSE <.MEM_21> _65 ={v} d[0]; expected .MEM_99 small.c:5:5: error: stmt with wrong VUSE # VUSE <.MEM_21> vol.0_66 ={v} d[0]; expected .MEM_99 small.c:5:5: error: PHI node with wrong VUSE on edge from BB 41 .MEM_69 = PHI <.MEM_21(57), .MEM_21(41)> expected .MEM_99 small.c:5:5: error: PHI node with wrong VUSE on edge from BB 57 .MEM_69 = PHI <.MEM_21(57), .MEM_21(41)> expected .MEM_99 small.c:5:5: error: PHI node with wrong VUSE on edge from BB 53 .MEM_99 = PHI <.MEM_21(53), .MEM_21(56)> expected .MEM_85 during GIMPLE pass: cunroll small.c:5:5: internal compiler error: verify_ssa failed 0x26282d5 internal_error(char const*, ...) ../../gcc-trunk/gcc/diagnostic-global-context.cc:517 0x145d21e verify_ssa(bool, bool) ../../gcc-trunk/gcc/tree-ssa.cc:1203 0x136a15b verify_loop_closed_ssa(bool, loop*) ../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:693 0x136a15b verify_loop_closed_ssa(bool, loop*) ../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:681 0x1350b31 tree_unroll_loops_completely ../../gcc-trunk/gcc/tree-ssa-loop-ivcanon.cc:1576 0x1350bb3 execute ../../gcc-trunk/gcc/tree-ssa-loop-ivcanon.cc:1680 0x1350bb3 execute ../../gcc-trunk/gcc/tree-ssa-loop-ivcanon.cc:1670 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. [510] % [510] % cat small.c int a, b, c; volatile int d[1]; void e() {} void f(int g) {} int main() { int i; for (; b; b--) { for (i = 0; i < 3; i++) { e(); f(d[0]); d[0]; } if (a) c++; } return 0; }