This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH:[darwin] fix load of a misaligned double word
- From: Geoff Keating <geoffk at geoffk dot org>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: fjahanian at apple dot com (fj), pinskia at physics dot uc dot edu, gcc-patches at gcc dot gnu dot org
- Date: 07 Jan 2004 11:38:21 -0800
- Subject: Re: PATCH:[darwin] fix load of a misaligned double word
- References: <200312291446.hBTEk4Qk015420@banach.math.purdue.edu><200401062128.i06LS9T26278@makai.watson.ibm.com>
David Edelsohn <dje@watson.ibm.com> writes:
> Separate from the discussion of the implementation defined results
> of the pointer manipulation, the invalid assembly code is related to the
> way that GCC validates addresses. GCC classifies addresses based on MODE,
> not instructions, like other production compilers. This limitation forces
> the PowerPC backend either to restrict valid addresses to the lowest
> common denominator or to accept the widest range of addresses and force
> the address to conform to the instruction when emitted.
>
> The following patch is an example of the contortions that would
> need to be done to handle these illegal offsets in movdf_hardfloat64.
> That patch is not complete, nor correct, nor a proposal for a final
> solution. It is intended for discussion purposes only.
In GCC, you can classify addresses based on instructions by using
constraints. A constraint listed in EXTRA_MEMORY_CONSTRAINTS is a
restricted kind of memory address ('o' is the other restricted kind of
memory address). Reload already knows that if it has a memory
operand, and a restricted memory constraint, but the operand doesn't
match the constraint, it should try to compute the address in a base
register and create a new memory operand.
I think a patch along these lines will be much much better than trying
to do contortions in movdf_*.
--
- Geoffrey Keating <geoffk@geoffk.org>