Repost: alloca() optimization when SETJMP_VIA_SAVE_AREA

Jeffrey A Law law@cygnus.com
Sat Jan 17 23:02:00 GMT 1998


  In message <199710021834.OAA04034@jenolan.rutgers.edu>you write:
  > 
  > The REG_NOTE's were already added by Jeffrey Law, if there are any
  > problems with the way the following is performed then please tell me
  > so I can work on making it more suitable.
  > 
  > Thu Oct  2 14:28:30 1997  David S. Miller  <davem@tanya.rutgers.edu>
  > 
  > 	* explow.c (optimize_save_area_alloca): New function for targets
  > 	where SETJMP_VIA_SAVE_AREA is true.
  > 	(allocate_dynamic_stack_space): On SETJMP_VIA_SAVE_AREA targets,
  > 	compute the amount of stack space needed should we find later that
  > 	setjmp is never called by this function, stuff rtl for this inside
  > 	a REG_NOTE of the final SET of stack_pointer_rtx.
  > 	* toplev.c (rest_of_compilation): If SETJMP_VIA_SAVE_AREA and
  > 	current_function_calls_alloca, call optimize_save_area_alloca.
I installed this after minor comment & spacing changes:

  * When calling a function, always put a space between the name an the
  open paren for the argument list.

  * When referring to a function in a comment, don't put parens after the
  name.

  * The code won't work for a machine where stacks grow to higher addresses
  which also define SETJMP_VIA_SAVE_AREA.  No such machines currently
  exist, but I thought it was worth noting explicitly.

Thanks!
jeff



More information about the Gcc mailing list