Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MjEkt-0002Rt-Lq for mharc-grub-devel@gnu.org; Thu, 03 Sep 2009 12:01:47 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjEks-0002QE-5S for grub-devel@gnu.org; Thu, 03 Sep 2009 12:01:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjEkm-0002Nu-Kj for grub-devel@gnu.org; Thu, 03 Sep 2009 12:01:45 -0400 Received: from [199.232.76.173] (port=43317 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjEkm-0002NZ-5n for grub-devel@gnu.org; Thu, 03 Sep 2009 12:01:40 -0400 Received: from mail-iw0-f195.google.com ([209.85.223.195]:35503) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjEkl-00007d-8l for grub-devel@gnu.org; Thu, 03 Sep 2009 12:01:39 -0400 Received: by iwn33 with SMTP id 33so22396iwn.24 for ; Thu, 03 Sep 2009 09:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=KHnNduoeD1qGQsLZQtpmAdn55/EyOzQWbvw29voRo80=; b=O1xW4/Xp1iEQd+KdV1nR5Kvj0dULHCy4UECPSi1XOCK4b+iQiWba6qE/hM6kqLN1KT euhcNvi6sSpyB0zDFIn2kug0l1Lsl1VH6f44r6l/Bq1n6FISDohXguirf75YlMioBD+m vyAIIopdC64xhjjeJUaDCtKyBabyZ3cD7I8hM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Au9n1yvuvk9IW60xd4140Q3PvGyEIyUco5tpyxgPDMKSB28CPh/e0Y/S4b3c7pbl2m p1sk8Ys/XeOSOeMUJzod1eC8Jq4OSz+NJe/8r4201uM8qgJlQ6lAiRc1a6wx1VGp/l94 eGBZUbMkDaurTUggac6d2RGbuwkClm2kaPFwg= MIME-Version: 1.0 Received: by 10.231.5.79 with SMTP id 15mr9347657ibu.7.1251993698137; Thu, 03 Sep 2009 09:01:38 -0700 (PDT) In-Reply-To: <1251992989.2870.8.camel@fz.local> References: <20090903153623.GA18824@thorin> <1251992989.2870.8.camel@fz.local> Date: Fri, 4 Sep 2009 00:01:38 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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: Thu, 03 Sep 2009 16:01:46 -0000 On Thu, Sep 3, 2009 at 11:49 PM, Felix Zielcke wrote: > Am Donnerstag, den 03.09.2009, 17:36 +0200 schrieb Robert Millan: >> On Wed, Sep 02, 2009 at 12:20:19PM +0800, Bean wrote: >> > >> > Hi, >> > >> > Oh, I was wrong previously, gcc does respect __attribute__ >> > ((__regparm__ (3))) flag (I forget to add -Os so it still uses stack >> > to store value). And the bug is still there ! Try this test program: >> >> Thanks Bean. =A0I have opened an entry in GCC bugzilla, and submitted yo= ur >> test program in it: >> >> =A0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D41246 >> >> Hopefully they'll fix it in later versions, and hopefully people will >> upgrade soon. =A0In the meantime, we're stuck with it. >> > > Is there any reason why we fallback to regparm 1 and not to regparm 2? > According to the output of the testcase in the above bug report 2 seems > to work too? Hi, If the first parameter is 64-bit, it will use two registers, so the second parameter is %ecx, which conflicts with local environment pointer. To see it in action, change parameter int aa to long long aa in the test program and compile it with -mregparm=3D2. --=20 Bean gitgrub home: http://github.com/grub/grub/ my fork page: http://github.com/bean123/grub/