> >Would you be OK with a slight variation of your earlier idea, i.e. > >calling fold_stmt with a specific valueizer from fold_marked_statements > >instead of the implicit no_follow_ssa_edges in the inliner? Something > >like: > > > >tree > >follow_anonymous_single_use_edges (tree val) > >{ > > > > if (TREE_CODE (val) == SSA_NAME > > > > && (!SSA_NAME_VAR (val) || DECL_IGNORED_P (SSA_NAME_VAR > > (var))) > > && has_single_use (val)) > > > > return val > > > > return NULL_TREE; > > > >} > > Yes, that works for me as well. But not for GCC. :-) The propagation per se works but, since the statement is not folded in the end, no replacement is made at all... So we're back to square one and anonymous constant propagation seems to be the only way out at -O0. The attached patch implements it in a less hackish way (and enables it unconditionally when optimizing as suggested by Jan) by doing it just before invoking fold_stmt on the marked statements so this should make folding more effective in the process. Tested (compiler only) on x86_64-suse-linux, OK for the mainline? 2015-05-11 Eric Botcazou * tree-inline.c: Include tree-ssa-propagate.h. (replace_constant_uses_in): New function. (fold_marked_statements): Call it before folding the statement. * gimple-expr.h (is_gimple_constant): Reorder. * tree-ssa-propagate.c (before_dom_children): Use inline accessor. -- Eric Botcazou