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


Hello,

Attached is the last version of the patch (before testing).
It includes both of the flags as there are places where both
are needed.

> Index: combine.c
> ===================================================================
> --- combine.c   (revision 117280)
> +++ combine.c   (working copy)
> @@ -4587,7 +4587,7 @@
>     }
>
>        /* Try simplify a*(b/c) as (a*b)/c.  */
> -      if (FLOAT_MODE_P (mode) && flag_unsafe_math_optimizations
> +      if (FLOAT_MODE_P (mode) && flag_reciprocal_math
>       && GET_CODE (XEXP (x, 0)) == DIV)
>     {
>       rtx tem = simplify_binary_operation (MULT, mode,
>
> the transformation is a re-association.  Or both a re-association
> and a reciprocal transformation but not only the latter.
>

I changed the codition to check for both reciprocal and re-association
flags
in those cases.


>      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.
>

I added more comments regarding this.

Comments are welcome,
Revital

(See attached file: reordering_patch_71106)

Attachment: reordering_patch_71106
Description: Binary data


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