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]

patch to omit the frame pointer from leaf functions


This change allows gcc to omit the frame pointer when optimizing
leaf functions which don't call alloca.  Are the situations where
having a frame pointer in a leaf function is a win (assuming that
the machine description doesn't require it)?

Notes:

  1) The earlier patch which improves the accuracy of function_call_count
     should be installed prior to this.

ChangeLog:

Mon Sep 21 01:38:35 EDT 1998  John Wehle  (john@feith.com)

	* reload1.c (reload): Don't set frame_pointer_needed when
	optimizing leaf functions.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/reload1.c.ORIGINAL	Thu Sep 17 22:59:26 1998
--- gcc/reload1.c	Mon Sep 21 01:33:32 1998
*************** reload (first, global, dumpfile)
*** 750,756 ****
  
    /* Does this function require a frame pointer?  */
  
!   frame_pointer_needed = (! flag_omit_frame_pointer
  #ifdef EXIT_IGNORE_STACK
  			  /* ?? If EXIT_IGNORE_STACK is set, we will not save
  			     and restore sp for alloca.  So we can't eliminate
--- 750,758 ----
  
    /* Does this function require a frame pointer?  */
  
!   frame_pointer_needed = ((! flag_omit_frame_pointer
! 			     && (! optimize || function_call_count != 0
! 				 || current_function_calls_alloca))
  #ifdef EXIT_IGNORE_STACK
  			  /* ?? If EXIT_IGNORE_STACK is set, we will not save
  			     and restore sp for alloca.  So we can't eliminate
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



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