Re: Linux 2.2.20-pre4

Philip Blundell (philb@gnu.org)
Tue, 19 Jun 2001 23:03:18 +0100


--==_Exmh_-570891986P
Content-Type: text/plain; charset=us-ascii

>> 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.

--==_Exmh_-570891986P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.5 (GNU/Linux)
Comment: Exmh version 2.1.1 10/15/1999 (debian)

iD8DBQE7L8wmVTLPJe9CT30RAkb5AKCrO6FDwipVFYYwf4FCux+sg4VDawCgqtC2
xsOGUEGne2An1dTav25rcqs=
=XtaQ
-----END PGP SIGNATURE-----

--==_Exmh_-570891986P--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/