This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/35907] [4.3/4.4 Regression] 64-bit power6 glibc miscompilation
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Apr 2008 14:25:37 -0000
- Subject: [Bug target/35907] [4.3/4.4 Regression] 64-bit power6 glibc miscompilation
- References: <bug-35907-87@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from jakub at gcc dot gnu dot org 2008-04-11 14:25 -------
Smaller testcase:
/* { dg-do run } */
/* { dg-options "-O2 -mcpu=power6" } */
#define vector __attribute__((vector_size (16)))
union
{
vector int k;
int c[16];
} u, v, w;
vector int m;
void __attribute__((noinline))
bar (void *i, vector int j)
{
asm volatile ("" : : "r" (i), "r" (&j) : "memory");
}
int __attribute__((noinline))
foo (int i, vector int j)
{
char *p = __builtin_alloca (64 + i);
m += u.k;
v.k = m;
w.k = j;
if (__builtin_memcmp (&v.c, &w.c, 16) != 0)
__builtin_abort ();
j += u.k;
bar (p, j);
j += u.k;
bar (p, j);
return 0;
}
int
main (void)
{
vector int l;
int i;
for (i = 0; i < 4; i++)
u.c[i] = i;
l = u.k;
if (foo (64, l))
__builtin_abort ();
l += u.k;
if (foo (64, l))
__builtin_abort ();
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35907