On Thu, May 26, 2011 at 4:00 PM, Jakub Jelinek <ja...@redhat.com> wrote: > 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.
Btw, I suggested to use { <error_mark> } for the "undefinedness". Repeated code asks for something like gimple_clobber_p () and gimple_clobber_rhs_p (). Richard.