@@ -3191,13 +3191,17 @@ constrain_operands (int strict, alternative_mask alternatives)
strictly valid, i.e., that all pseudos requiring hard regs
have gotten them. We also want to make sure we have a
valid mode. */
- if ((GET_MODE (op) == VOIDmode
- || SCALAR_INT_MODE_P (GET_MODE (op)))
- && (strict <= 0
- || (strict_memory_address_p
- (recog_data.operand_mode[opno], op))))
- win = true;
- break;
+ {
+ auto mem_mode = (recog_data.is_asm
+ ? VOIDmode
+ : recog_data.operand_mode[opno]);
+ if ((GET_MODE (op) == VOIDmode
+ || SCALAR_INT_MODE_P (GET_MODE (op)))
+ && (strict <= 0
+ || strict_memory_address_p (mem_mode, op)))
+ win = true;
+ break;
+ }
/* No need to check general_operand again;
it was done in insn-recog.cc. Well, except that reload
@@ -986,8 +986,10 @@ recog_level2 (insn_change &change, add_regno_clobber_fn add_regno_clobber)
pat = newpat;
}
+ // check_asm_operands checks the constraints after RA, so we don't
+ // need to do it again.
INSN_CODE (rtl) = icode;
- if (reload_completed)
+ if (reload_completed && !asm_p)
{
extract_insn (rtl);
if (!constrain_operands (1, get_preferred_alternatives (rtl)))
new file mode 100644
@@ -0,0 +1,2 @@
+/* { dg-options "-O2" } */
+void f(char *p) { asm("prfm pldl1keep, %a0\n" :: "p" (p + 6)); }