http://llvm.org/bugs/show_bug.cgi?id=5294
Summary: possible integer wrong code bug
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Seen on Ubuntu Jaunty on x86. The -O0 output looks right.
reg...@john-home:~/volatile/tmp212$ clang -O0 small.c -o small
reg...@john-home:~/volatile/tmp212$ ./small
checksum = 1
reg...@john-home:~/volatile/tmp212$ clang -O1 small.c -o small
reg...@john-home:~/volatile/tmp212$ ./small
checksum = 0
reg...@john-home:~/volatile/tmp212$ clang -v
clang version 1.1 (trunk 84984)
Target: i386-pc-linux-gnu
Thread model: posix
reg...@john-home:~/volatile/tmp212$ cat small.c
#include <stdio.h>
#include <assert.h>
static char foo (char si1, char si2)
{
return si1 - si2;
}
int g_20;
int **g_76;
int g_137;
int func_7 (long long p_8);
int func_7 (long long p_8)
{
int *l_138 = &g_137;
int **l_151 = &l_138;
*l_151 = &g_20;
assert (g_76 == 0);
*l_138 = foo (7, 0) > 0;
return p_8;
}
int
main (void)
{
func_7 (0);
printf ("checksum = %d\n", g_20);
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