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]
Other format: [Raw text]

[PATCH] S/390: remove save_backchain_p


Hi,

the save_backchain_p flag located in the cfun->machine->frame_layout struct
is used to determine whether to store a backchain pointer. It is set in
s390_frame_info. 

Recent changes made s390_frame_info to be called only by
s390_init_frame_layout which in turn is only called by 
s390_initial_elimination_offset. So that flag is only set if virtual registers
has to be eliminated. Hence many functions don't set the backchain pointer
when -mbackchain is specified.

Because the save_backchain_p flag is always set to TARGET_BACKCHAIN it is relatively
pointless. So I removed it and replaced every usage with TARGET_BACKCHAIN.

This fixes all -mbackchain vs. -mno-backchain regressions.

Bootstrapped without regression on s390 and s390x.

OK?

Bye,

-Andreas-


2005-01-07  Andreas Krebbel  <krebbel1@de.ibm.com>

	* config/s390/s390.c (struct s390_frame_layout): Remove 
	save_backchain_p.
	(s390_frame_info, s390_emit_prologue): Replace occurrences of
	save_backchain_p with TARGET_BACKCHAIN.


Index: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.210
diff -p -c -r1.210 s390.c
*** gcc/config/s390/s390.c	17 Dec 2004 13:18:00 -0000	1.210
--- gcc/config/s390/s390.c	3 Jan 2005 13:28:14 -0000
*************** struct s390_frame_layout GTY (())
*** 317,325 ****
    /* Set if return address needs to be saved.  */
    bool save_return_addr_p;
  
-   /* Set if backchain needs to be saved.  */
-   bool save_backchain_p;
- 
    /* Size of stack frame.  */
    HOST_WIDE_INT frame_size;
  };
--- 317,322 ----
*************** s390_frame_info (void)
*** 6454,6461 ****
    if (!TARGET_64BIT && cfun_frame_layout.frame_size > 0x7fff0000)
      fatal_error ("Total size of local variables exceeds architecture limit.");
    
-   cfun_frame_layout.save_backchain_p = TARGET_BACKCHAIN;
- 
    if (!TARGET_PACKED_STACK)
      {
        cfun_frame_layout.backchain_offset = 0;
--- 6451,6456 ----
*************** s390_frame_info (void)
*** 6525,6532 ****
  				     + cfun_frame_layout.high_fprs * 8);
    else
      {
!       cfun_frame_layout.frame_size += (cfun_frame_layout.save_backchain_p
! 				       * UNITS_PER_WORD);
  
        /* No alignment trouble here because f8-f15 are only saved under 
  	 64 bit.  */
--- 6520,6527 ----
  				     + cfun_frame_layout.high_fprs * 8);
    else
      {
!       if (TARGET_BACKCHAIN)
! 	cfun_frame_layout.frame_size += UNITS_PER_WORD;
  
        /* No alignment trouble here because f8-f15 are only saved under 
  	 64 bit.  */
*************** s390_emit_prologue (void)
*** 6997,7003 ****
  	warning ("%qs uses dynamic stack allocation", current_function_name ());
  
        /* Save incoming stack pointer into temp reg.  */
!       if (cfun_frame_layout.save_backchain_p || next_fpr)
  	insn = emit_insn (gen_move_insn (temp_reg, stack_pointer_rtx));
  
        /* Subtract frame size from stack pointer.  */
--- 6992,6998 ----
  	warning ("%qs uses dynamic stack allocation", current_function_name ());
  
        /* Save incoming stack pointer into temp reg.  */
!       if (TARGET_BACKCHAIN || next_fpr)
  	insn = emit_insn (gen_move_insn (temp_reg, stack_pointer_rtx));
  
        /* Subtract frame size from stack pointer.  */
*************** s390_emit_prologue (void)
*** 7028,7034 ****
  
        /* Set backchain.  */
  
!       if (cfun_frame_layout.save_backchain_p)
  	{
  	  if (cfun_frame_layout.backchain_offset)
  	    addr = gen_rtx_MEM (Pmode, 
--- 7023,7029 ----
  
        /* Set backchain.  */
  
!       if (TARGET_BACKCHAIN)
  	{
  	  if (cfun_frame_layout.backchain_offset)
  	    addr = gen_rtx_MEM (Pmode, 
*************** s390_emit_prologue (void)
*** 7044,7050 ****
  	 we need to make sure the backchain pointer is set up
  	 before any possibly trapping memory access.  */
  
!       if (cfun_frame_layout.save_backchain_p && flag_non_call_exceptions)
  	{
  	  addr = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode));
  	  emit_insn (gen_rtx_CLOBBER (VOIDmode, addr));
--- 7039,7045 ----
  	 we need to make sure the backchain pointer is set up
  	 before any possibly trapping memory access.  */
  
!       if (TARGET_BACKCHAIN && flag_non_call_exceptions)
  	{
  	  addr = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode));
  	  emit_insn (gen_rtx_CLOBBER (VOIDmode, addr));


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