http://llvm.org/bugs/show_bug.cgi?id=12514
Bug #: 12514
Summary: likely wrong code bug
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
[regehr@dyson r16]$ clang small.c
[regehr@dyson r16]$ ./a.out
1
[regehr@dyson r16]$ clang -O small.c
[regehr@dyson r16]$ ./a.out
0
[regehr@dyson r16]$ cat small.c
int printf (const char *, ...);
int a, b, d = 1, e, f;
int *c;
char
fn1 (char p1)
{
return p1 ? p1 : 1 << a;
}
void
fn2 ()
{
if (fn1 (~d))
e = 1;
}
int
main ()
{
d &= (c == 0) > (0 >= b) == 0;
f = 0;
fn2 ();
printf ("%d\n", e);
return 0;
}
[regehr@dyson r16]$ clang -v
clang version 3.1 (trunk 154369)
Target: x86_64-unknown-linux-gnu
Thread model: posix
--
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