[LLVMbugs] [Bug 11966] New: possible union bug
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Feb 9 20:11:27 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=11966
Bug #: 11966
Summary: possible union bug
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: regehr at cs.utah.edu
CC: gohman at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
I don't know that this is a bug, but wanted to get a couple people to look at
it.
All non-LLVM compilers that I tested (5 or so) print "1" at all optimization
levels.
Clang prints "0" at -O2.
int printf (const char *, ...);
union U0 {
short f0;
int f1;
} b;
union U0 *c = &b;
int main ()
{
b.f0 = 0;
c->f1 = 1;
printf ("%d\n", b.f0);
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