Fix hppa secondary reload issues with LRA
HPPA compiler's Local Register Allocation (LRA) is fixed to correctly handle secondary reloads for floating-point and large integer/float mode changes, resolvi…
This commit resolves several secondary reload issues encountered by the HPPA backend’s Local Register Allocation (LRA), which emerged after a previous fix for reload problems. It addresses incorrect handling of SImode/SFmode type punning, preventing SIGSEGV crashes by blocking cross-class type punning for modes fitting in a single float register. The changes also improve the handling of secondary reloads for REG+D addresses and fix issues with symbolic and constant loads for SFmode and DFmode by splitting out address calculations.
In Details
This commit cleans up secondary reload handling in the HPPA LRA for floating-point operations and cross-class type punning. Previously, pa_can_change_mode_class allowed too much flexibility, leading to SIGSEGV in SImode/SFmode punning. The fix blocks cross-class punning where modes fit in FP registers, simplifying secondary reload logic and removing special handling. It also refactors REG+D address reloads and adds explicit splitting of address calculation for naked symbolic/constant loads (SFmode/DFmode), including 64-bit PIC loads.
- LRA
- Local Register Allocation. A compiler optimization pass that allocates machine registers to program variables within a basic block or a small region of code.
- secondary reload
- In register allocation, a secondary reload occurs when an instruction requires a value that is not currently in a register and cannot be fetched directly. This necessitates spilling a value to memory and then reloading it, or using a scratch register.
- SImode
- A machine mode representing a single integer, typically 32 bits.
- SFmode
- A machine mode representing a single-precision floating-point number, typically 32 bits.
- type punning
- Treating a value of one data type as if it were of another data type. This is often done by reinterpreting the memory representation of the value.
- SIGSEGV
- A segmentation fault signal, indicating that a program attempted to access a memory location that it was not allowed to access.