https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121548

            Bug ID: 121548
           Summary: [15/16 Regression] ICE: SIGSEGV in
                    satisfies_constraint_vu (constraints.md:199) with -O
                    -mrvv-vector-bits=zvl -march=rv64gv
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: riscv64-unknown-linux-gnu

Created attachment 62120
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62120&action=edit
reduced testcase

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O -mrvv-vector-bits=zvl -march=rv64gv
testcase.c -wrapper valgrind,-q
==29710== Invalid read of size 1
==29710==    at 0x1D82973: satisfies_constraint_vu (constraints.md:199)
==29710==    by 0x1D82973:
pass_avlprop::get_vlmax_ta_preferred_avl(rtl_ssa::insn_info*) const
(riscv-avlprop.cc:365)
==29710==    by 0x1D82D67: get_preferred_avl (riscv-avlprop.cc:292)
==29710==    by 0x1D82D67: pass_avlprop::execute(function*)
(riscv-avlprop.cc:489)
==29710==    by 0x16EDBEF: execute_one_pass(opt_pass*) (passes.cc:2648)
==29710==    by 0x16EE49F: execute_pass_list_1(opt_pass*) (passes.cc:2757)
==29710==    by 0x16EE4B1: execute_pass_list_1(opt_pass*) (passes.cc:2758)
==29710==    by 0x16EE4D8: execute_pass_list(function*, opt_pass*)
(passes.cc:2768)
==29710==    by 0x1276A18: expand (cgraphunit.cc:1859)
==29710==    by 0x1276A18: cgraph_node::expand() (cgraphunit.cc:1812)
==29710==    by 0x127885A: expand_all_functions (cgraphunit.cc:2042)
==29710==    by 0x127885A: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2419)
==29710==    by 0x127AF7D: compile (cgraphunit.cc:2329)
==29710==    by 0x127AF7D: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2608)
==29710==    by 0x1844C72: compile_file() (toplev.cc:480)
==29710==    by 0x1027EBF: do_compile (toplev.cc:2222)
==29710==    by 0x1027EBF: toplev::main(int, char**) (toplev.cc:2385)
==29710==    by 0x102A0CD: main (main.cc:39)
==29710==  Address 0xabababababababad is not stack'd, malloc'd or (recently)
free'd
==29710== 
during RTL pass: avlprop
testcase.c: In function 'foo':
testcase.c:10:1: internal compiler error: Segmentation fault
   10 | }
      | ^
0x3263171 internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:534
...

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20250814081827-r16-3200-g82d1617551aad4-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/16.0.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-isa-spec=2.2 --with-sysroot=/usr/riscv64-unknown-linux-gnu
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--enable-libsanitizer --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20250814081827-r16-3200-g82d1617551aad4-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20250814 (experimental) (GCC)

Reply via email to