Optimising std::find on x86 and PPC

Paolo Carlini pcarlini@suse.de
Tue Dec 14 22:20:00 GMT 2004


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.



More information about the Gcc mailing list