On Wed, May 4, 2011 at 1:56 PM, Michael Matz <m...@suse.de> wrote: > Hi, > > On Wed, 4 May 2011, Richard Guenther wrote: > >> > It prevents save_expr from being called at global level, since you >> > cannot create SAVE_EXPRs outside functions. Likewise in >> > variable_size. >> >> I see several places in fold-const.c that are not properly guarded then. >> But anyway, if it is supposed to protect SAVE_EXPRs then I'd have >> expected save_expr to contain that check and possibly return NULL if it >> can't save. >> >> And I'm not sure you can't do SAVE_EXPRs outside of functions - you >> could simply emit global temporaries. > > It's not the temporary, but the evaluation that poses problems in global > context. (you could add a global ctor to it, ugh)
Well, a save-expr would only be created if evaluation is necessary anyway, so I don't see the issue really. Richard.