https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127662
Bug ID: 127662
Summary: RISC-V: -mrvv-max-lmul=conv-dynamic triggers assertion
in compare_lmul_to
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: anton at ozlabs dot org
Target Milestone: ---
Compiling this with -O3 -march=rv64gcv -mabi=lp64d -mrvv-max-lmul=conv-dynamic
typedef short a;
typedef struct { a b, c, d; } e;
e *f;
a g;
long h, i;
void j (void)
{
for (; i; i++)
{
h = f[i].c / 0.5;
g = 5 * h;
f[i].c = g;
}
}
hits an ICE:
during GIMPLE pass: vect
magick/attribute.c: In function 'SetImageChannelDepth':
magick/attribute.c:960:60: internal compiler error: in compare_lmul_to, at
config/riscv/riscv-vector-costs.cc:1161
0x354067b internal_error(char const*, ...)
source/gcc/gcc/diagnostic-global-context.cc:787
0xe9e5ae fancy_abort(char const*, int, char const*)
source/gcc/gcc/diagnostics/context.cc:1813
0xd82b21 riscv_vector::costs::compare_lmul_to(vector_costs const*) const
source/gcc/gcc/config/riscv/riscv-vector-costs.cc:1161
0x1c1c7db riscv_vector::costs::better_main_loop_than_p(vector_costs const*)
const
source/gcc/gcc/config/riscv/riscv-vector-costs.cc:1200
0x19b4fe2 vect_better_loop_vinfo_p
source/gcc/gcc/tree-vect-loop.cc:2776
0x19b4fe2 vect_joust_loop_vinfos
source/gcc/gcc/tree-vect-loop.cc:2786
0x19d06b2 vect_analyze_loop(loop*, gimple*, vec_info_shared*)
source/gcc/gcc/tree-vect-loop.cc:3028
0x1a3032c try_vectorize_loop_1
source/gcc/gcc/tree-vectorizer.cc:1099
0x1a3032c try_vectorize_loop
source/gcc/gcc/tree-vectorizer.cc:1218
0x1a30c9c execute
source/gcc/gcc/tree-vectorizer.cc:1335
gcc/riscv64-unknown-linux-gnu/17.0.0/cc1 -fpreprocessed attribute.i -quiet
-dumpbase attribute.i -dumpbase-ext .i -march=rv64gcv -mabi=lp64d
-mrvv-max-lmul=conv-dynamic -misa-spec=20191213 -mtls-dialect=trad
-march=rv64imafdcv_zicsr_zifencei_zmmul_zaamo_zalrsc_zca_zcd_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b
-O3 -ffast-math -o /tmp/ccWyDsPx.s