You want -ffinite-math-only -ffast-mathand maybe #include <tgmath.h> This is the same as -Ofastwithout specifying optimization -O3.
This not only helps these optimizations when turned on -ffinite-math-only and -ffast-math, but the general mathematical model of the type also allows you to compensate when you forget to add the appropriate suffix to the (non-double) mathematical function.
For example:
#include <tgmath.h>
float pow4(float f){return pow(f,4.0f);}
pow4:
vmulss xmm0, xmm0, xmm0
vmulss xmm0, xmm0, xmm0
ret
clang 32, gcc , , 2 147 483 647 (, ), -Os ( a jmp pow ) - -, 2.
-ffast-math - , . , -fno-math-errno -funsafe-math-optimizations -ffinite-math-only