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

--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Created attachment 58559
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58559&action=edit
proposed patch

AVR: target/115733 - Improve __memx address handling.

Allow CONSTANT_ADDRESS_P addresses in insns that load from __memx.
This requires two new insns that can load the constant address parts of
(subreg:HI (symbol-or-const) 0)  and  (subreg:QI (symbol-or-const) 2).

        PR target/115733
gcc/
        * config/avr/predicates.md (const_symbol_operand): New.
        * config/avr/avr.cc (avr_addr_space_legitimate_address_p)
        [ADDR_SPACE_MEMX && CONSTANT_ADDRESS_P]: Return true.
        (avr_address_cost) [const_symbol_operand]: Costs 3.
        * config/avr/avr.md (mov<mode>) [avr_mem_memx_p]: Leave
        constant addresses alone.
        (xload8<mode>_A, xload<mode>_A): Allow CONSTANT_ADDRESS_P
        addresses in insn condition.
        (*set_z_lo16, *set_reg_hh8): New insns.

Reply via email to