https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99880
Bug ID: 99880 Summary: ICE in maybe_set_vectorized_backedge_value, at tree-vect-loop.c:9161 Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi all. This valid program makes GCC crash at -O3. GCC-10 also incurs an ICE with a Segmentation fault, while GCC-10 downwards versions handle this case well. $cat small.c int a, b, c, d, e; void f() { b = 5; for (; b <= 51; b++) ; int g = -8; while (g) { g += 5; int h = 10; do { h -= a = 1; for (; a; a++) ; c *= c >= d >= b; } while (h); c -= e; } } $gcc -w -O3 small.c during GIMPLE pass: vect small.c: In function âfâ: small.c:2:6: internal compiler error: in maybe_set_vectorized_backedge_value, at tree-vect-loop.c:9161 2 | void f() { | ^ 0x66093f maybe_set_vectorized_backedge_value ../../gcc/tree-vect-loop.c:9161 0xdc466a vect_transform_loop(_loop_vec_info*, gimple*) ../../gcc/tree-vect-loop.c:9650 0xdebbcc try_vectorize_loop_1 ../../gcc/tree-vectorizer.c:1104 0xdec7b1 vectorize_loops() ../../gcc/tree-vectorizer.c:1243 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/home/tuhaoxin/compilers/gcc/build-20210330/libexec/gcc/x86_64-pc-linux-gnu/11.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/home/tuhaoxin/compilers/gcc/build-20210330/ --enable-bootstrap --enable-checking=release --enable-languages=c,c++ -disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.1 20210330 (experimental) (GCC) Reproduced on Godbolt: https://godbolt.org/z/WTje44Wen Thanks, Haoxin