This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] new version of fix gcc.c-torture/execute/20010124-1 on MIPS...
On Fri, Sep 09, 2005 at 09:28:28AM -0700, David Daney wrote:
> + struct S {
> + char stuff[1024];
> + };
> +
> + union U {
> + struct {
> + int space;
> + struct S s;
> + } a;
> + struct {
> + struct S s;
> + int space;
> + } b;
> + };
> +
> + struct S f(struct S *p)
> + {
> + return *p;
> + }
> +
> + void g(union U *p)
> + {
> + }
Only the memcpy needs to go in the lib file.
> + void *memcpy(void *a, const void *b, size_t len)
> + {
> + if (a < b && a+len > b)
> + abort ();
> + if (b < a && b+len > a)
> + abort ();
> + return a;
> + }
And since this memcpy will now be called by the runtime before main,
it needs to actually implement memcpy.
r~