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?
The test-code, compiled with gcc (4.3.1) test.c
-funsafe-math-optimizations -O3 -S
#include <math.h>
float test (float arg)
{
return powf (arg, 1.5f);
}
If the optimization is triggered the disassembly shouldn't have a call
to _powf anymore.
Should I file a bug-report?
Cheers,
Nils