Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LoongArch: Fix infinite secondary reloading of FCCmode [PR113148]
The GCC internal doc says: X might be a pseudo-register or a 'subreg' of a pseudo-register, which could either be in a hard register or in memory. Use 'true_regnum' to find out; it will return -1 if the pseudo is in memory and the hard register number if it is in a register. So "MEM_P (x)" is not enough for checking if we are reloading from/to the memory. This bug has caused reload pass to stall and finally ICE complaining with "maximum number of generated reload insns per insn achieved", since r14-6814. Check if "true_regnum (x)" is -1 besides "MEM_P (x)" to fix the issue. gcc/ChangeLog: PR target/113148 * config/loongarch/loongarch.cc (loongarch_secondary_reload): Check if regno == -1 besides MEM_P (x) for reloading FCCmode from/to FPR to/from memory. gcc/testsuite/ChangeLog: PR target/113148 * gcc.target/loongarch/pr113148.c: New test.
- Loading branch information