From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19570 invoked by alias); 18 Mar 2004 12:34:47 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 19554 invoked from network); 18 Mar 2004 12:34:45 -0000 Received: from unknown (HELO atrey.karlin.mff.cuni.cz) (195.113.31.123) by sources.redhat.com with SMTP; 18 Mar 2004 12:34:45 -0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 29025) id E7C4E4C02D8; Thu, 18 Mar 2004 13:34:44 +0100 (CET) Date: Thu, 18 Mar 2004 12:38:00 -0000 From: Zdenek Dvorak To: Steven Bosscher Cc: gcc@gcc.gnu.org Subject: Re: [tree-ssa] Dce & infinite loops Message-ID: <20040318123444.GA26804@atrey.karlin.mff.cuni.cz> References: <20040318122130.GA24448@atrey.karlin.mff.cuni.cz> <200403181331.57192.stevenb@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200403181331.57192.stevenb@suse.de> User-Agent: Mutt/1.5.4i X-SW-Source: 2004-03/txt/msg01035.txt.bz2 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. the problem is that the loop in the example above has an exit (that is never taken); therefore the code in tree-ssa-dce.c you cite does not handle it. Zdenek