Open Quuxplusone opened 2 years ago
If I compile the following code with 'clang -O2 -fapprox-funcs' the "approx-func-fp-math" attribute will be incorrectly set to 'true' and the 'afn' flag will be set on the call to logf. The float_control pragma should disable this.
#include <math.h> #pragma float_control(precise, on) float f(float x) { return logf(x); }
define dso_local float @f(float %0) local_unnamed_addr #0 { %2 = tail call afn float @logf(float %0) #2 ret float %2 } attributes #0 = { mustprogress nofree nounwind uwtable willreturn "approx-func-fp-math"="true" "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
If I compile the following code with 'clang -O2 -fapprox-funcs' the "approx-func-fp-math" attribute will be incorrectly set to 'true' and the 'afn' flag will be set on the call to logf. The float_control pragma should disable this.