https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120652
Bug ID: 120652 Summary: [16 Regression] RISC-V: ICE in require, at machmode.h:323 with rv64gcv_zvl256b Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: ewlu at rivosinc dot com Target Milestone: --- Created attachment 61635 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61635&action=edit freport-bug output Testcase: unsigned n; char ab[6]; unsigned ac; unsigned ae; int ak(int bb) { bd: for (ac = -17; ac != 16; ac++) { unsigned be = 95; if (be <= n) { char *bg = &ab[1]; *bg ^= bb; } else { ae--; for (n = 8; 0;) goto bd; } } return 0; } int main() { ak(7); return 0; } Command: $ /scratch/ewlu/daily-upstream-build/build-gcv/bin/riscv64-unknown-linux-gnu-gcc -I/scratch/ewlu/ci/compiler-fuzz-ci/csmith-build/include -fsigned-char -fno-strict-aliasing -fwrapv -march=rv64gcv_zvl256b -mrvv-vector-bits=zvl -O3 red.c -o rv64gcv.out -w -freport-bug during RTL pass: expand red.c: In function 'main': red.c:20:5: internal compiler error: in require, at machmode.h:323 20 | int main() { | ^~~~ 0x2e0b1d6 internal_error(char const*, ...) ../../../gcc/gcc/diagnostic-global-context.cc:517 0xd0d3ed fancy_abort(char const*, int, char const*) ../../../gcc/gcc/diagnostic.cc:1803 0xc3da74 opt_mode<machine_mode>::require() const ../../../gcc/gcc/machmode.h:323 0xc3de2f opt_mode<machine_mode>::require() const ../../../gcc/gcc/poly-int.h:1383 0xc3de2f riscv_vector::expand_select_vl(rtx_def**) ../../../gcc/gcc/config/riscv/riscv-v.cc:4218 0x21c7d22 gen_select_vldi(rtx_def*, rtx_def*, rtx_def*) ../../../gcc/gcc/config/riscv/autovec.md:1344 0x134db6c maybe_expand_insn(insn_code, unsigned int, expand_operand*) ../../../gcc/gcc/optabs.cc:8257 0x134db6c expand_insn(insn_code, unsigned int, expand_operand*) ../../../gcc/gcc/optabs.cc:8288 0x11b21d3 expand_fn_using_insn ../../../gcc/gcc/internal-fn.cc:318 0xef32cf expand_call_stmt ../../../gcc/gcc/cfgexpand.cc:3097 0xef32cf expand_gimple_stmt_1 ../../../gcc/gcc/cfgexpand.cc:4264 0xef32cf expand_gimple_stmt ../../../gcc/gcc/cfgexpand.cc:4411 0xef95b6 expand_gimple_basic_block ../../../gcc/gcc/cfgexpand.cc:6472 0xefb66f execute ../../../gcc/gcc/cfgexpand.cc:7223 Please submit a full bug report, with preprocessed source. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Preprocessed source stored into /tmp/ccfIJhBg.out file, please attach this to your bugreport. Godbolt: https://godbolt.org/z/W3YEWf6Pb