https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83726
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vmakarov at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Wonder if this isn't a LRA bug though, the insn in question is: (define_insn "*movti_aarch64" [(set (match_operand:TI 0 "nonimmediate_operand" "=r, w,r,w,r,m,m,w,m") (match_operand:TI 1 "aarch64_movti_operand" " rn,r,w,w,m,r,Z,m,w"))] "(register_operand (operands[0], TImode) || aarch64_reg_or_zero (operands[1], TImode))" and aarch64_movti_operand doesn't allow CONST_WIDE_INT: (define_predicate "aarch64_movti_operand" (and (match_code "reg,subreg,mem,const_int") (ior (match_operand 0 "register_operand") (ior (match_operand 0 "memory_operand") (match_operand 0 "const_int_operand"))))) and the legitimate_constant_p target hook doesn't allow that either, yet simplify_operand_subreg will do else if (CONSTANT_P (reg)) { /* Try to simplify subreg of constant. It is usually result of equivalence substitution. */ if (innermode == VOIDmode && (innermode = original_subreg_reg_mode[nop]) == VOIDmode) innermode = curr_static_id->operand[nop].mode; if ((new_reg = simplify_subreg (mode, reg, innermode, SUBREG_BYTE (operand))) != NULL_RTX) { *curr_id->operand_loc[nop] = new_reg; return true; } } and nothing calls the predicate nor the legitimate_constant_p target hook for it. Is that because LRA operates only on constraints, not predicates, and seeing "n" defined as: (define_constraint "n" "Matches a non-symbolic integer constant." (and (match_test "CONST_SCALAR_INT_P (op)") (match_test "!flag_pic || LEGITIMATE_PIC_OPERAND_P (op)"))) doesn't indeed require anything? If so, shouldn't *movti_aarch64 use a different constraint, that either requires arbitrary "const_int", so just (define_constraint "whatever" "..." (match_code "const_int")) or requires a scalar int that satisfies target_legitimate_constant_p?