gcc.c-torture/execute/builtins/memops-asm.c fails on sh-elf
with -O1 and higher. It seems that bcopy is converted to memcpy
even when source and destination area are overlapped. It looks
same tests start to fail also on ia64 and s390 testresults. They
don't fail on i686, but a similar testcase
typedef __SIZE_TYPE__ size_t;
extern void abort (void);
extern void bcopy (const void *, void *, size_t);
extern int memcmp (const void *, const void *, size_t);
char y[64] = "foXXXrfoobar";
int
main ()
{
bcopy (y + 1, y + 2, 6);
if (memcmp (y, "fooXXXrfobar", 13))
abort ();
return 0;
}
aborts with -O1 on i686-pc-linux-gnu for revision 119302.
If the resent changes of builtins.c in r119292 and r119294 are
reverted, the errors go away.
--
Summary: [4.3 Regression] bcopy is wrongly converted to memcpy
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kkojima at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30028