This is the mail archive of the
mailing list for the GCC project.
Re: PATCH: Very simple constant propagation (revisited)
On Mar 3, 2004, at 12:21, Caroline Tice wrote:
Unfortunately, this problem does not exist "at the tree-ssa level".
The conversion of "a/b" into
"a * 1/b" does not happen until expansion, when the trees are expanded
into RTL. Therefore the
necessary constant propagation cannot happen until after that point.
For reference, the relevant code
is in expand_expr_real_1 (expr.c, line 8158):
/* Emit a/b as a*(1/b). Later we may manage CSE the reciprocal
expensive divide. If not, combine will rebuild the original
if (flag_unsafe_math_optimizations && optimize && !optimize_size
&& TREE_CODE (type) == REAL_TYPE
&& !real_onep (TREE_OPERAND (exp, 0)))
return expand_expr (build (MULT_EXPR, type, TREE_OPERAND (exp,
build (RDIV_EXPR, type,
build_real (type, dconst1),
TREE_OPERAND (exp, 1))),
target, tmode, modifier);
Since this problem cannot be solved at the tree-ssa level, do I have
permission to commit my
patch (with Paolo's suggested change)?
Basically I think RTH means that we can get rid of this extra junk in
and let the tree-ssa optimizers it away before getting to this point.