[LLVMbugs] [Bug 7845] New: wrong code from clang on x86-64
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Aug 8 20:03:25 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=7845
Summary: wrong code from clang on x86-64
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: regehr at cs.utah.edu
CC: llvmbugs at cs.uiuc.edu, chenyang at cs.utah.edu
[regehr at babel work001]$ clang -O1 small.c -o small
[regehr at babel work001]$ ./small
5
[regehr at babel work001]$ clang -O2 small.c -o small
[regehr at babel work001]$ ./small
1
[regehr at babel work001]$ clang -v
clang version 2.8 (trunk 110555)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr at babel work001]$ cat small.c
extern int printf (__const char *__restrict __format, ...);
short foo (int left)
{
return left;
}
int main(void)
{
int g_4;
for (g_4 = 0; g_4 < 5; g_4 += 1)
{
int l_9 = foo (g_4);
if (l_9) continue;
if (g_4) break;
}
printf("%d\n", g_4);
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.
More information about the llvm-bugs
mailing list