> Yeah, I think that's a way better place for the hack.
OK, how aggressive then? We could as well do the substitution for all copies:
/* For EXPAND_INITIALIZER try harder to get something simpler.
Otherwise, substitute copies on the RHS, this can propagate
constants at -O0 and thus simplify arithmetic operations. */
if (g == NULL
&& !SSA_NAME_IS_DEFAULT_DEF (exp)
&& (optimize || DECL_IGNORED_P (SSA_NAME_VAR (exp)))
&& (modifier == EXPAND_INITIALIZER
|| (modifier != EXPAND_WRITE
&& gimple_assign_copy_p (SSA_NAME_DEF_STMT (exp))))
&& stmt_is_replaceable_p (SSA_NAME_DEF_STMT (exp)))
g = SSA_NAME_DEF_STMT (exp);
--
Eric Botcazou