From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264692AbUEaQ6e (ORCPT ); Mon, 31 May 2004 12:58:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264693AbUEaQ6e (ORCPT ); Mon, 31 May 2004 12:58:34 -0400 Received: from fw.osdl.org ([65.172.181.6]:50379 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S264692AbUEaQ6d (ORCPT ); Mon, 31 May 2004 12:58:33 -0400 Date: Mon, 31 May 2004 09:58:30 -0700 (PDT) From: Linus Torvalds To: Peter Osterlund cc: Kernel Mailing List , Andrew Morton , trond.myklebust@fys.uio.no Subject: Re: Linux 2.6.7-rc2 In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 31 May 2004, Peter Osterlund wrote: > > If I put "#if 0" around the *wdata assignment in nfs_writepage_sync, > the stack usage goes down to 36, so it looks like gcc is building a > temporary structure on the stack and then copies the whole thing to > *wdata. Yeah, that's silly. But understandable. A lot of problems go away by doing a temporary private node.. > Does this construct save stack space for any version of gcc? Maybe the > code should be changed to do a memset() followed by explicit > initialization of the non-zero member variables instead. In this case, I'd agree. In some other cases, it's better to create a initialized static variable, and just use that as an initial initializer. In this case that doesn't much help, since none of the fields are constant. Trond? Linus