https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117657
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |15.0 --- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> --- We have: ------------------ (gdb) p debug_rtx(insn) (insn 90 89 91 15 (set (reg:V32QI 696 [ vect_patt_45.10 ]) (vec_merge:V32QI (unspec:V32QI [ (plus:V32DI (reg:V32DI 752) (vec_duplicate:V32DI (const_int 0 [0]))) (const_int 0 [0]) (unspec:V32QI [ (const_int 0 [0]) ] UNSPEC_VECTOR) (mem:BLK (scratch) [0 A8]) ] UNSPEC_GATHER) (reg:V32QI 696 [ vect_patt_45.10 ]) (reg:DI 750))) -1 (nil)) ------------------------------------ This fails for gcn/gcn-valu.md:1137 ; Allow any address expression (define_expand "gather<mode>_expr<exec>" [(set (match_operand:V_MOV 0 "register_operand") (unspec:V_MOV [(match_operand 1 "") (match_operand 2 "immediate_operand") (match_operand 3 "immediate_operand") (mem:BLK (scratch))] UNSPEC_GATHER))] "" {}) The generated code looks like: switch (XVECLEN (x4, 0)) { case 4: ... x11 = XVECEXP (x4, 0, 2); if (!immediate_operand (x11, E_VOIDmode)) return -1; which is (gdb) p debug_rtx(x11) (unspec:V32QI [ (const_int 0 [0]) ] UNSPEC_VECTOR) ... Breakpoint 2, immediate_operand (op=0x7ffff7408490, mode=E_VOIDmode) at gcc/recog.cc:1698 1698 { (gdb) p debug_rtx(op) (const_int 0 [0]) which calls in turn gcn_legitimate_constant_p (machine_mode, rtx x) which calls 1045 gcn_constant_p (rtx x) for E_V32QImode. But GET_CODE(x) == 'unspec', which is not handled by gcn_constant_p - which returns false. Thus, at the end -1 is the result of the insn - causing the failure.