h8300 prologues/epilogues

Jeffrey A Law law@cygnus.com
Thu Sep 30 00:01:00 GMT 1999


This patch improves the code we generate for certain prologues and
epilogues on the H8 series processors.

        * h8300.c (WORD_REG_USED): Update to avoid useless register
        saves in interrupt functions and functions which never return.

Index: h8300.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/h8300/h8300.c,v
retrieving revision 1.19
diff -c -3 -p -r1.19 h8300.c
*** h8300.c	1999/09/12 01:51:27	1.19
--- h8300.c	1999/09/30 07:00:16
*************** byte_reg (x, b)
*** 124,134 ****
  /* REGNO must be saved/restored across calls if this macro is true.  */
  
  #define WORD_REG_USED(regno)					\
!   (regno < 7 &&							\
!    (interrupt_handler						\
!     || pragma_saveall						\
!     || (regno == FRAME_POINTER_REGNUM && regs_ever_live[regno])	\
!     || (regs_ever_live[regno] && !call_used_regs[regno])))
  
  /* Output assembly language to FILE for the operation OP with operand size
     SIZE to adjust the stack pointer.  */
--- 124,144 ----
  /* REGNO must be saved/restored across calls if this macro is true.  */
  
  #define WORD_REG_USED(regno)					\
!   (regno < 7							\
!    /* No need to save registers if this function will not return.*/\
!    && ! TREE_THIS_VOLATILE (current_function_decl)		\
!    && (pragma_saveall						\
!        /* Save any call saved register that was used.  */	\
!        || (regs_ever_live[regno] && !call_used_regs[regno])	\
!        /* Save the frame pointer if it was used.  */		\
!        || (regno == FRAME_POINTER_REGNUM && regs_ever_live[regno])\
!        /* Save any register used in an interrupt handler.  */	\
!        || (interrupt_handler && regs_ever_live[regno])		\
!        /* Save call clobbered registers in non-leaf interrupt	\
! 	  handlers.  */						\
!        || (interrupt_handler					\
! 	   && call_used_regs[regno]				\
! 	   && !current_function_is_leaf)))
  
  /* Output assembly language to FILE for the operation OP with operand size
     SIZE to adjust the stack pointer.  */






More information about the Gcc-patches mailing list