Should gcc-4.0 apply mathematical associative rules for addition or multiplication
Roger Sayle
roger@eyesopen.com
Tue Oct 5 02:22:00 GMT 2004
On Mon, 4 Oct 2004, Andrew Pinski wrote:
> Obviously I mean:
> Index: tree-ssa-dom.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
> retrieving revision 2.58
> diff -u -p -r2.58 tree-ssa-dom.c
> --- tree-ssa-dom.c 4 Oct 2004 13:19:20 -0000 2.58
> +++ tree-ssa-dom.c 4 Oct 2004 23:19:07 -0000
> @@ -1598,7 +1598,9 @@ simplify_rhs_and_lookup_avail_expr (stru
> assignment. Add minus to this, as we handle it specially below.
> */
> if ((associative_tree_code (rhs_code) || rhs_code == MINUS_EXPR)
> && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
> - && is_gimple_min_invariant (TREE_OPERAND (rhs, 1)))
> + && is_gimple_min_invariant (TREE_OPERAND (rhs, 1))
> + && (!FLOAT_TYPE_P (TREE_TYPE (rhs))
> + || flag_unsafe_math_optimizations))
> {
> tree rhs_def_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
>
Ok for mainline, after bootstrap and regression testing, with a ChangeLog
entry and a suitable test case for the testsuite.
Roger
--
More information about the Gcc
mailing list