This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: RFA reload.c patch

Eric Christopher wrote:

>        * reload1.c (reload): Revert previous patch. Make
>        check for assignment into reg_equiv_address stricter.

This breaks bootstrap on s390.

First of all, I guess this:

-           else if (CONSTANT_P (XEXP (x, 0))
+           else if ((CONSTANT_P (x)
+                     && LEGITIMATE_CONSTANT_P (x)
+                     && PREFERRED_RELOAD_CLASS (x, class) != NO_REGS)

should be using XEXP (x, 0) instead of x.

But even with this fixed, s390 doesn't work.  What happens is that
reload goes into a endless loop, because now some stack slot addresses 
aren't even accepted as reg_equiv_address; to fix this, reload calls 
alter_reg, which assigns another stack slot, whose address still isn't 
accepted etc. until memory runs out.

In fact, I do not understand the reason for this change, seeing as
reg_equiv_address is specifically intended to hold invalid addresses,
as long as they are of the form REG + CONST; see the comment

         If it is not addressable but is a constant or the sum of a hard reg
         and constant, it is probably not addressable because the constant is
         out of range, in that case record the address; we will generate
         hairy code to compute the address in a register each time it is
         needed.  Similarly if it is a hard register, but one that is not
         valid as an address register.


  Dr. Ulrich Weigand

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]