This is the mail archive of the libc-alpha@sources.redhat.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: Totally bogus string optimizations


Bernd Schmidt <bernds@redhat.co.uk> writes:

> I kind of disbelieve this.  It fails to produce decent code with 2.7.2.3,
> 2.95.2 and current CVS.

Well, look at the other mail on this subject.

> And it's not even surprising: you've exchanged something that would
> be easy for the compiler to recognize and optimize (a constant
> string copy) with something that is much more complex and therefore
> not nearly as easy to optimize.

But it does not happen!  The strcpy() function has a fixed semantics
for years and nevertheless gcc hasn't learned to optimize them
correctly.  The whole string header are only there to work around the
defficiencies of gcc.

> Then we should fix gcc to do this rather than hacking around the problem.

Oh, wise words.  Why haven't you done it before?  And we still have to
keep the headers for those who have older headers.  But I'm more than
willing to disable the use of the macros for gcc versions which have
these things fixed.  Provided there is finally also something like
regression testing for these optimizations.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

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