------- Comment #2 from rakdver at atrey dot karlin dot mff dot cuni dot cz 2006-04-05 10:05 ------- Subject: Re: Unable to determine # of iterations for a simple loop
> Confirmed. That gives us a testcase at least. > > Now, back to the folding problem of > > PTR +- CST CMP PTR +- CST > > where all of PTR / CST are of pointer type naturally and unsigned usually. > The problem was that the frontends/middle-end introduce pointer overflow via > presenting us with PTR + (unsigned)-CST. Now, we may argue that if > (signed)CST > is positive, that this didn't happen, and we can do the comparison in either > signed or unsigned mode. If p points to the end of the array whose size is more than range of signed, then this would make you mistakenly consider p - size > p. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27039