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]

gcse fix




I've installed this change.  Things like the frame pointer are not clobberd
by a function call :-)


	* gcse.c (compute_hash_table): Correctly identify hard regs which are
	clobbered across calls.
	(compute_rd_kill): Likewise.

Index: gcse.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/./gcc/gcse.c,v
retrieving revision 1.18
diff -c -3 -p -r1.18 gcse.c
*** gcse.c	1998/10/17 12:11:06	1.18
--- gcse.c	1998/10/20 06:15:40
*************** compute_hash_table (f, set_p)
*** 2075,2081 ****
  	  if (GET_CODE (insn) == CALL_INSN)
  	    {
  	      for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
! 		if (call_used_regs[regno])
  		  record_last_reg_set_info (insn, regno);
  	      if (! CONST_CALL_P (insn))
  		record_last_mem_set_info (insn);
--- 2075,2094 ----
  	  if (GET_CODE (insn) == CALL_INSN)
  	    {
  	      for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
! 		if ((call_used_regs[regno]
! 		     && regno != STACK_POINTER_REGNUM
! #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
! 		     && regno != HARD_FRAME_POINTER_REGNUM
! #endif
! #if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
! 		     && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
! #endif
! #if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
! 		     && ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
! #endif
! 
! 		     && regno != FRAME_POINTER_REGNUM)
! 		    || global_regs[regno])
  		  record_last_reg_set_info (insn, regno);
  	      if (! CONST_CALL_P (insn))
  		record_last_mem_set_info (insn);
*************** compute_kill_rd ()
*** 2548,2554 ****
  
  		  for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
                      {
! 		      if (call_used_regs[regno])
  			handle_rd_kill_set (insn, regno, bb);
                      }
                  }
--- 2561,2580 ----
  
  		  for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
                      {
! 		      if ((call_used_regs[regno]
! 			   && regno != STACK_POINTER_REGNUM
! #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
! 			   && regno != HARD_FRAME_POINTER_REGNUM
! #endif
! #if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
! 			   && ! (regno == ARG_POINTER_REGNUM
! 				 && fixed_regs[regno])
! #endif
! #if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
! 			   && ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
! #endif
! 			   && regno != FRAME_POINTER_REGNUM)
! 			  || global_regs[regno])
  			handle_rd_kill_set (insn, regno, bb);
                      }
                  }


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