http://llvm.org/bugs/show_bug.cgi?id=9454
Summary: clang wrong code bug
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
[regehr@gamow ~]$ clang -v
clang version 3.0 (trunk 127456)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr@gamow ~]$ clang -O0 small.c -o small
[regehr@gamow ~]$ ./small
g_331 = 1
[regehr@gamow ~]$ clang -O1 small.c -o small
[regehr@gamow ~]$ ./small
g_331 = 2
[regehr@gamow ~]$ cat small.c
int g_34 = 1;
static int g_331;
int printf(const char *format, ...);
int main (int argc, char* argv[])
{
g_331 = 1 + ((g_34 & 2) == g_34);
printf("g_331 = %d\n", g_331);
return 0;
}
--
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