------- Comment #37 from rguenther at suse dot de  2010-03-16 15:11 -------
Subject: Re:  [4.4/4.5 Regression] Weird interaction
 between optimize_insn_for_speed_p and -funsafe-math-optimizations

On Tue, 16 Mar 2010, dominiq at lps dot ens dot fr wrote:

> 
> 
> ------- Comment #36 from dominiq at lps dot ens dot fr  2010-03-16 15:06 
> -------
> > Note that the replacement for x**(n/3) * cbrt(x)**(n%3) does not seems 
> > guarded
> > by any optimisation flag.
> 
> The condition is implemented further down in the code and I missed it:
> 
>       if (real_identical (&c2, &c)
>           && ((optimize_insn_for_speed_p ()
>                && powi_cost (n/3) <= POWI_MAX_MULTS)
>               || n == 1))
> 
> Why the condition optimize_insn_for_speed_p () is not part of 
> 
>   if (fn != NULL_TREE
>       && flag_unsafe_math_optimizations
>       && (tree_expr_nonnegative_p (arg0)
>           || !HONOR_NANS (mode)))
> 
> ?

Because we unconditionally want to turn pow (x, 1/3) to
cbrt (x) as it is smaller.

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40106

Reply via email to