http://llvm.org/bugs/show_bug.cgi?id=11375
Bug #: 11375
Summary: Different results for 'clang++ huh.cpp' and 'clang++
-O3 huh.cpp' - Codegen??
Product: clang
Version: trunk
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: enhancement
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Created attachment 7609
--> http://llvm.org/bugs/attachment.cgi?id=7609
Sample program demonstrating the bug
When compiling the attached code (huh.cpp), I get different results when
specifying -O3 vs. -O0
$ clang++ -O0 huh.cpp && ./a.out
## Test fail on line 111 1 == 0
Returning: 5, 14
Returning: 5, 14
Returning: 5, 14
Returning: 7, 7
Returning: 7, 11
Returning: 5, 15
Returning: 5, 15
Returning: 5, 15
Returning: 9, 9
Returning: 9, 12
$ clang++ -O3 huh.cpp && ./a.out
## Test fail on line 111 1 == 0
Returning: 5, 12
Returning: 7, 14
Returning: 5, 14
Returning: 7, 7
Returning: 7, 11
Returning: 5, 15
Returning: 5, 15
Returning: 5, 15
Returning: 9, 9
Returning: 9, 12
The first two lines are different!!
gcc gets the same results as -O0 (which I believe is correct).
Platform is x86, Darwin (Mac OS X 10.7.2)
Occurs on:
$ clang++ --version
clang version 3.1 (trunk 144534)
Target: x86_64-apple-darwin11.2.0
Thread model: posix
-- and --
$ clang++ --version
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.2.0
Thread model: posix
--
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