[LLVMbugs] [Bug 5294] New: possible integer wrong code bug
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Fri Oct 23 22:02:19 PDT 2009
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: unassignedbugs at nondot.org
ReportedBy: regehr at cs.utah.edu
CC: llvmbugs at cs.uiuc.edu
Seen on Ubuntu Jaunty on x86. The -O0 output looks right.
regehr at john-home:~/volatile/tmp212$ clang -O0 small.c -o small
regehr at john-home:~/volatile/tmp212$ ./small
checksum = 1
regehr at john-home:~/volatile/tmp212$ clang -O1 small.c -o small
regehr at john-home:~/volatile/tmp212$ ./small
checksum = 0
regehr at john-home:~/volatile/tmp212$ clang -v
clang version 1.1 (trunk 84984)
Target: i386-pc-linux-gnu
Thread model: posix
regehr at 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.
More information about the llvm-bugs
mailing list