This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc port based on MIPS
"kernel coder" <lhrkernelcoder@gmail.com> writes:
> thanks,There is a macro LEGITIMIZE_RELOAD_ADDRESS.Accroding to gcc internals
> "It is a C compound statement that attempts to replace x, which is an
> address that needs
> reloading, with a valid memory address for an operand of mode mode.
> win will be a
> C statement label elsewhere in the code".
>
> I'm not been able to comprehend this macro.
LEGITIMIZE_RELOAD_ADDRESS is basically a hook into the reload pass to
do machine specific optimizations. It is difficult to understand
without a clear notion of what the reload pass does.
> The explaination is saying
> that it tries to replace the address with some suitable address.But
> when will such a situation occur,any example will be helpful.
You can find examples by doing a grep for LEGITIMIZE_RELOAD_ADDRESS in
gcc/config/*/*.h.
> And what
> is reloading pass.According to gcc internals in this pass
> pseudo-registers are replaced with hard registers and some are
> assigned stack slots.Is there anything else which happens in this
> phase.
That's pretty much it. The details get rather complex. There is some
discussion at http://gcc.gnu.org/wiki/reload.
> Is above mentioned macro also has something to do with pass.
Yes.
Ian