This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/19210] [4.0 Regression] not using do-loop for some loops
- 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: 31 Dec 2004 00:56:57 -0000
- Subject: [Bug rtl-optimization/19210] [4.0 Regression] not using do-loop for some loops
- References: <20041230204442.19210.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rakdver at atrey dot karlin dot mff dot cuni dot cz 2004-12-31 00:56 -------
Subject: Re: [4.0 Regression] not using do-loop for some loops
> Zdenek, I have troubles understanding how such a loop can ever be infinite:
>
> - if wrapv, sooner or later K will reach any N (and thus, surely it will become
> less or equal to any given N).
>
> - if nowrapv, my understanding is that all bets are off: if f() is called with
> N<=3 the loop will terminate, otherwise it's undefined behaviour. In such a
> situation, we can still perform doloop because it's not going to screw the
> program any more than it is already.
>
> What am I missing?
I am afraid your interpretation of the code does not make much sense to
me. The loop always terminates except for the case when n == MAX_INT
and -fwrapv. In case n == MAX_INT and -fno-wrapv the behavior is
undefined.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19210