Re: where did memset go?

From: Jakub Jelinek (jakub@redhat.com)
Date: Thu Feb 03 2000 - 10:51:48 EST


> > Ok then. The issue is that gcc generates internally that memset for the
> > local structure assignment. You can workaround it by doing what the patchlet
> > sais. I think this is a bug in gcc because it normally expands memcpy/memset
> > internally on i386.
> > But I wonder why i386 does not export memcpy/memset for such cases, IMHO it
> > should.
> > But the patch below gives you more efficient code anyway.
>
> Does compiling with -fno-builtin for all kernels make sense?

It does not and will not cure this anyway.
A simplified testcase for what's gcc doing is:

struct c { char name[20]; };
void bar(struct c *);
void foo(void)
{
        struct c a = {"string"};
        bar(&a);
}

where it fills the remaining 20-7 bytes of the structure with memset and not
rep stos* on i386.

Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.41 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Feb 07 2000 - 21:00:09 EST