gcc/ChangeLog
PR target/97540
* ira.c: (ira_setup_alts): Extract memory from operand only
for special memory constraint.
* recog.c (asm_operand_ok): Ditto.
* lra-constraints.c (process_alt_operands): MEM_P is
required for normal memory constraint.
gcc/testsuite/ChangeLog
* gcc.target/i386/pr97540.c: New test.
default:
{
enum constraint_num cn = lookup_constraint (p);
+ rtx mem = NULL;
switch (get_constraint_type (cn))
{
case CT_REGISTER:
goto op_success;
case CT_MEMORY:
+ mem = op;
+ /* Fall through. */
case CT_SPECIAL_MEMORY:
- if (MEM_P (extract_mem_from_operand (op)))
+ if (!mem)
+ mem = extract_mem_from_operand (op);
+ if (MEM_P (mem))
goto op_success;
win_p = true;
break;
break;
case CT_MEMORY:
- if (satisfies_memory_constraint_p (op, cn))
+ if (MEM_P (op)
+ && satisfies_memory_constraint_p (op, cn))
win = true;
else if (spilled_pseudo_p (op))
win = true;
/* FALLTHRU */
default:
cn = lookup_constraint (constraint);
+ rtx mem = NULL;
switch (get_constraint_type (cn))
{
case CT_REGISTER:
break;
case CT_MEMORY:
+ mem = op;
+ /* Fall through. */
case CT_SPECIAL_MEMORY:
/* Every memory operand can be reloaded to fit. */
- result = result || memory_operand (extract_mem_from_operand (op),
- VOIDmode);
+ if (!mem)
+ mem = extract_mem_from_operand (op);
+ result = result || memory_operand (mem, VOIDmode);
break;
case CT_ADDRESS:
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int mt7615_add_interface_dev_0;
+int ffs(int x) { asm("" : : "rm"(x)); }
+int mt7615_add_interface() { ffs(~mt7615_add_interface_dev_0); }