[llvm-bugs] [Bug 35672] New: "[CodeGen] convert math libcalls/builtins to equivalent LLVM intrinsics" change overriding "__asm__ specifier

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 15 07:53:49 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35672

            Bug ID: 35672
           Summary: "[CodeGen] convert math libcalls/builtins to
                    equivalent LLVM intrinsics" change overriding "__asm__
                    specifier
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chris.chrulski at yahoo.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19558
  --> https://bugs.llvm.org/attachment.cgi?id=19558&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171215/fda90bad/attachment-0001.html>


More information about the llvm-bugs mailing list