On Fri, Feb 27, 2009 at 12:51 PM, Nils Pipenbrinck <n.pipenbri...@cubic.org> wrote: > Hi folks. > > While optimizing some of my code I replaced powf (x, 1.5f) with x * sqrt(x). > Out of couriosity I checked if GCC does this optimization and found it in > the code. It's in expand_builtin_pow in the file builtin.c (gcc 4.3.1 > source). > > However, GCC does not apply this optimization for a reason or another. If I > change the constant to 3.0f I get optimized code from another special case > expansion branch in that function (whole integers). Any ideas what's wrong > here?
It works for me in 4.3.3 on i386-darwin and in 4.3.2 on powerpc64-linux-gnu so I don't know why you are not getting this optimization. Thanks, Andrew Pinski