From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8320 invoked by alias); 23 Aug 2005 19:26:28 -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 8264 invoked by uid 22791); 23 Aug 2005 19:26:16 -0000 Received: from mailout09.sul.t-online.com (HELO mailout09.sul.t-online.com) (194.25.134.84) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 23 Aug 2005 19:26:16 +0000 Received: from fwd19.aul.t-online.de by mailout09.sul.t-online.com with smtp id 1E7ePV-0001O6-00; Tue, 23 Aug 2005 21:26:13 +0200 Received: from [84.152.195.195] (SyFKJ2ZfQe98JeOVRmlIJtR0GNRWNC6EyNdaEPlnZh7lzkPJHw1bwt@[84.152.195.195]) by fwd19.sul.t-online.de with esmtp id 1E7ePM-2FVqQi0; Tue, 23 Aug 2005 21:26:04 +0200 Message-ID: <430B7870.9000007@t-online.de> Date: Tue, 23 Aug 2005 19:32:00 -0000 From: Bernd Schmidt User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) MIME-Version: 1.0 To: Steven Bosscher CC: gcc@gcc.gnu.org, Daniel Berlin , Andreas Krebbel , James E Wilson Subject: Re: Problem with the special live analyzer in global alloc References: <20050816135150.GA3617@de.ibm.com> <1124809003.7123.14.camel@linux.site> <430B3B61.9010302@t-online.de> <200508231712.16188.stevenb@suse.de> In-Reply-To: <200508231712.16188.stevenb@suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: SyFKJ2ZfQe98JeOVRmlIJtR0GNRWNC6EyNdaEPlnZh7lzkPJHw1bwt X-TOI-MSGID: 3225aa43-4470-4903-94a1-88cdabf328e6 X-SW-Source: 2005-08/txt/msg00645.txt.bz2 Steven Bosscher wrote: > On Tuesday 23 August 2005 17:06, Bernd Schmidt wrote: > >>The idea is to put the initialization insns only on the paths where the >>register will be uninitialized. > > > int foo (int n) > { > int a; > > while (--n) > a = n; > > return a; > } > > Not knowing n, how can you be sure whether "a" is uninitialized for > the "return" statement or not? In this case, assuming nothing interesting happens to the loop, you'll have to conservatively initialize "a" near the top of the function. In many cases you can do better and either initialize just before the use, or initialize on an edge on which the register is uninitialized. For register allocation purposes however, this should be as good as using Vlad's new liveness analysis. As Jim points out, we may have to do that for IA64 anyway, so we could consider doing it on all targets. Dan is correct that this can introduce new code that won't be eliminated. One question is how often this is going to occur in practice. Bernd