From owner-freebsd-hackers Tue Aug 6 15: 6:52 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0393737B400 for ; Tue, 6 Aug 2002 15:06:50 -0700 (PDT) Received: from ren.fdy2.net (fdy2.demon.co.uk [194.222.102.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C74143E70 for ; Tue, 6 Aug 2002 15:06:48 -0700 (PDT) (envelope-from rjs@ren.fdy2.net) Received: from ren.fdy2.net (localhost [127.0.0.1]) by ren.fdy2.net (8.12.5/8.11.3) with ESMTP id g76MAFjo088035; Tue, 6 Aug 2002 23:10:16 +0100 (BST) (envelope-from rjs@ren.fdy2.net) Received: (from rjs@localhost) by ren.fdy2.net (8.12.5/8.12.5/Submit) id g76MAFxJ088032; Tue, 6 Aug 2002 23:10:15 +0100 (BST) Date: Tue, 6 Aug 2002 23:10:15 +0100 (BST) Message-Id: <200208062210.g76MAFxJ088032@ren.fdy2.net> From: Robert Swindells To: dillon@apollo.backplane.com Cc: hackers@freebsd.org In-reply-to: <200208062050.g76Ko0AO015075@apollo.backplane.com> (message from Matthew Dillon on Tue, 6 Aug 2002 13:50:00 -0700 (PDT)) Subject: Re: -fomit-frame-pointer for the world build Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Matthew Dillon wrote: >Dan Nelson wrote: >:I thought the main thing you got out of -fomit-frame-pointer was a free >:register, which is a scarce commodity on x86. >: >:-- >: Dan Nelson >: dnelson@allantgroup.com > I've done considerable testing of -fomit-frame-pointer and it really > only has an effect if the program makes lots (millions) of calls to tiny, > fast procedures. This is because the push %ebp; movl %esp,%ebp is > removed from the beginning of the procedure and the 'leave' is removed > from the end of the procedure (though an addl to restore %esp has to be > added in). > GCC does not seem to be able to make use of the extra register, or if > it does it does not seem to be able to use it to any great degree. > The IA32 architecture has 6 general registers available to it > (eax, edx, ecx, ebx, esi, edi). Throwing in ebp would not make a huge > difference, nor can 8 and 16 bit specifications (e.g. %al, %ah) be > mixed together safely without a severe performance penalty on higher > end cpus. If you are running on a PPro or above you have a lot more than 6 physical registers. I have seen a comment (I think from one of the GCC people) that you can modify the compiler to only use one register and the output won't run much slower. I would rather just be confident that programs will work, even across calls to things like alloca(). Robert Swindells To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message