https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110277
Bug ID: 110277
Summary: RISC-V: ICE when build RVV intrinsic float reduction
with "-march=rv32gc_zve64d -mabi=ilp32d", both GCC 14
and 13.
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: pan2.li at intel dot com
Target Milestone: ---
Created attachment 55338
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55338&action=edit
Reproduce code
Given we have the below code.
#include "riscv_vector.h"y
vfloat32m1_t test_vfredmax_vs_f32mf2_f32m1(vfloat32mf2_t vector, vfloat32m1_t
scalar, size_t vl) {
return __riscv_vfredmax_vs_f32mf2_f32m1(vector, scalar, vl);
}
There will be the ICE when build similar as "riscv64-unknown-elf-gcc
-march=rv64gc_zve64d -mabi=lp64 -O3 -Wno-psabi -c -S test-float.c -o -".
test-float.c: In function ‘test_vfredmax_vs_f32mf2_f32m1’:
test-float.c:17:10: error: invalid argument to built-in function
17 | return __riscv_vfredmax_vs_f32mf2_f32m1(vector, scalar, vl);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
during RTL pass: expand
test-float.c:17:10: internal compiler error: Segmentation fault
0x16e8945 crash_signal
/home/pli/repos/gcc/555/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/toplev.cc:314
0x7fcc1724251f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x111c93c store_expr(tree_node*, rtx_def*, int, bool, bool)
/home/pli/repos/gcc/555/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/expr.cc:6345
0x111ae77 expand_assignment(tree_node*, tree_node*, bool)
/home/pli/repos/gcc/555/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/expr.cc:6048
0xf65d2c expand_call_stmt
/home/pli/repos/gcc/555/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/cfgexpand.cc:2829
0xf69ac6 expand_gimple_stmt_1
/home/pli/repos/gcc/555/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/cfgexpand.cc:3880
0xf6a1b3 expand_gimple_stmt
/home/pli/repos/gcc/555/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/cfgexpand.cc:4044
0xf72d20 expand_gimple_basic_block
/home/pli/repos/gcc/555/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/cfgexpand.cc:6096
0xf75279 execute
/home/pli/repos/gcc/555/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/cfgexpand.cc:6831