This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Should gcc-4.0 apply mathematical associative rules for additionor multiplication
- From: Roger Sayle <roger at eyesopen dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: gcc at gcc dot gnu dot org, Fariborz Jahanian <fjahanian at apple dot com>
- Date: Mon, 4 Oct 2004 17:48:57 -0600 (MDT)
- Subject: Re: Should gcc-4.0 apply mathematical associative rules for additionor multiplication
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
--