This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
memcpy result as function argument broken
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: memcpy result as function argument broken
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Tue, 09 Feb 1999 14:43:22 +0000
- Cc: richard dot earnshaw at arm dot com
- Cc: sdouglass at arm dot com
- Organization: ARM Ltd.
- Reply-To: richard dot earnshaw at arm dot com
On a sparc-sun-solaris2.5.1, the following test program compiled with
egcs-1.1.1 with -O aborts when run. A fix appears to have been added to
the trunk, but is there any chance of this fix being in egcs-1.1.2?
relevant fix (I think)
Tue Aug 18 10:33:30 1998 Jeffrey A Law (law@cygnus.com)
* expr.c (emit_block_move): Do not call memcpy as a libcall
instead build up a CALL_EXPR and call it like any other
function.
(clear_storage): Similarly for memset.
Richard.
#include <stdlib.h>
char a[5], b[5];
int c;
void foo(int x, char *y)
{
if (y != a)
abort();
}
int main()
{
foo(3, memcpy (a, b, c));
}
int c = 5;