https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127739
Bug ID: 127739
Summary: RISC-V: ICE in extract_constrain_insn,
pred_widen_floatunsv2df (vfwcvt.f.xu.v)
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
CC: bergner at gcc dot gnu.org
Target Milestone: ---
Target: riscv
Created attachment 65758
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65758&action=edit
Test case
I'm hitting an ICE on cpu2017 imagick_r when building with
-mno-autovec-segment. Attached is a reduced test case created with creduce and
some AI assistance.
riscv64-unknown-linux-gnu-gcc -O2 -ftree-vectorize -ffast-math -march=rv64gcv
-mabi=lp64d -mno-autovec-segment -c reduced.c
reduced.c: In function 't':
reduced.c:56:1: error: insn does not satisfy its constraints:
56 | }
| ^
(insn 554 563 702 27 (set (reg:V2DF 103 v7 [orig:545 vect__19.115_486 ] [545])
(if_then_else:V2DF (unspec:V2BI [
(const_vector:V2BI [
(const_int 1 [0x1]) repeated x2
])
(const_int 2 [0x2]) repeated x4
(reg:SI 66 vl)
(reg:SI 67 vtype)
] UNSPEC_VPREDICATE)
(unsigned_float:V2DF (reg:V2SI 103 v7 [544]))
(unspec:V2DF [
(reg:DI 0 zero)
] UNSPEC_VUNDEF))) "reduced.c":31:20 discrim 33280 20360
{pred_widen_floatunsv2df}
(nil))
during RTL pass: reload
reduced.c:56:1: internal compiler error: in extract_constrain_insn, at
recog.cc:2796
0x354213b internal_error(char const*, ...)
source/gcc/gcc/diagnostic-global-context.cc:787
0xe9e910 fancy_abort(char const*, int, char const*)
source/gcc/gcc/diagnostics/context.cc:1813
0xcd163d _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
source/gcc/gcc/rtl-error.cc:108
0xcd1669 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
source/gcc/gcc/rtl-error.cc:118
0xccff8d extract_constrain_insn(rtx_insn*)
source/gcc/gcc/recog.cc:2796
0x1475357 check_rtl
source/gcc/gcc/lra.cc:2246
0x1479b5f lra(_IO_FILE*, int)
source/gcc/gcc/lra.cc:2698
0x142cd2f do_reload
source/gcc/gcc/ira.cc:6097
0x142cd2f execute
source/gcc/gcc/ira.cc:6285
toolchain/libexec/gcc/riscv64-unknown-linux-gnu/17.0.0/cc1 -quiet -imultilib .
reduced.c -quiet -dumpbase reduced.c -dumpbase-ext .c -march=rv64gcv
-mabi=lp64d -mno-autovec-segment -misa-spec=20191213 -mtls-dialect=trad
-march=rv64imafdcv_zicsr_zifencei_zmmul_zaamo_zalrsc_zca_zcd_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b
-O2 -ftree-vectorize -ffast-math -o /tmp/ccMtYHsR.s
It bisected to 5a3ad9374a73 "tree-data-ref: use DR_PTR_INFO points-to info in
dr_may_alias_p [PR127201]", so the bug has likely always been there and the
patch just exposed it.