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


> Date:   Wed, 1 Mar 2000 18:52:19 +0100
> From: Ralf Baechle <ralf@uni-koblenz.de>

> > Any suggestions about what to do about it?
> 
> Glibc seems to attempt to try to inline things at any price.  So I'd

Actually, most of the cost is glibc trying to work out whether or not
inlining is a good idea.

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

This probably won't help.  This is a compile-time problem, not an
execute-time problem.  For the example given, I'd expect to see about
six instructions generated, along the lines of

    li  r3,0
    stb r3,0(base)
    stb r3,16(base)
    stb r3,32(base)
    stb r3,48(base)
    stb r3,64(base)

since the strcpy operations are just storing the constant string "".
This is actually a case where the inliners are helping.

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

Hmmm.  Good point.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

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