This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: small improvement for fill and fill_n
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Dan Nicolaescu <dann at godzilla dot ics dot uci dot edu>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 17 Jun 2004 20:54:44 +0200
- Subject: Re: small improvement for fill and fill_n
- References: <200406171841.i5HIfIGK006389@scanner2.ics.uci.edu>
Hi Dan,
Note that the memory location pointed to by __value is accessed in
each loop iteration, the compiler cannot prove that __first and
__value do not alias. One solution would be to use a temporary like
so:
First, thanks for the analysis: in order to seriously pursue performance
improvements we really need this kind of work.
Coming to the point, however, I wonder whether there are hopes that the
alias analysis will be improved in a not-to-far future... It would be
so sad to add those temporaries: I suspect *many* would be needed in
the whole libraries... .-(
Is an optimization PR in order?
Thanks again,
Paolo.