This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug tree-optimization/27039] [4.1/4.2 Regression] Unable to determine # of iterations for a simple loop



------- 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


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