More help to my port.
Anders Ådland
aaadland@atmel.no
Mon Sep 8 11:22:00 GMT 2003
On Sat, 06 Sep 2003 18:22:19 -0700, Jim Wilson <wilson@tuliptree.org>
wrote:
> Anders Ã
dland wrote:
>> I know that LEGITIMATE_ADDRESS is defined in two versions depending on
>> if REG_OK_STRICT is defined or not, but this macro is only used to
>> check if the first version of the insn is legal, not the others.
>
> This is handled by reload. find_reload will see a MEM operand, and call
> find_reloads_address, which will call strict_memory_address_p which
> calls GO_IF_LEGITIMATE_ADDRESS. If this doesn't force a reload, then
> probably your GO_IF_LEGITIMATE_ADDRESS macro still has a subtle bug.
Only the first insn is checked with GO_IF_LEGITIMATE_ADDRESS:
(set (mem:SI (reg:SI 76))
(reg:SI 83))
The other two are not.
> Reload uses constraints rather than predicates, so if there is a problem
> with your constraints, then you could also run into this problem. For
> instance, if you tried to define your own constraints via
> EXTRA_CONSTRAINTS that don't properly handle memory addresses.
I can change the constraints and predicates to not allow
(set (mem:SI (plus:SI (reg:SI 39)
(reg:SI 154)))
(reg:SI 83))
because (reg:SI 154) is a pseudo register. This will however make the code
less optimized. There must be other ways to do this!
Do I have to define LEGITIMIZE_RELOAD_ADDRESS as Alexandre proposed? It
should only be used for performance reasons. Maby I have to not allow
pseudo registers in the constraint and define LEGITIMIZE_RELOAD_ADDRESS to
optimize the code again?
Anders
More information about the Gcc
mailing list