http://llvm.org/bugs/show_bug.cgi?id=10117
Summary: Strange multiplication result possibly related to
trapping
Product: libraries
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Common Code Generator Code
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Created an attachment (id=6719)
--> (http://llvm.org/bugs/attachment.cgi?id=6719)
Shows the failing program.
The attached program when run claims that 29 * 29 == 1711. This isn't exactly
correct.
$ clang++ -o bar -O1 -fPIC foo.cpp
$ ./bar
...
diffX: 29 diffY: 0
diffX squared: 1711
diffY squared: 0
diffX * diffX + diffY * diffY :: 1711
a 41.3642
41.3642
If you use -ftrapv, the value is okay. But there doesn't seem to be any
undefined behavior here.
--
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