[PING][PATCH] Fix PR 28684

Revital1 Eres ERES@il.ibm.com
Mon Nov 6 09:07:00 GMT 2006


> 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



More information about the Gcc-patches mailing list