HOPa: Fix constant pool handling for non-HP-UX targets
HOPa's read_only_operand predicate now correctly handles constant pool placement for non-HP-UX PA-RISC targets.
The HOPa compiler component’s read_only_operand predicate incorrectly assumed constant pools were always in the TEXT section for non-PIC code. This assumption was specific to 32-bit HP-UX. The predicate has been updated to explicitly check for !TARGET_HPUX, ensuring that constant pool logic is correctly applied to non-HP-UX PA-RISC targets like pa-linux.
In Details
In GCC's PA-RISC backend, the read_only_operand predicate in config/pa/predicates.md previously assumed CONSTANT_POOL_ADDRESS_P was valid for SYMBOL_REF when flag_pic was false, which is an HP-UX specific behavior. This commit modifies the predicate to check !TARGET_HPUX before applying this logic, thus correcting constant pool addressability for non-HP-UX PA-RISC targets.
- HOPa
- HP Optimization Analyzer, a component within GCC for optimizing code on HP PA-RISC processors.
- Predicate
- In GCC's machine description files, a predicate is a boolean condition used to determine if a particular instruction or optimization is valid for a given target or situation.
- PIC
- Position-Independent Code. Code that can be loaded and executed at any memory address without modification. Often used in shared libraries.
- Constant Pool
- A section in compiled code that stores constant values used by the program, allowing them to be referenced efficiently.