http://llvm.org/bugs/show_bug.cgi?id=2553
Summary: Invalid float optimization with NaN
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: NetBSD
Status: NEW
Severity: normal
Priority: P2
Component: new bugs
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: [email protected]
llvm-gcc-4.2 (svn revision 53688) miscompiles some functions in libgcc (for
example __mulxc3) because llvm simplifies the code for its isfinite() a bit too
much.
You can see this for:
#define isnan(x) ((x) != (x))
#define isfinite(x) (!isnan((x) - (x)))
void foo(float x)
{
if (isfinite(x))
bar();
}
Running
gcc -O0 -S -emit-llvm bug.c
gives me the attached bug.ll, and executing
llvm-as < bug.ll | opt -std-compile-opts | llvm-dis
gives
define void @foo(float %x) nounwind {
entry:
tail call i32 (...)* @bar( ) nounwind ; <i32>:0 [#uses=0]
ret void
}
declare i32 @bar(...)
i.e. it has optimized away the test for isfinite().
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs