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: pa reload problem


On Mon, Dec 04, 2000 at 02:15:49PM +1100, Alan Modra wrote:
> 	* flow.c (calculate_global_regs_live): Set the pic register live too.

This more invasive test has survived bootstrap on alpha and x86.
I'll try ia64 shortly, since that target also has a call-clobbered
pic register.  


r~


	* flow.c (calculate_global_regs_live): Only force stack pointer
	live before reload.  Force pic register live before reload.
	(insn_dead_p): Don't protect pic references from deletion.

Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.355
diff -c -p -d -r1.355 flow.c
*** flow.c	2000/11/30 21:40:32	1.355
--- flow.c	2000/12/05 00:32:16
*************** calculate_global_regs_live (blocks_in, b
*** 3368,3383 ****
  	  IOR_REG_SET (new_live_at_end, sb->global_live_at_start);
  	}
  
!       /* Force the stack pointer to be live -- which might not already be
! 	 the case for blocks within infinite loops.  */
!       SET_REGNO_REG_SET (new_live_at_end, STACK_POINTER_REGNUM);
! 
!       /* Similarly for the frame pointer before reload.  Any reference
! 	 to any pseudo before reload is a potential reference of the
! 	 frame pointer.  */
        if (! reload_completed)
! 	SET_REGNO_REG_SET (new_live_at_end, FRAME_POINTER_REGNUM);
  
        /* Regs used in phi nodes are not included in
  	 global_live_at_start, since they are live only along a
  	 particular edge.  Set those regs that are live because of a
--- 3368,3400 ----
  	  IOR_REG_SET (new_live_at_end, sb->global_live_at_start);
  	}
  
!       /* Before reload, there are a few registers that must be forced
! 	 live everywhere -- which might not already be the case for 
! 	 blocks within infinite loops.  */
        if (! reload_completed)
! 	{
! 	  /* The all-important stack pointer.  */
! 	  SET_REGNO_REG_SET (new_live_at_end, STACK_POINTER_REGNUM);
  
+ 	  /* Any reference to any pseudo before reload is a potential
+ 	     reference of the frame pointer.  */
+ 	  SET_REGNO_REG_SET (new_live_at_end, FRAME_POINTER_REGNUM);
+ 
+ #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+ 	  /* Pseudos with argument area equivalences may require
+ 	     reloading via the argument pointer.  */
+ 	  if (fixed_regs[ARG_POINTER_REGNUM])
+ 	    SET_REGNO_REG_SET (new_live_at_end, ARG_POINTER_REGNUM);
+ #endif
+ 
+ #ifdef PIC_OFFSET_TABLE_REGNUM
+ 	  /* Any constant, or pseudo with constant equivalences, may
+ 	     require reloading from memory using the pic register.  */
+ 	  if (fixed_regs[PIC_OFFSET_TABLE_REGNUM])
+ 	    SET_REGNO_REG_SET (new_live_at_end, PIC_OFFSET_TABLE_REGNUM);
+ #endif
+ 	}
+ 
        /* Regs used in phi nodes are not included in
  	 global_live_at_start, since they are live only along a
  	 particular edge.  Set those regs that are live because of a
*************** insn_dead_p (pbi, x, call_ok, notes)
*** 4234,4249 ****
  		 (if the arg pointer isn't fixed, there will be a USE
  		 for it, so we can treat it normally).  */
  	      if (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
- 		return 0;
- #endif
- 
- #ifdef PIC_OFFSET_TABLE_REGNUM
- 	      /* Before reload, do not allow sets of the pic register
- 		 to be deleted.  Reload can insert references to
- 		 constant pool memory anywhere in the function, making
- 		 the PIC register live where it wasn't before.  */
- 	      if (regno == PIC_OFFSET_TABLE_REGNUM && fixed_regs[regno]
- 		  && ! reload_completed)
  		return 0;
  #endif
  
--- 4251,4256 ----

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