gnu /
gcc /
ecac1841e6828fb8999c1becbc52798133dd2c17 hppa: Fix scaled and unscaled index support on targets with non-equivalent space registers
HP-UX targets have non-equivalent space registers. The base register
in most loads and stores selects the space register used to calculate
the global virtual address for the instruction.
Previously, the PA-RISC backend attempted to canonicalize the
register order in INDEX + BASE register addresses. This has always
been problematic as reload would sometimes lose the REG_POINTER
flag used to mark a base register. As a result, we allowed any
register order after reload and prayed the registers would be
in canonical order.
This broke with the new late_combine2 pass. It sometimes creates
new indexed instructions after reload. pa_legitimate_address_p
needs updating to ensure the base register is marked with the
REG_POINTER flag and the index register is not marked.
If scaled index instructions are created before reload, the LRA
pass will sometimes convert it an unscaled index instruction
plus reloads and drop the REG_POINTER flag that was in the base
register. Thus, we can't allow scaled and unscaled index loads
and stores until reload is completed.
2025-11-23 John David Anglin <danglin@gcc.gnu.org>
gcc/ChangeLog:
* config/pa/pa.cc (pa_print_operand): Use REG_POINTER
flag to select base and index registers on targets with
non-equivalent space registers.
(pa_legitimate_address_p): Don't allow scaled and unscaled
indexed addresses until reload is complete. Allow any
register order in unscaled addresses as long as the
REG_POINTER flag is correctly set/unset in the base/index
registers.
* config/pa/predicates.md (mem_operand): Remove code to
delay creating move insns with unscaled indexed addresses
until CSE is not expected.
(move_src_operand): Likewise.
2 files changed