This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to allow strlen expander to fail
- To: Jeffrey A Law <law at cygnus dot com>
- Subject: Re: Patch to allow strlen expander to fail
- From: Jamie Lokier <jamie dot lokier at cern dot ch>
- Date: Tue, 7 Mar 2000 01:50:51 +0100
- Cc: Horst von Brand <vonbrand at sleipnir dot valparaiso dot cl>, gcc at gcc dot gnu dot org
- References: <200003060159.e261xPj06505@sleipnir.valparaiso.cl> <4022.952371469@upchuck>
Jeffrey A Law wrote:
> > There was recently a problem with the Linux kernel because gcc
> > willy-nilly called memcpy(3), and that one isn't around in the kernel,
> Then that's a kernel problem. They're depending on a specific, undocumented
> and highly implementation dependent behavior in the compiler. That's dumb.
The problem is that GCC emits out of line calls to memcpy for structure
copies. Linux provides a perfectly good inline memcpy function, but it
is not used by GCC.
To work around this, people are supposed to use a "struct_cpy" macro
instead of structure assignment. Ugly, easily forgotten, and not
required for all architectures. But it works.
-- Jamie