This is the mail archive of the gcc@gcc.gnu.org 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: Help with define_insn and constraints


On 23 Dec 2004 16:36:01 -0500, Ian Lance Taylor <ian@airs.com> wrote:
> In principle calculate_needs_all_insns(), which is called after
> setting reg_equiv_memory_loc and reg_equiv_mem, is supposed to notice
> that it needs to reload the reference to P56.
> 
> In particular memory addresses will get handed via find_reloads() to
> find_reloads_address().  That is supposed to do the right thing for
> reg_equiv_memory_loc, etc.  This is where you can help out by defining
> LEGITIMIZE_RELOAD_ADDRESS.  Find out what find_reloads_address is
> doing with your addresses.
> 
> You may want to double check that spill_indirect_levels is initialized
> correctly in init_reload() for your system.

Well, I added a LEGITIMIZE_RELOAD_ADDRESS definition in the .h file,
with a stderr printout to show me how it was being used... and it
isn't being called at all. I traced through find_reloads_address for
the instructions we're looking at, [ P56 + 1 ] <- [ R20 + 17 ]. It was
called with ad being P56 + 1.

Since ad was not a REG RTL, we skipped that whole block. The next
check is if ad is a valid memory address in strict mode, which it is
-- why shouldn't it be; it's just a register plus 1. Next it checks to
see if the RTL is of the form REG + CONST, which it is, and if
reg_equiv_const for the register is null, which is is. In that case,
find_reloads_address returns 0 without falling through to
LEGITIMIZE_RELOAD_ADDRESS. So since the function returns 0, shouldn't
that mean that the address is not reloaded? If so, why is it being
substituted? Or am I failing to understand what "reloading an address"
means -- highly likely, since I'm new at this :)

spill_indirect_levels gets initialized to 0, which, if I understand
the comments correctly, should be right. As I understand it,
init_reload creates an RTX for [ REG + 4 ], sees if it's a valid
memory address, adds a level of indirection, and iterates from there.

The thing is, [ REG + 4 ] is not a valid memory address. As I probably
mentioned elsewhere, the only valid memory addresses my processor can
handle are registers, constants, and reg + constants. No double
indirection.

There must be something going wrong, but I can't see it. I need your
help badly :)

Thanks so much,

--Rob


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