This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]