This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: reload problems....
- To: Alan Lehotsky <apl at alum dot mit dot edu>
- Subject: Re: reload problems....
- From: thomas joseph <thomascanny at yahoo dot co dot nz>
- Date: Tue, 24 Jul 2001 02:13:15 +1200 (NZST)
- Cc: gcc at gcc dot gnu dot org
Hi Alan,
thanks for your reply. I have already defined
SMALL_REGISTER_CLASSES and CLASSES_LIKELY_SPILLED
macros.
Do I need to define LEGITIMIZE_RELOAD_ADDRESS macro
??
I defined LEGITIMIZE_ADDRESS macro to make the
illegitimate addresses as legitimate. It handles only
one case , in the indexed addressing mode when the
displacement goes out of range (-128 to 127).
It is defined as :
#define LEGITIMIZE_ADDRESS (OLDX, MODE, WIN) \ {
\
if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0))
== REG && GET_CODE (XEXP (X, 1)) == CONST_INT \
&& !VALID_CONSTANT_OFFSET_P (XEXP (X, 1), MODE))\
{\
rtx xop0 = XEXP (X, 0); \
rtx xop1 = XEXP (X, 1); \
xop1 = force_reg (HImode, xop1); \
(X) = force_reg (Pmode, gen_rtx_PLUS (Pmode,
xop0, xop1)); \
goto WIN; \
} \
}
I could not identify the potential cases for
LEGITIMIZE_RELOAD_ADDRESS. May be I need to look for
that !!!! any suggestions ....
I have been working on this port for the last six
months. How much time is sufficient enough to build a
newport (for a fresh compilers engineer).
thanks and regards,
V.Brahmaiah
--- Alan Lehotsky <apl@alum.mit.edu> wrote: > At 2:30
AM +1200 7/21/01, thomas joseph wrote:
>
> >Hi All,
> > I am working for a new gcc port. I am towards
> >finishing the port. I am compiling newlib.
> >It has few reload problems. I am just showing you
> the
> >kind of problems that I am facing.....
> >
> > On my machine I have two index registers.Out of
> >them
> >one is frame pointer. and I can use the other for
> >reloading and similar purposes.
>
>
> I've done a couple of ports with these kinds of
> limitations. It is really pushing the
> limits of gcc and reload.
>
> First, there are some obvious things you should
> check, like to make sure that
>
> 1/ SMALL_REGISTER_CLASSES is defined
> 2/ CLASS_LIKELY_SPILLED_P is defined for the class
> containing your index register.
>
> But, I bet that you've already done that, or you'd
> have a LOT more failures.
>
> The next thing is to look at defining the
> LEGITIMIZE_RELOAD_ADDRESS macro and using it
> to force the kind of reloads you need.
>
> To actually look at what reload is "thinking", you
> call run the compiler under gdb and after it
> aborts, you call do
>
> call debug_reload()
>
> and it will print out a nicely formatted dump of
> the current reloads for the instruction.
>
> You may find it necessary to alter your .MD file to
> prevent creating instructions with
> too many reloads.
>
> For example, on one of my ports, we had to change
> the .md file, so that there were NEVER two
> memory operands in any INSN, despite the fact that
> we we had a two-address machine.
>
> I wonder though if the "fixed or forbidden
> register" message indicates that you've marked the
> IX
> register as "fixed". In that case, I believe that
> the compiler won't allocate it and THAT's why
> you're crashing.......
>
> --
>
------------------------------------------------------------------------
>
> Quality Software Management
> http://home.earthlink.net/~qsmgmt
> apl@alum.mit.edu
> (978)287-0435 Voice
> (978)808-6836 Cell
> (978)287-0436 Fax
>
> Software Process Improvement and Management
> Consulting
> Language Design and Compiler Implementation