This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/46909] [4.6 Regression] elf32-i386.c and elf64-x86-64.c in binutils are miscompiled
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 12 Dec 2010 19:22:18 +0000
- Subject: [Bug middle-end/46909] [4.6 Regression] elf32-i386.c and elf64-x86-64.c in binutils are miscompiled
- Auto-submitted: auto-generated
- References: <bug-46909-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46909
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2010.12.12 19:22:15
Ever Confirmed|0 |1
Severity|normal |blocker
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2010-12-12 19:22:15 UTC ---
[hjl@gnu-6 tmp]$ cat y.c
extern void abort ();
struct entry
{
unsigned char tls_type;
} h;
int
__attribute__ ((__noinline__))
foo (struct entry *h)
{
int tls_type = h->tls_type;
if (! ((tls_type) == 4 || ((tls_type) == (2 | 4)))
|| ((tls_type) == 2 || ((tls_type) == (2 | 4))))
return 1;
return -1;
}
int
main ()
{
struct entry h;
h.tls_type = 6;
if (foo (&h) != 1)
abort ();
return 0;
}
[hjl@gnu-6 tmp]$ /usr/gcc-4.6/bin/gcc -O2 y.c
[hjl@gnu-6 tmp]$ ./a.out
Aborted
[hjl@gnu-6 tmp]$ gcc -O2 y.c
[hjl@gnu-6 tmp]$ ./a.out
[hjl@gnu-6 tmp]$