<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - -fno-approx-funcs doesn't override -Ofast or -ffast-math"
href="https://bugs.llvm.org/show_bug.cgi?id=52565">52565</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-fno-approx-funcs doesn't override -Ofast or -ffast-math
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>andrew.kaylor@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>If I compile the following code with 'clang -O2 -ffast-math -fno-approx-funcs'
the IR generated sets the 'fast' flag (implying 'afn' on the call and issues no
diagnostic indicating that the -fno-approx-funcs option was ignored.
```
#include <math.h>
float f(float x) {
return logf(x);
}
```
```
define dso_local float @f(float %0) local_unnamed_addr #0 {
%2 = tail call fast float @llvm.log.f32(float %0)
ret float %2
}
attributes #0 = { mustprogress nofree nosync nounwind readnone uwtable
willreturn "approx-func-fp-math"="true"
"denormal-fp-math"="preserve-sign,preserve-sign"
"denormal-fp-math-f32"="ieee,ieee" "frame-pointer"="none"
"min-legal-vector-width"="0" "no-infs-fp-math"="true" "no-nans-fp-math"="true"
"no-signed-zeros-fp-math"="true" "no-trapping-math"="true"
"stack-protector-buffer-size"="8" "target-cpu"="x86-64"
"target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic"
"unsafe-fp-math"="true" }
```
D106191 needed many more changes to clang/lib/Driver/ToolChains/Clang.cpp to
get this option to interact correctly with the other floating point options.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>