From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19561 invoked by alias); 24 Oct 2003 23:54:22 -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 19549 invoked from network); 24 Oct 2003 23:54:20 -0000 Received: from unknown (HELO develer.com) (151.38.19.110) by sources.redhat.com with SMTP; 24 Oct 2003 23:54:20 -0000 Received: (qmail 15458 invoked from network); 24 Oct 2003 23:54:16 -0000 Received: from beetle.trilan (HELO develer.com) (?Q7zR+AvfS/FSjxPXQD7muaVmK6wlCoUV?@10.3.3.220) by ns.trilan with SMTP; 24 Oct 2003 23:54:16 -0000 Message-ID: <3F99BBA7.4010605@develer.com> Date: Sat, 25 Oct 2003 06:04:00 -0000 From: Bernardo Innocenti Organization: Develer S.r.l. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030927 X-Accept-Language: en, en-us MIME-Version: 1.0 To: Gunther Nikl CC: GCC Mailing List Subject: Re: Testing m68k changes on AmigaOS and Linux/m68k References: <3F8C28AE.4060301@develer.com> <20031015093247.GA41502@lorien.int.gecko.de> <20031015164848.GA7684@lorien.int.gecko.de> <3F8D97C6.5020406@develer.com> <20031016133157.GA14232@lorien.int.gecko.de> <3F8ECE9E.1080500@develer.com> <20031021120030.GA31365@lorien.int.gecko.de> <3F9570DD.4050700@develer.com> <20031023131324.GA28408@lorien.int.gecko.de> <3F981300.9030306@develer.com> <20031024120720.GA30830@lorien.int.gecko.de> In-Reply-To: <20031024120720.GA30830@lorien.int.gecko.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-10/txt/msg01227.txt.bz2 Gunther Nikl wrote: >>With the varargs form, the compiler will push all arguments on the >>stack before calling foo(), effectively wasting the same amount of >>stack space of the local array. > > The array is allocated at _frame generation_. Now imagine using a lot > of such calls where every array is only used _one_ time. The varargs > form uses the stackspace only temorary when making the call and cleans > up soon after the call returns. I should have guessed GCC would handle it like that. However, since the scope of the array is within a nested block, a smarter compiler might do the right thing. That's another missing optimization. And, btw, SAS/C did it right ;-) -- // Bernardo Innocenti - Develer S.r.l., R&D dept. \X/ http://www.develer.com/ Please don't send Word attachments - http://www.gnu.org/philosophy/no-word-attachments.html