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


>
> 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.
>
> Likewise here:
>
>        /* Convert C1/(X*C2) into (C1/C2)/X.  */
> -      if (flag_unsafe_math_optimizations
> +      if (flag_reciprocal_math
>       && TREE_CODE (arg1) == MULT_EXPR
>       && TREE_CODE (arg0) == REAL_CST
>       && TREE_CODE (TREE_OPERAND (arg1, 1)) == REAL_CST)
>
> and in most other cases.  Or do we want flag_reciprocal_math
> to imply flag_associative_math?
>

Maybe apply those transformations when both flag_reciprocal_math and
flag_associative_math
are set?


Thanks for the comments,
Revital


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