[Bug tree-optimization/40087] [4.3/4.4/4.5 Regression] Number of iterations analysis wrong
rguenther at suse dot de
gcc-bugzilla@gcc.gnu.org
Fri May 15 08:44:00 GMT 2009
------- Comment #7 from rguenther at suse dot de 2009-05-15 08:44 -------
Subject: Re: [4.3/4.4/4.5 Regression] Number
of iterations analysis wrong
On Fri, 15 May 2009, rakdver at gcc dot gnu dot org wrote:
> ------- Comment #6 from rakdver at gcc dot gnu dot org 2009-05-15 00:34 -------
> (In reply to comment #5)
> > It is number of iteration analysis that gets it wrong (I suppose it might get
> > confused by the two exits of the loop?).
>
> Sort of; # of iterations analysis assumes that pointers never wrap, and uses
> this assumption to derive a wrong number of iterations for the first exit
> (which is not taken). We had a similar problem before (PR 25985), but I
> somehow persuaded myself that this cannot happen with pointers.
Ah - it indeed cannot happen, but you need to assume that the offsets
in POINTER_PLUS_EXPRs are signed (even though they are unsigned as
they are of type sizetype). At least that should be the only
"overflow" present in this testcase, no?
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40087
More information about the Gcc-bugs
mailing list