This is the mail archive of the 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: [PATCH][PING] Fix PR25620, pow() expansion missed-optimization, 3rd try

On Sun, 26 Nov 2006, Richard Guenther wrote:
> 2006-11-13  Richard Guenther  <>
> 	PR middle-end/25620
> 	* builtins.c (expand_builtin_pow): Optimize non integer valued
> 	constant exponents using sqrt or cbrt if possible.  Always fall back
> 	to expanding via optabs.
> 	* New testcase.
> 	* gcc.dg/builtins-58.c: Likewise.

This is OK for mainline.

> I also removed the restriction on unsafe_math for the fallback from
> expand_builtin_pow - Roger dded that back in 2004 but unfortunately the
> mailinglist archives for that year are corrupt, so I cannot figure out
> why, but I cannot think of any reason.

I've been doing some archeology and I suspect that the reason was
probably related to errno handling for pow, though the testing for
flag_unsafe_math_optimizations has jumped around in the code
significantly over time.  I think there's no problem to now always
fall back to expand_builtin_mathfn_2 which presumably should
contain it's own checks for -ferrno-math and the backend's powdf3
expanders should contain their own flag_unsafe_math_optimization
checks, if necessary.

Sorry for the delay.  Thanks for making the necessary revisions.


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