[LLVMbugs] [Bug 7750] New: likely integer wrong code bug
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Jul 29 09:57:58 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=7750
Summary: likely integer wrong code bug
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
regehr at john-home:~/work013$ clang -O0 small.c -o small
regehr at john-home:~/work013$ ./small
1
regehr at john-home:~/work013$ clang -O2 small.c -o small
regehr at john-home:~/work013$ ./small
0
regehr at john-home:~/work013$ clang -v
clang version 2.8 (trunk 109491)
Target: i386-pc-linux-gnu
Thread model: posix
regehr at john-home:~/work013$ cat small.c
static short foo (short left, unsigned int right)
{
return left;
}
struct S0
{
unsigned f7:15;
};
unsigned short g_158[8] = {
0xAF2FL, 0xAF2FL, 0xAF2FL, 0xAF2FL, 0xAF2FL, 0xAF2FL, 0xAF2FL, 0xAF2FL
};
struct S0 g_556[9][2];
struct S0 g_558 = {
0L
};
unsigned char l_565[3][1];
extern int printf (__const char *__restrict __format, ...);
int main (void)
{
const int g_264 = 1L;
struct S0 *l_555 = &g_556[4][0];
struct S0 *l_557 = &g_558;
short y = foo ((l_555 == l_557) | (g_264 && g_158[2]), 0);
printf ("%d\n", g_264 == y);
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