Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Aug 2002 23:10:15 +0100 (BST)
From:      Robert Swindells <rjs@fdy2.demon.co.uk>
To:        dillon@apollo.backplane.com
Cc:        hackers@freebsd.org
Subject:   Re: -fomit-frame-pointer for the world build
Message-ID:  <200208062210.g76MAFxJ088032@ren.fdy2.net>
In-Reply-To: <200208062050.g76Ko0AO015075@apollo.backplane.com> (message from Matthew Dillon on Tue, 6 Aug 2002 13:50:00 -0700 (PDT))

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208062210.g76MAFxJ088032>