From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14900 invoked by alias); 15 Apr 2003 20:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 14858 invoked by uid 71); 15 Apr 2003 20:16:01 -0000 Date: Tue, 15 Apr 2003 20:16:00 -0000 Message-ID: <20030415201601.14857.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Wolfgang Bangerth Subject: Re: middle-end/10415: allocated stack space non optimimal Reply-To: Wolfgang Bangerth X-SW-Source: 2003-04/txt/msg00712.txt.bz2 List-Id: The following reply was made to PR middle-end/10415; it has been noted by GNATS. From: Wolfgang Bangerth To: GrzegorzB Cc: gcc-gnats@gcc.gnu.org, Subject: Re: middle-end/10415: allocated stack space non optimimal Date: Tue, 15 Apr 2003 15:15:25 -0500 (CDT) > Program test.c: > > void f() { > char buf[3]; > } > > main() { > f(); > } > > I compile this: > gcc -S -o test test.c What happens if you switch on optimization? Is stack allocation better then? [I think that the compiler will just optimize away everything in that case, but you might prevent this by doing something like void p(char *x); void f() { char buf[3]; p(buf); } and simply not defining f().] W. ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ices.utexas.edu www: http://www.ices.utexas.edu/~bangerth/