This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/27039] [4.1/4.2 Regression] Unable to determine # of iterations for a simple loop
- From: "rakdver at atrey dot karlin dot mff dot cuni dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Apr 2006 10:05:09 -0000
- Subject: [Bug tree-optimization/27039] [4.1/4.2 Regression] Unable to determine # of iterations for a simple loop
- References: <bug-27039-5077@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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