Messages in this thread | | | Subject | Re: Linux 2.2.20-pre4 | Date | Tue, 19 Jun 2001 23:03:18 +0100 | From | Philip Blundell <> |
| |
>> 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] | |