https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127739
--- Comment #4 from Li Pan <pan2.li at intel dot com> ---
Ack.
It cannot be reproduced from the trunk now, with below code(groche97 provided),
version and cmd.
Since there are some fixes including the backend and middle-end for overlap,
could you please help to have a try from the newest trunk for groche97 provided
sample?
But I can reproduce the ICE with the test provided by Anton. Not very sure if
it is related to overlap change, will take a look and see.
> Unfortunately, this patch leads to such registers overlap that is invalid
> from > the spec's point of view
Could you please help to share more about what is invalid from the perspective
of rvv spec? Specially for vfwcvt.f.x[u].v.
-----------
#include <riscv_vector.h>
vint32m4_t f(vint8m4_t p1, vint32m4_t p2, vint8m2_t p3) {
vint8m2_t a = __riscv_vget_v_i8m4_i8m2(p1, 0);
vint16m4_t b = __riscv_vwmul_vv_i16m4(a, p3, 32);
vint16m2_t c = __riscv_vget_v_i16m4_i16m2(b, 0);
vint32m4_t d = __riscv_vwmacc_vx_i32m4(p2, 1, c, 0);
return d;
}
------------------
❮ ../__RV64/bin/riscv64-unknown-elf-gcc -march=rv64gcv -mabi=lp64d -O1
pr127739.c -c -S -o -
.file "pr127739.c"
.option nopic
.attribute arch,
"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_v1p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_zve32f1p0_zve32x1p0_zve64d1p0_zve64f1p0_zve64x1p0_zvl128b1p0_zvl32b1p0_zvl64b1p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.text
.align 1
.globl f
.variant_cc f
.type f, @function
f:
li a5,32
vsetvli zero,a5,e8,m2,ta,ma
vmv2r.v v18,v8
vwmul.vv v8,v18,v16
vsetivli zero,0,e16,m2,ta,ma
vwadd.wv v12,v12,v8
vmv4r.v v8,v12
ret
.size f, .-f
.ident "GCC: (GNU) 17.0.0 20261114 (experimental)"
.section .note.GNU-stack,"",@progbits
❯ ../__RV64/bin/riscv64-unknown-elf-gcc --version
riscv64-unknown-elf-gcc (GCC) 17.0.0 20261114 (experimental)
Copyright (C) 2026 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.