Patch to fix leaf function epilogue sibling call check

John Wehle john@feith.com
Thu Jan 11 14:14:00 GMT 2001


Leaf_function_p currently is checking SIBLING_CALL_P (insn)
when it should be checking SIBLING_CALL_P (XEXP (insn, 0))
since insn is an epilogue delay insn list link and not an
actual epilogue delay insn.  This patch passes make bootstrap
and check on sparc-sun-solaris2.7.

ChangeLog:

Thu Jan 11 17:06:30 EST 2001  John Wehle  (john@feith.com)

	* final.c: (leaf_function_p): Fix typo.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/final.c.ORIGINAL	Wed Jan  3 18:15:31 2001
--- gcc/final.c	Thu Jan  4 20:27:56 2001
***************
*** 1,6 ****
  /* Convert RTL to assembler code and output it, for GNU compiler.
     Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
!    1998, 1999, 2000 Free Software Foundation, Inc.
  
  This file is part of GNU CC.
  
--- 1,6 ----
  /* Convert RTL to assembler code and output it, for GNU compiler.
     Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
!    1998, 1999, 2000, 2001 Free Software Foundation, Inc.
  
  This file is part of GNU CC.
  
*************** int
*** 4125,4130 ****
--- 4125,4131 ----
  leaf_function_p ()
  {
    rtx insn;
+   rtx link;
  
    if (profile_flag || profile_block_flag || profile_arc_flag)
      return 0;
*************** leaf_function_p ()
*** 4140,4156 ****
  	  && ! SIBLING_CALL_P (XVECEXP (PATTERN (insn), 0, 0)))
  	return 0;
      }
!   for (insn = current_function_epilogue_delay_list;
!        insn;
!        insn = XEXP (insn, 1))
      {
!       if (GET_CODE (XEXP (insn, 0)) == CALL_INSN
  	  && ! SIBLING_CALL_P (insn))
  	return 0;
!       if (GET_CODE (XEXP (insn, 0)) == INSN
! 	  && GET_CODE (PATTERN (XEXP (insn, 0))) == SEQUENCE
! 	  && GET_CODE (XVECEXP (PATTERN (XEXP (insn, 0)), 0, 0)) == CALL_INSN
! 	  && ! SIBLING_CALL_P (XVECEXP (PATTERN (XEXP (insn, 0)), 0, 0)))
  	return 0;
      }
  
--- 4141,4159 ----
  	  && ! SIBLING_CALL_P (XVECEXP (PATTERN (insn), 0, 0)))
  	return 0;
      }
!   for (link = current_function_epilogue_delay_list;
!        link;
!        link = XEXP (link, 1))
      {
!       insn = XEXP (link, 0);
! 
!       if (GET_CODE (insn) == CALL_INSN
  	  && ! SIBLING_CALL_P (insn))
  	return 0;
!       if (GET_CODE (insn) == INSN
! 	  && GET_CODE (PATTERN (insn)) == SEQUENCE
! 	  && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == CALL_INSN
! 	  && ! SIBLING_CALL_P (XVECEXP (PATTERN (insn), 0, 0)))
  	return 0;
      }
  
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



More information about the Gcc-patches mailing list