From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John David Anglin" To: gcc-patches@gcc.gnu.org Subject: PATCH: PIC_OFFSET_TABLE_REGNUM_SAVED should be call used when generating PIC code Date: Fri, 05 Jan 2001 09:48:00 -0000 Message-id: <200101051748.MAA04370@hiauly1.hia.nrc.ca> X-SW-Source: 2001-01/msg00373.html The enclosed patch makes the PIC_OFFSET_TABLE_REGNUM_SAVED a call used register on the PA port when PIC code is being generated. When PIC code is being generated, the PIC_OFFSET_TABLE_REGNUM register is copied to the PIC_OFFSET_TABLE_REGNUM_SAVED register in the function prologue if the PIC_OFFSET_TABLE_REGNUM is ever live. Sometimes propagate_one_insn would find that this instruction was dead and generate a "ICE: would have deleted prologue/epilogue insn" warning. Inspection indicated that the insn was dead because the PIC_OFFSET_TABLE_REGNUM register was being restored after a procedure call using the frame saved value of the PIC_OFFSET_TABLE_REGNUM_SAVED register rather than the PIC_OFFSET_TABLE_REGNUM_SAVED register itself. This patch is not fully tested because I have not been able to complete a successful PIC bootstrap for other unrelated reasons. However, I know it corrects the ICE warning and I believe the PIC_OFFSET_TABLE_REGNUM_SAVED register should be a call used register as per the documentation of call used registers because it is a fixed register when PIC code is being generated. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605) 2000-12-02 John David Anglin * pa32-regs.h (CONDITIONAL_REGISTER_USAGE): When generating pic code, PIC_OFFSET_TABLE_REGNUM_SAVED is a call_used register. * pa64-regs.h (CONDITIONAL_REGISTER_USAGE): Likewise. --- pa32-regs.h.orig Fri Jul 7 19:59:16 2000 +++ pa32-regs.h Fri Dec 1 16:10:07 2000 @@ -113,6 +113,7 @@ { \ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ fixed_regs[PIC_OFFSET_TABLE_REGNUM_SAVED] = 1;\ + call_used_regs[PIC_OFFSET_TABLE_REGNUM_SAVED] = 1;\ } \ } --- pa64-regs.h.orig Fri Jul 7 19:59:16 2000 +++ pa64-regs.h Fri Dec 1 16:11:09 2000 @@ -112,6 +112,7 @@ { \ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ fixed_regs[PIC_OFFSET_TABLE_REGNUM_SAVED] = 1;\ + call_used_regs[PIC_OFFSET_TABLE_REGNUM_SAVED] = 1;\ } \ }