http://llvm.org/bugs/show_bug.cgi?id=11535
Bug #: 11535
Summary: Clang miscompiles simple C code
Product: clang
Version: 3.0
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 7709
--> http://llvm.org/bugs/attachment.cgi?id=7709
Test case C program
Clang 3.0 with -O2 miscompiles the attached C code on Linux x86_64.
Correct result is "x=1"; with clang instead it prints "x=2".
Clang 2.9 is not affected.
It appears that the value of 'x' printed is as if it was incremented a second
time (which it must not be). Some evidence of this is that if you change
"pos++" to "pos += 4" for instance, it prints out "x=8" (instead of "x=4").
--
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