hppa: Partially revert commit b55ba08f1055d5c8748699a36f419c8078044594
Reverts a recent optimization for loading symbolic operands on HPPA due to linker limitations with weak symbols.
This commit partially reverts a previous optimization on the HPPA target concerning the loading of symbolic operands. The original change, intended to improve code generation for ldil/addil sequences, caused failures with GNU ld when resolving unresolved weak symbols. The linker could not correctly fix up the sequence, leading to incorrect code. This reverts the problematic alternative, requiring a linker fix for full resolution.
In Details
On the hppa target, this commit partially reverts commit b55ba08f1055d5c8748699a36f419c8078044594 related to LRA (Local Register Allocation) improvements. The ldil/addil instruction sequence for loading the high part of a symbolic operand, specifically when dealing with unresolved weak symbols, cannot be correctly fixed up by GNU ld. The linker only replaces %dp with %r0 in the addil instruction, causing miscompilation. This revert removes that specific pa.md alternative to avoid the linker issue, pending a potential linker fix.
- HPPA
- Hewlett-Packard Precision Architecture, a RISC instruction set architecture.
- ldil/addil
- A pair of instructions on some architectures (like PA-RISC) used to load a 32-bit immediate value into a register, often used for accessing symbolic addresses or constants.
- GNU ld
- The standard dynamic linker and static linker from the GNU Project, used to combine object files and libraries into executables or other libraries.
- weak symbol
- A symbol in object code that has a default definition but can be overridden by a non-weak symbol of the same name. Linkers typically treat weak symbols specially, allowing them to be undefined or providing a fallback definition.
- LRA (Local Register Allocation)
- A phase in compilation where the compiler determines which variables and intermediate values should be held in machine registers during the execution of a basic block or function to minimize memory accesses.