AW: Yet another PREFERRED_STACK_BOUNDARY fix and sanity check

Thomas.Schuster@atd.mchh.siemens.de Thomas.Schuster@atd.mchh.siemens.de
Fri Apr 7 05:54:00 GMT 2000


Hi Jan,

> OK, thanks, here is updated patch.
> 
> Fri Apr  7 13:57:16 MET DST 2000  Jan Hubicka  <jh@suse.cz>
> 	* calls.c (expand_call): Do NO_DEFER_POP unconditionally once
> 	stack is propertly aligned; add sanity checking for aligned
> 	stack pointer.
> 	(expand_library_call_value_1): Add sanity checking for aligned
> 	stack pointer.
> Index: egcs/gcc/calls.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/calls.c,v
> retrieving revision 1.115
> diff -c -3 -p -r1.115 calls.c
> *** calls.c	2000/04/05 01:52:54	1.115
> --- calls.c	2000/04/07 12:42:32
> *************** expand_call (exp, target, ignore)
> *** 2669,2678 ****
>   	  else if (argblock == 0)
>   	    anti_adjust_stack (GEN_INT (args_size.constant
>   					- unadjusted_args_size));
> - 	  /* Now that the stack is properly aligned, pops can't safely
> - 	     be deferred during the evaluation of the arguments.  */
> - 	  NO_DEFER_POP;
>   	}
>   #endif
>   
>         /* Don't try to defer pops if preallocating, not even 
> from the first arg,
> --- 2669,2678 ----
>   	  else if (argblock == 0)
>   	    anti_adjust_stack (GEN_INT (args_size.constant
>   					- unadjusted_args_size));
>   	}
> +       /* Now that the stack is properly aligned, pops can't safely
> + 	 be deferred during the evaluation of the arguments.  */
> +       NO_DEFER_POP;
>   #endif
>   
>         /* Don't try to defer pops if preallocating, not even 
> from the first arg,
> *************** expand_call (exp, target, ignore)
> *** 2798,2803 ****
> --- 2798,2809 ----
>         /* All arguments and registers used for the call must 
> be set up by
>   	 now!  */
>   
> + #ifdef PREFERRE_STACK_BOUNDARY

This must be PREFERRED_STACK_BOUNDARY

Keep up the good work.
Thomas

> +       /* Stack must to be properly aligned now.  */
> +       if (stack_pointer_delta & (preferred_stack_boundary / 
> BITS_PER_UNIT - 1))
> + 	abort();
> + #endif
> + 
>         /* Generate the actual call instruction.  */
>         emit_call_1 (funexp, fndecl, funtype, unadjusted_args_size,
>   		   args_size.constant, struct_value_size,
> *************** emit_library_call_value_1 (retval, orgfu
> *** 3681,3686 ****
> --- 3687,3698 ----
>     /* Don't allow popping to be deferred, since then
>        cse'ing of library calls could delete a call and leave 
> the pop.  */
>     NO_DEFER_POP;
> + 
> + #ifdef PREFERRED_STACK_BOUNDARY
> +   /* Stack must to be properly aligned now.  */
> +   if (stack_pointer_delta & (PREFERRED_STACK_BOUNDARY / 
> BITS_PER_UNIT - 1))
> +     abort();
> + #endif
>   
>     /* We pass the old value of inhibit_defer_pop + 1 to 
> emit_call_1, which
>        will set inhibit_defer_pop to that value.  */
> 


More information about the Gcc-patches mailing list