<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 - "[CodeGen] convert math libcalls/builtins to equivalent LLVM intrinsics" change overriding "__asm__ specifier"
   href="https://bugs.llvm.org/show_bug.cgi?id=35672">35672</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"[CodeGen] convert math libcalls/builtins to equivalent LLVM intrinsics" change overriding "__asm__ specifier
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>chris.chrulski@yahoo.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19558" name="attach_19558" title="email conversion with change author">attachment 19558</a> <a href="attachment.cgi?id=19558&action=edit" title="email conversion with change author">[details]</a></span>
email conversion with change author

There was a behavior change in how the math headers are processed following the
checkin of "[CodeGen] convert math libcalls/builtins to equivalent LLVM
intrinsics" on Dec 1, 2017 which looks like it may not have been intended. It
appears the conversion to intrinsics is taking precedence over the processing
of __asm__ specifiers.


#include <stdio.h>
#include<math.h>                                                                
// With -ffast-math, header defines the following line:
//extern double exp (double) __asm__ ("" "__exp_finite") __attribute__
((__nothrow__ ));

int main()
{
    double i = 0.0;
    double r;
    for (i = 0.0; i < 1.0; i += 0.1) {
        r = exp(i);
        printf("%g: exp = %g\n", i, r);
    }
    return 0;
}


With this code, when building with -ffast-math on Linux, the following used to
create this for the 'exp' call:
%9 = call fast double @__exp_finite(double %8) #3

After the commit, it is generating:
%2 = call fast double @llvm.exp.f64(double %1)



More detailed discussion is in the attachment.</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>