[PATCH] Fix PR middle-end/28690, indexed load/store performance + reload bug

Peter Bergner bergner@vnet.ibm.com
Mon Dec 11 17:24:00 GMT 2006


On Mon, Dec 11, 2006 at 05:36:35PM +0100, Ulrich Weigand wrote:
> I agree that insns should be recogizable at all times.  So we need to find
> out why reg 65 is placed there: if this is incorrect, we need to fix it,
> if it is correct, we'd have to adapt the predicate along the lines Michael
> points out.

AT line 602 in global.c, we have the following:

            /* If we have more than one register class,
               first try allocating in the class that is cheapest
               for this pseudo-reg.  If that fails, try any reg.  */
            if (N_REG_CLASSES > 1)
              {
                find_reg (allocno_order[i], 0, 0, 0, 0);
                if (reg_renumber[allocno[allocno_order[i]].reg] >= 0)
                  continue;
              }
            if (reg_alternate_class (allocno[allocno_order[i]].reg) != NO_REGS)
              find_reg (allocno_order[i], 0, 1, 0, 0);

In this case, the first "find_reg (allocno_order[i], 0, 0, 0, 0)" fails to
find a register, so we're forced to find a register in an alternate class.
For pseudo 238, reg_alternate_class() returns ALL_REGS, so we call
"find_reg (allocno_order[i], 0, 1, 0, 0)" and it's this call that we get
reg 65.  I'll dig in a little more to see why we didn't get a reg during
the first call to find_reg.

Peter





More information about the Gcc-patches mailing list