This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: I think I found a bug...


On Wed, Mar 01, 2000 at 08:51:50AM -0800, Geoff Keating wrote:

> > > It seems that the problem really stems from glibc's inline string
> > > intrinsics. While the GCC compiler should not use vast amounts of virtual
> > > memory to compile such an itty-bitty routine, the GCC people suspect that
> > > something in glibc is tickling some nasty behavior in GCC.
> 
> Yes.  The problem is that the preprocessor macro uses the source of
> the strcpy() (the second argument) about 24 times.  The quoted test
> case uses five nested strcpy calls, producing about eight million
> copies of the strcpy macro.
> 
> Naturally, it takes substantial memory and CPU time to deal with this.
> 
> Any suggestions about what to do about it?

Glibc seems to attempt to try to inline things at any price.  So I'd
suggest to be less agressive about that.  Calling a small subroutine on
MIPS is mostly expensive because the callee has to assume that alot of
temporary registers have been clobbered.  So my attempt for MIPS will
be to call the real strcpy from an inline assembler stub possibly supplying
some variants for special cases.  Should keep the cache footprint down and
not be as extremly complex as the old routines.  For Intel the strategy
obviously needs to be different.

I assume the coredump bugs in egcs have been fixed in the meantime?

  Ralf

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]