This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: RFA reload.c patch
- From: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: echristo at redhat dot com, wilson at specifixinc dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 18 Nov 2003 00:39:06 +0100 (CET)
- Subject: 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.
Bye,
Ulrich
--
Dr. Ulrich Weigand
weigand@informatik.uni-erlangen.de