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: unassignedclangb...@nondot.org
Reporter: chris.chrul...@yahoo.com
CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs