lkml.org 
[lkml]   [2001]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Linux 2.2.20-pre4
Date
From
>> It wont build with gcc 3.0 yet. To start with gcc 3.0 will assume it can
>> insert calls to 'memcpy'
>
>IMHO omitting -fno-builtin when compiling the kernel was always a risky
>proposition... Since we provide our own copies of many of the builtins
>[which are used in the kernel] anyway... why not always -fno-builtin,
>and then call __builtin_foo when we really want the compiler's version..
>
>gcc 3.0 without -fno-builtin is perfectly allowed to assume it can
>insert calls to memcpy..

I don't think -fno-builtin has any bearing on whether gcc will emit calls to
memcpy; instead it prevents gcc from open-coding them when it thinks it
understands what's going on.

Try this with gcc -O2 -S, and again with -fno-builtin:

struct s { int a[200]; };

f(struct s *a, struct s *b)
{
*b = *a;
}

g(int *a, int *b)
{
memcpy(b, a, 4);
}

p.


[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.079 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site