RFC: explicitely mark out-of-scope deaths

Jakub Jelinek jakub@redhat.com
Thu May 26 15:07:00 GMT 2011


On Thu, May 26, 2011 at 03:43:45PM +0200, Michael Matz wrote:
> --- tree-stdarg.c.orig	2011-05-26 14:15:01.000000000 +0200
> +++ tree-stdarg.c	2011-05-26 14:15:41.000000000 +0200
> @@ -872,8 +872,12 @@ execute_optimize_stdarg (void)
>  		  if (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
>  		      == GIMPLE_SINGLE_RHS)
>  		    {
> +		      /* Check for ap ={v} {}.  */
> +		      if (TREE_CODE (rhs) == CONSTRUCTOR
> +			       && TREE_THIS_VOLATILE (rhs))
> +			continue;
>  		      /* Check for ap[0].field = temp.  */
> -		      if (va_list_counter_struct_op (&si, lhs, rhs, true))
> +		      else if (va_list_counter_struct_op (&si, lhs, rhs, true))
>  			continue;

Perhaps optimize_stdarg_builtin could fold __builtin_va_end into
this ap ={v} {} for non-pointer va_list to make it clear the variable
is undefined afterwards, currently it just optimizes it away completely.

	Jakub



More information about the Gcc-patches mailing list