This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING][PATCH] Fix PR 28684
- From: Revital1 Eres <ERES at il dot ibm dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: Roger Sayle <roger at eyesopen dot com>, Dorit Nuzman <DORIT at il dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 6 Nov 2006 11:09:50 +0200
- Subject: Re: [PING][PATCH] Fix PR 28684
> In some of the cases you do
>
> @@ -1107,7 +1107,7 @@
>
> case MINUS_EXPR:
> /* - (A - B) -> B - A */
> - if ((! FLOAT_TYPE_P (type) || flag_unsafe_math_optimizations)
> + if ((! FLOAT_TYPE_P (type) || flag_associative_math)
> && reorder_operands_p (TREE_OPERAND (t, 0), TREE_OPERAND (t,
> 1)))
> return fold_build2 (MINUS_EXPR, type,
> TREE_OPERAND (t, 1), TREE_OPERAND (t, 0));
>
> or
>
> @@ -971,7 +971,7 @@
>
> case MINUS_EXPR:
> /* We can't turn -(A-B) into B-A when we honor signed zeros. */
> - return (! FLOAT_TYPE_P (type) || flag_unsafe_math_optimizations)
> + return (! FLOAT_TYPE_P (type) || flag_associative_math)
> && reorder_operands_p (TREE_OPERAND (t, 0),
> TREE_OPERAND (t, 1));
>
> where the comment already suggests this should read ||
!HONOR_SIGNED_ZEROS
> (TYPE_MODE (type)). There are machines without signed zeros out there
> which will benefit from this even without flag_associative_math.
>
> Richard.
>
But the transformation is re-association; Can we apply it without the flag
(just by checking
that we are not honoring signed zeros)?
Thanks,
Revital