This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
- 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: 3 Jan 2009 08:46:07 -0000
- Subject: [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
- References: <bug-38708-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from jakub at gcc dot gnu dot org 2009-01-03 08:46 -------
There are several issues. One is what H.J. mentioned, seen e.g. on:
char buf[8] __attribute__((aligned));
char A = 'A';
int len = 1;
void __attribute__((noinline))
check (void)
{
if (__builtin_memcmp (buf, "\0\0A\0\0\0\0\0", 8))
__builtin_abort ();
}
int
main ()
{
__builtin_memset (buf + 2, A, len);
check ();
return 0;
}
with -O -mtune=pentium-m -m32. This can be fixed by adding
max_size = smallest_pow2_greater_than (max_size - 1); at the start of
expand_setmem_epilogue_via_loop. But another testcase with the same options
that still fails is:
char buf[8] __attribute__((aligned)) = "AAAAAAAA";
char A = 'A';
int len = 4;
void __attribute__((noinline))
check (void)
{
if (__builtin_memcmp (buf, "AAAA\0\0\0\0", 8))
__builtin_abort ();
}
int
main ()
{
__builtin_memset (buf + 4, '\0', len);
check ();
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38708