Skip sub-RTXes of the memory operand if stack access register is
not mentioned in the operand.
gcc/ChangeLog:
* config/i386/i386.cc (ix86_update_stack_alignment): Skip sub-RTXes
of the memory operand if stack access register is not mentioned in
the operand.
FOR_EACH_SUBRTX (iter, array, pat, ALL)
{
auto op = *iter;
- if (MEM_P (op) && reg_mentioned_p (p->reg, op))
+ if (MEM_P (op))
{
- unsigned int alignment = MEM_ALIGN (op);
+ if (reg_mentioned_p (p->reg, XEXP (op, 0)))
+ {
+ unsigned int alignment = MEM_ALIGN (op);
- if (alignment > *p->stack_alignment)
- *p->stack_alignment = alignment;
- break;
+ if (alignment > *p->stack_alignment)
+ *p->stack_alignment = alignment;
+ break;
+ }
+ else
+ iter.skip_subrtxes ();
}
}
}