From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MiVor-0007Jb-JN for mharc-grub-devel@gnu.org; Tue, 01 Sep 2009 12:02:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MiVoo-0007Gr-2R for grub-devel@gnu.org; Tue, 01 Sep 2009 12:02:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MiVoj-0007Dc-4I for grub-devel@gnu.org; Tue, 01 Sep 2009 12:02:49 -0400 Received: from [199.232.76.173] (port=46780 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiVoi-0007DK-Lg for grub-devel@gnu.org; Tue, 01 Sep 2009 12:02:44 -0400 Received: from xvm-190-8.ghst.net ([217.70.190.8]:41534 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MiVoi-0001cZ-4O for grub-devel@gnu.org; Tue, 01 Sep 2009 12:02:44 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1MiVof-0005YN-64 for grub-devel@gnu.org; Tue, 01 Sep 2009 18:02:41 +0200 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1MiVoe-00072R-Lt for grub-devel@gnu.org; Tue, 01 Sep 2009 18:02:40 +0200 Date: Tue, 1 Sep 2009 18:02:40 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090901160240.GA27042@thorin> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [RFC] Eliminate NESTED_ATTR_FUNC X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Sep 2009 16:02:50 -0000 On Tue, Sep 01, 2009 at 11:43:10PM +0800, Bean wrote: > On Tue, Sep 1, 2009 at 9:42 PM, Vladimir 'phcoder' > Serbinenko wrote: > > Hello. NESTED_ATTR_FUNC was introduced 6 years ago to workaround a bug > > in compiler. Now it creates only problems. In particular if they are > > used wrong it creates a bug of argument passing. Such bugs are > > difficult to find because it usually results in strange behaviour and > > in grub-emu NESTED_FUNC_ATTR is exteneded to an empty string so gdb > > and valgrind can't detect any error. Should we perhaps remove it > > coupled with adding a requirement for at least gcc 4.2? Can I run > > s/NESTED_FUNC_ATTR//g; on entire codebase and remove corresponding > > entry in configure.ac? > > Hi, > > I make an assembly dump of the code generated by gcc-4.2. Apparently, > the "FIX" is achieved by ignoring the regparm attribute at all. > __attribute__ ((__regparm__ (3))) doesn't have any effect any more, it > always pass the parameters on the stack. This defeats the original > purpose of -mregparm=3, which passes parameters using register and > therefore reduce module size. In fact, if we are going to use stack, > we could just remove -mregparm=3 option, this works for all version of > gcc. I have the impression that using stack isn't a good idea for GRUB, due to size and speed improvements, except in cases where we can't avoid it. If older versions of GCC ignore -mregparm, we need a configure check (I prefer one that checks for the feature itself, but a version check is also acceptable IMHO). -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."