This is the mail archive of the 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: PATCH:[darwin] fix load of a misaligned double word

David Edelsohn <> 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 <>

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