This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

memcpy result as function argument broken



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;




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]