From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26807 invoked by alias); 1 Sep 2004 10:23:02 -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 26728 invoked from network); 1 Sep 2004 10:22:59 -0000 Received: from unknown (HELO smtp1.libero.it) (193.70.192.51) by sourceware.org with SMTP; 1 Sep 2004 10:22:59 -0000 Received: from localhost (172.16.1.79) by smtp1.libero.it (7.0.027-DD01) id 40C7315F0102095D; Wed, 1 Sep 2004 12:22:57 +0200 Received: from bagio (151.37.78.191) by smtp1.libero.it (7.0.027-DD01) id 40CB29090361FC64; Wed, 1 Sep 2004 12:22:56 +0200 Message-ID: <031701c4900d$a58ccfe0$bf4e2597@bagio> From: "Giovanni Bajo" To: "Rakesh Kumar, Noida" Cc: References: <33BC33A9E76474479B76AD0DE8A1697202C38D@exch-ntd.nec.noida.hcltech.com> Subject: Re: stack height reduction in tree-SSA Date: Wed, 01 Sep 2004 10:23:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at libero.it X-SW-Source: 2004-09/txt/msg00026.txt.bz2 Rakesh Kumar, Noida wrote: > I feel that this problem could have been fixed in tree-SSA, but > exactly opposite is done. [...] > Is it that good to forget the scope of variable and allocate each > one a new stack slot? I'm unable to get any reasons why the stack > slots can't be shared. Please make me aware of the issues involved. Yes. tree-ssa behaves very bad wrt stack allocation. There is at least an open regression filed by me about it (http://gcc.gnu.org/PR16987). The bug that tracks this problem is http://gcc.gnu.org/PR9997. Notice that, from what I heard, the correct solution would be to share stack slots using the live ranges of the variables, rather than the mere lexical scopes. For instance: void foo(void) { int a, b; a = get(); use_it(&a); b = get(); use_it(&b); } could be optimized to use only one variable on the stack. I have the secret hope that someone will eventually take care of this before 3.5 is release, but it's just a hope. Surely, this bug alone regresses GCC badly for all embedded systems. Giovanni Bajo