<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 - -fapprox-funcs doesn't work correctly with #pragma float_control(precise, on)"
   href="https://bugs.llvm.org/show_bug.cgi?id=52566">52566</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-fapprox-funcs doesn't work correctly with #pragma float_control(precise, on)
          </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 -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" }

```</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>