This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Dce & infinite loops
- From: Steven Bosscher <stevenb at suse dot de>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 18 Mar 2004 13:31:57 +0100
- Subject: Re: [tree-ssa] Dce & infinite loops
- Organization: SUSE Labs
- References: <20040318122130.GA24448@atrey.karlin.mff.cuni.cz>
On Thursday 18 March 2004 13:21, Zdenek Dvorak wrote:
> Hello,
>
> I may be wrong, but IIRC it is incorrect to remove infinite loops, as
> happens currently for example for the following code:
>
> int main(void)
> {
> unsigned i;
>
> for (i = 1; i != 0; i+=2);
>
> return 0;
> }
Removing an infinte loop is indeed wrong. Hence this comment
in tree-ssa-dce.c:
/* Some blocks don't have an immediate post dominator. This can happen
for example with infinite loops. Removing an infinite loop is an
inappropriate transformation anyway... */
If we remove that infinite loop, you found a bug.
Gr.
Steven