This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: More help to my port.
- From: Anders Ådland <aaadland at atmel dot no>
- To: Jim Wilson <wilson at tuliptree dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 08 Sep 2003 10:58:04 +0200
- Subject: Re: More help to my port.
- References: <opru04effa4anuxc@store> <3F5A884B.2030506@tuliptree.org>
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