https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112852
Bug ID: 112852 Summary: [14 Regression] RISCV ICE: vsetvl pass: in partial_subreg_p, at rtl.h:3187 on rv64gcv_zvl512b Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: patrick at rivosinc dot com Target Milestone: --- Created attachment 56801 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56801&action=edit -freport-bug output Only seen on rv64gcv_zvl512b: pr112598 FAIL: gcc.c-torture/compile/20090907-1.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (internal compiler error: in partial_subreg_p, at rtl.h:3187) Command: > /scratch/tc-testing/tc-dec-4-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc > -march=rv64gcv_zvl512b -mabi=lp64d -O3 20090907-1.c -ftracer -funroll-loops > -freport-bug during RTL pass: vsetvl 20090907-1.c: In function 'metronomefb_probe': 20090907-1.c:84:1: internal compiler error: in partial_subreg_p, at rtl.h:3187 84 | } | ^ 0xb3a42b partial_subreg_p(machine_mode, machine_mode) ../../../gcc/gcc/rtl.h:3187 0xb3a42b partial_subreg_p(machine_mode, machine_mode) ../../../gcc/gcc/rtl.h:3181 0xb3a42b rtl_ssa::function_info::record_use(rtl_ssa::function_info::build_info&, rtl_ssa::insn_info*, rtx_obj_reference) ../../../gcc/gcc/rtl-ssa/insns.cc:524 0x23ee521 rtl_ssa::function_info::add_insn_to_block(rtl_ssa::function_info::build_info&, rtx_insn*) ../../../gcc/gcc/rtl-ssa/insns.cc:662 0x2a0876d rtl_ssa::function_info::add_block_contents(rtl_ssa::function_info::build_info&) ../../../gcc/gcc/rtl-ssa/blocks.cc:948 0x2a08e8a rtl_ssa::function_info::start_block(rtl_ssa::function_info::build_info&, rtl_ssa::bb_info*) ../../../gcc/gcc/rtl-ssa/blocks.cc:1064 0x2a08f1c rtl_ssa::function_info::bb_walker::before_dom_children(basic_block_def*) ../../../gcc/gcc/rtl-ssa/blocks.cc:117 0x225c207 dom_walker::walk(basic_block_def*) ../../../gcc/gcc/domwalk.cc:311 0x2a0a5c9 rtl_ssa::function_info::process_all_blocks() ../../../gcc/gcc/rtl-ssa/blocks.cc:1281 0x23ebb68 rtl_ssa::function_info::function_info(function*) ../../../gcc/gcc/rtl-ssa/functions.cc:50 0x1734d12 pre_vsetvl::pre_vsetvl() ../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:2218 0x1733527 pass_vsetvl::lazy_vsetvl() ../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:3454 0x173391f pass_vsetvl::execute(function*) ../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:3518 0x173391f pass_vsetvl::execute(function*) ../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:3501 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 /scratch/tmp/ccO9eL35.out file, please attach this to your bugreport. Testcase: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/testsuite/gcc.c-torture/compile/20090907-1.c;h=12cf1185b93b973ce21e24039c00d9b7be855894;hb=HEAD Godbolt: https://godbolt.org/z/chdK4TnKx creduced testcase: char a; char *b; int c; void d() { int e = 0, f = 0; for (; f <= a; f++) if (b[f]) e = f - 1; c = e; }