Does a target system must support indexing?
Georg-Johann Lay
avr@gjlay.de
Fri Jun 1 12:38:00 GMT 2012
Setjem Setjem wrote:
> Does a target system must support indexing? I have tried to disable
> indexing by setting the following macros:
>
> #define INDEX_REG_CLASS NO_REGS
> #define REGNO_OK_FOR_INDEX_P(num) 0
>
> and rejecting all addresses with side effects in the target
> hook TARGET_LEGITIMATE_ADDRESS_P.
>
> But it seems that the compiler still trying to use indexes.
> For example the compiler fails at:
>
> C-code:
>
> void fail(long long *v)
> {
> *v += 1;
> }
>
> Failure:
>
> fail.c: In function 'fail':
> fail.c:4:1: internal compiler error: in change_address_1, at emit-rtl.c:1933
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
>
> Last debug info from TARGET_LEGITIMATE_ADDRESS_P:
>
> legitimate_address_p:
> mode: (SI) (reload_completed) (reg_renumber):
> (r18 ---> r18)
> address: (plus:SI (reg/f:SI 18 r18)
> (const_int 4 [0x4]))
> return false
This is not indexed addressing. Indexed addressing would be
[reg+reg] or [reg + const*reg]
> I am not sure if it fails because of the index or i made
> some mistakes in describing the handling of long long values.
> But still. Why the compiler tried to use indexing?
Look at TARGET_LEGITIMIZE_ADDRESS and at expand time you can
force the [reg+const] addresses into a register.
Johann
More information about the Gcc-help
mailing list