This is the mail archive of the
mailing list for the GCC project.
Legitimize address after reload
- From: David Guillen <david at davidgf dot net>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 14 Mar 2014 12:52:35 +0100
- Subject: Legitimize address after reload
- Authentication-results: sourceware.org; auth=none
I'm writing a simple gcc backend and I'm experiencing a weird thing
regarding address legitimation process. Two scenarios:
If I only allow addresses to be either a register or symbols my gcc
works. To do so I add the restrictions into the
TARGET_LEGITIMATE_ADDRESS_P macro. This makes gcc to force registers
for all the addresses.
If I allow also a 'PLUS' expression to be a valid address (adding the
restriction that the two addends are a register and a constant) it
happens (sometimes) that gcc comes up with an expression like this
(plus:SI (plus:SI (reg:SI somereg)
After taking a look at the 386 backend (and others) I just discovered
that there is a function called LEGITIMIZE_RELOAD_ADDRESS which is
responsible for handling this case. My issue is that this function is
not being called and, from what I saw while debugging, it seems that
the offending RTX expression is created after the address_reload pass,
and thus impossible for this pass to legitimize the address.
Looking at other architectures it seems that they are doing more or
less the same, so I don't know what the issue might be.
Do you have any idea?