This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimising std::find on x86 and PPC


Zdenek Dvorak wrote:

as Andrew noted, the problem is that the loop actually looks like

for (i = a; i < b; i += 4)
 something;

At rtl level we do not have sufficient information to determine the
number of iterations of this loop precisely at runtime -- we cannot
determine whether it is not infinite. This however should not block
loop unrolling, and should be relatively simple to fix; I will try.


Thanks in advance, Zdenek.

Note however that the fact that 3.3 unrolls this loop very likely means
that 3.3 is buggy; I guess that 3.3 would also unroll

for (i = a; i < b; i += 5)
 something;

Which would be obviously wrong, unless you are very careful with the way
number of iterations is determined (which 3.3 is not).


I see, thanks for the explanation. Something similar already happened in other
circumstances, I seem to remember.


Thanks again,
Paolo.


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