https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117286
Bug ID: 117286 Summary: [RISC-V] internal compiler error: Segmentation fault `__riscv_vlmul_ext_v_f16mf2_f16m1` Product: gcc Version: 14.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: yibohe at pku dot edu.cn Target Milestone: --- For the following code with rvv intrinsics: ``` #include <riscv_vector.h> _Float16 a[10]; void func(){ int placeholder0 = 10; _Float16* ptr_a = a; for (size_t vl; placeholder0 > 0; placeholder0 -= vl){ vl = __riscv_vsetvl_e16m1(placeholder0); vfloat16mf2_t va = __riscv_vle16_v_f16mf2(ptr_a, vl); vfloat16m1_t vb = __riscv_vlmul_ext_v_f16mf2_f16m1(va); ptr_a += vl; } } ``` ICE is triggered with option `-O1`, `-O2`, `-O3`, and `-Os`. ``` riscv64-unknown-elf-gcc -march=rv64gcv_zvfh -mabi=lp64d -Wno-psabi -static -O1 -freport-bug 1.c during RTL pass: expand 1.c: In function 'func': 1.c:9:23: internal compiler error: Segmentation fault 9 | vfloat16m1_t vb = __riscv_vlmul_ext_v_f16mf2_f16m1(va); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0x10439c3 crash_signal ../.././gcc/gcc/toplev.cc:319 0xc3c78d gen_lowpart_common(machine_mode, rtx_def*) ../.././gcc/gcc/emit-rtl.cc:1569 0xfe6e59 gen_lowpart_general(machine_mode, rtx_def*) ../.././gcc/gcc/rtlhooks.cc:48 0x1494ea2 riscv_vector::vlmul_ext::expand(riscv_vector::function_expander&) const ../.././gcc/gcc/config/riscv/riscv-vector-builtins-bases.cc:1765 0x148e39b riscv_vector::function_expander::expand() ../.././gcc/gcc/config/riscv/riscv-vector-builtins.h:651 0x148e39b riscv_vector::expand_builtin(unsigned int, tree_node*, rtx_def*) ../.././gcc/gcc/config/riscv/riscv-vector-builtins.cc:4703 0xb41cd4 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int) ../.././gcc/gcc/builtins.cc:7769 0xc6d594 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../.././gcc/gcc/expr.cc:12361 0xb63e24 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier) ../.././gcc/gcc/expr.h:316 0xb63e24 expand_call_stmt ../.././gcc/gcc/cfgexpand.cc:2865 0xb63e24 expand_gimple_stmt_1 ../.././gcc/gcc/cfgexpand.cc:3932 0xb63e24 expand_gimple_stmt ../.././gcc/gcc/cfgexpand.cc:4077 0xb68d3f expand_gimple_basic_block ../.././gcc/gcc/cfgexpand.cc:6133 0xb6b5e7 execute ../.././gcc/gcc/cfgexpand.cc:6872 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/cca2ogQP.out file, please attach this to your bugreport. ```