This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][PING] Fix PR25620, pow() expansion missed-optimization, 3rd try
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 26 Nov 2006 14:32:56 -0700 (MST)
- Subject: Re: [PATCH][PING] Fix PR25620, pow() expansion missed-optimization, 3rd try
On Sun, 26 Nov 2006, Richard Guenther wrote:
> 2006-11-13 Richard Guenther <email@example.com>
> 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.
> * gcc.target/i386/pow-1.c: 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.