When searching prefered hard regs from too strict constraints we can ignore
some alternatives for subsequent operands. This can result in worse code
generation. The patch fixes this.
gcc/ChangeLog:
* ira-lives.cc (ira_implicitly_set_insn_hard_regs): Use the same
start prefered for all operand.
mode = (GET_CODE (op) == SCRATCH
? GET_MODE (op) : PSEUDO_REGNO_MODE (regno));
cl = NO_REGS;
- for (; (c = *p); p += CONSTRAINT_LEN (c, p))
+ for (alternative_mask curr_preferred = preferred;
+ (c = *p);
+ p += CONSTRAINT_LEN (c, p))
if (c == '#')
- preferred &= ~ALTERNATIVE_BIT (0);
+ curr_preferred &= ~ALTERNATIVE_BIT (0);
else if (c == ',')
- preferred >>= 1;
- else if (preferred & 1)
+ curr_preferred >>= 1;
+ else if (curr_preferred & 1)
{
cl = reg_class_for_constraint (lookup_constraint (p));
if (cl != NO_REGS)