https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116780

--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Maybe this one is related to the fact that LRA doesn't set strict when it is in
strict-RTL mode?  For example, with your latest test case:

$avr-gcc foo.c -S -mlra -O1 -mmcu=atmega128 -fdump-rtl-final
-mlog=legitimate_address_p

...
avr_legitimate_address_p[f:reload(322)]: ret=1, mode=QI strict=0
reload_completed=0 ra_in_progress=1 (reg_renumber):(r28 ---> r28)
(plus:HI (reg/f:HI 28 r28)
    (const_int 1 [0x1]))

avr_legitimate_address_p[f:reload(322)]: ret=1, mode=QI strict=0
reload_completed=0 ra_in_progress=1 (reg_renumber):(r28 ---> r28)
(plus:HI (reg/f:HI 28 r28)
    (const_int 1 [0x1]))

avr_legitimate_address_p[f:reload(322)]: ret=1, mode=QI strict=0
reload_completed=1 ra_in_progress=0 (reg_renumber):(r32 ---> r32)
(plus:HI (reg/f:HI 32 __SP_L__)
    (const_int 1 [0x1]))

avr_legitimate_address_p[f:postreload(323)]: ret=1, mode=QI strict=0
reload_completed=1 ra_in_progress=0 (reg_renumber):(r32 ---> r32)
(plus:HI (reg/f:HI 32 __SP_L__)
    (const_int 1 [0x1]))

avr_legitimate_address_p[f:split2(327)]: ret=1, mode=QI strict=0
reload_completed=1 ra_in_progress=0 (reg_renumber):(r32 ---> r32)
(plus:HI (reg/f:HI 32 __SP_L__)
    (const_int 1 [0x1]))

...

i.e. strict=0 in all calls, and hence the backend returns ret=1 for SP+const
addresses.

Reply via email to