https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82058
Bug ID: 82058 Summary: ICE in process_alt_operands, at lra-constraints.c:2954 (after adding early clobber in .md) Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org Target Milestone: --- At r251537, with this patch: ... diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index d61afcf..a42358d 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -1741,7 +1741,7 @@ (set_attr "mode" "<MODE>")]) (define_insn "srcp14<mode>_mask" - [(set (match_operand:VF_128 0 "register_operand" "=v") + [(set (match_operand:VF_128 0 "register_operand" "=&v") (vec_merge:VF_128 (vec_merge:VF_128 (unspec:VF_128 ... and this test-case: ... typedef double v2df __attribute__ ((__vector_size__ (16))); v2df foo (unsigned char u, v2df a, v2df b) { v2df zero = __extension__ (typeof (zero)){ 0.0f, 0.0f }; return __builtin_ia32_rcp14sd_mask (a, b, zero, u); } ... compiled like this: ... $ gcc avx-1.c -O2 -S -mavx512f ... we run into this ICE: ... during RTL pass: reload avx-1.c: In function ‘foo’: avx-1.c:8:1: internal compiler error: in process_alt_operands, at lra-constraints.c:2954 } ^ 0xdf7053 process_alt_operands gcc/lra-constraints.c:2954 0xdfafc4 curr_insn_transform gcc/lra-constraints.c:3850 0xdffdcc lra_constraints(bool) gcc/lra-constraints.c:4846 0xde2237 lra(_IO_FILE*) gcc/lra.c:2392 0xd6f378 do_reload gcc/ira.c:5440 0xd6f83c execute gcc/ira.c:5624 ... The ICE in more detail: ... (gdb) #6 0x0000000000df7054 in process_alt_operands (only_alternative=-1) at gcc/lra-constraints.c:2954 2954 lra_assert (reject > 0); (gdb) p reject $1 = 0 ... The insn that triggers this ICE: ... (gdb) call debug_rtx (curr_insn) (insn 14 12 19 2 (set (reg:V2DF 93) (vec_merge:V2DF (vec_merge:V2DF (unspec:V2DF [ (reg/v:V2DF 91 [ a ]) ] UNSPEC_RCP14) (const_vector:V2DF [ (const_double:DF 0.0 [0x0.0p+0]) (const_double:DF 0.0 [0x0.0p+0]) ]) (subreg:QI (reg:SI 90 [ u ]) 0)) (reg:V2DF 22 xmm1 [ b ]) (const_int 1 [0x1]))) "avx-1.c":7 1503 {srcp14v2df_mask} (expr_list:REG_DEAD (reg/v:V2DF 91 [ a ]) (expr_list:REG_DEAD (reg:SI 90 [ u ]) (expr_list:REG_DEAD (reg:V2DF 22 xmm1 [ b ]) (nil))))) ... -fira-verbose output: ... Starting decreasing number of live ranges... ********** Local #1: ********** Spilling non-eliminable hard regs: 7 New elimination table: Can eliminate 16 to 7 (offset=8, prev_offset=0) Can eliminate 16 to 6 (offset=8, prev_offset=0) Can eliminate 20 to 7 (offset=0, prev_offset=0) Can eliminate 20 to 6 (offset=0, prev_offset=0) 0 Early clobber: reject++ 3 Matching earlyclobber alt: reject-- ... The documentation of reject is: ... /* REJECT is a count of how undesirable this alternative says it is if any reloading is required. If the alternative matches exactly then REJECT is ignored, but otherwise it gets this much counted against it in addition to the reloading needed. */ int reject; ...