This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ppc pic elimination losage


On Tue, Apr 18, 2000 at 01:01:26AM +0200, Franz Sirl wrote:
> For powerpc-linux-gnu (! TEST_HARD_REG_BIT (elim_reg_set, regno)) evaluates
> to false.

This is, IMO, the bug.  I talked to Geoff about the ppc pic stuff
and he tentatively agreed before heading out the door on vacation.

This (not yet tested) patch should re-break things as they were
before, but this ought to be fixed correctly.



r~



Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.254
diff -c -p -d -r1.254 flow.c
*** flow.c	2000/04/15 15:20:58	1.254
--- flow.c	2000/04/18 18:55:33
*************** mark_used_reg (pbi, reg, cond, insn)
*** 4473,4484 ****
  	     be eliminated, reload will set it live at that point.
  
  	     Otherwise, record that this function uses this register.  */
  
! 	  if (! TEST_HARD_REG_BIT (elim_reg_set, regno))
  	    {
  	      int n = HARD_REGNO_NREGS (regno, GET_MODE (reg));
- 	      if (n == 0)
- 		n = 1;
  	      do
  		regs_ever_live[regno + --n] = 1;
  	      while (n > 0);
--- 4473,4487 ----
  	     be eliminated, reload will set it live at that point.
  
  	     Otherwise, record that this function uses this register.  */
+ 	  /* ??? The PPC backend tries to "eliminate" on the pic
+ 	     register to itself.  This should be fixed.  In the mean
+ 	     time, hack around it.  */
  
! 	  if (! (TEST_HARD_REG_BIT (elim_reg_set, regno))
! 	         && (regno == FRAME_POINTER_REGNUM
! 		     || regno == ARG_POINTER_REGNUM))
  	    {
  	      int n = HARD_REGNO_NREGS (regno, GET_MODE (reg));
  	      do
  		regs_ever_live[regno + --n] = 1;
  	      while (n > 0);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]