Unable to bootstrap gcc snapshot of 20001211 on Dynix/ptx
Joseph S. Myers
jsm28@cam.ac.uk
Mon Dec 18 08:35:00 GMT 2000
On Mon, 18 Dec 2000, Robert Lipe wrote:
> Is overlapping memory expected to be handled by bcopy? Of course, we
> can't look at the ISO standard becuase it's not in there...
>
> > the old mail to use memmove in the one case (in cp/class.c)where overlapping
> > copy was being done and things worked fine (in 2.95.2). Since there might be
>
> I probably don't get a vote in this, but think I'd rather fix the
> offending source.
According to the Single Unix Specification, bcopy must handle overlapping
memory.
All uses of bcopy in GCC ought to be replaced by memcpy or memmove, as
appropriate, depending on whether memory can overlap (and swapping
arguments when making the change, since bcopy has different order of
source and destination arguments). In general, however, this may require
some understanding of the particular code using bcopy in each case, to
work out whether arguments might overlap. If an interim fix is wanted
until bcopy can be eliminated from GCC, an autoconf test for broken bcopy
is surely better than hardcoding information about whether bcopy is broken
on a particular system.
Files with bcopy uses (may not be a perfectly accurate list, but might
help maintainers know what bits of their code to look at):
collect2.c combine.c genattrtab.c loop.c
optabs.c sbitmap.c toplev.c ch/lex.c
ch/typeck.c cp/class.c cp/decl.c java/constants.c
java/lex.c java/parse.y config/alpha/alpha.c
config/m32r/m32r.c config/m88k/m88k.c
config/vax/vax.c
Incidentally, I think there's an argument for reversing
TARGET_MEM_FUNCTIONS, and instead having a target macro for if the BSD
functions should be used for generated calls - on the presumption that the
ISO C functions should now be the default. But making the change could be
a bit error-prone (every target would need to be checked).
--
Joseph S. Myers
jsm28@cam.ac.uk
More information about the Gcc
mailing list