From owner-freebsd-hackers Mon Aug 5 9:18:41 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 C700037B400 for ; Mon, 5 Aug 2002 09:18:39 -0700 (PDT) Received: from smtpproxy2.mitre.org (smtpproxy2.mitre.org [192.80.55.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2137A43E3B for ; Mon, 5 Aug 2002 09:18:39 -0700 (PDT) (envelope-from jandrese@mitre.org) Received: from avsrv2.mitre.org (avsrv2.mitre.org [128.29.154.4]) by smtpproxy2.mitre.org (8.11.3/8.11.3) with ESMTP id g75GEfL14588; Mon, 5 Aug 2002 12:14:41 -0400 (EDT) Received: from MAILHUB1 (mailhub1.mitre.org [129.83.20.31]) by smtpsrv1.mitre.org (8.11.3/8.11.3) with ESMTP id g75GEbY20428; Mon, 5 Aug 2002 12:14:37 -0400 (EDT) Received: from mm112324-2k.mitre.org (128.29.105.195) by mailhub1.mitre.org with SMTP id 11090483; Mon, 05 Aug 2002 12:14:08 -0400 Message-ID: <3D4EA466.C1289F0F@mitre.org> Date: Mon, 05 Aug 2002 12:14:30 -0400 From: Jason Andresen Organization: The MITRE Corporation X-Mailer: Mozilla 4.79 [en]C-20020130M (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Terry Lambert Cc: Darren Pilgrim , Dmitry Morozovsky , hackers@freebsd.org Subject: Re: -fomit-frame-pointer for the world build References: <20020802212841.R58905-100000@woozle.rinet.ru> <3D4AC526.4CD399B3@mindspring.com> <3D4C8464.A2F4775A@pantherdragon.org> <3D4CC81F.94526C8A@mindspring.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Terry Lambert wrote: > > Darren Pilgrim wrote: > > Terry Lambert wrote: > > > Dmitry Morozovsky wrote: > > > > What are the drawbacks of building FreeBSD with -fomit-frame-pointer? > > > > > > The frame pointer is used for debugging, specifically for the > > > stack traceback function to know arguments. Removing it means > > > losing some debugging functionality. Next time try "info gcc": > > > > If you don't have any need for debugging your software, is there any > > use for frame pointers? Is this something that can safely be used for > > both CFLAGS and COPTFLAGS? > > You can't use it in conjunction with calee pop, if you have > mixed code. > > So it really depends on what other optimizations you throw in > the mix, and then you have the problem of interfacing with > assembly language code, as well -- the calling standard has to > match, if it's asymmetric (i.e. not "caller push, caller pop"), > and assembly code is hand-coded in this respect in most cases. > > The claimed savings are fictions. They are function call > overhead savings assuming an average number of arguments and > related pushed values, and they apply only to the call process > itself. Most time in programs is spent in running, not calling > functions, so if you expect an elimination of "18% overhead" > to make you programs that much faster, you are dreaming. On the other hand, -fomit-frame-pointer is the only optimization beyond -O in gcc that actually seems to offer any sort of speedup for me. I've seen 10 to 20% reduction in runtime on some programs with -fomit-frame-pointer. It's the only specific optimization I bother with anymore. -- \ |_ _|__ __|_ \ __| Jason Andresen jandrese@mitre.org |\/ | | | / _| Network and Distributed Systems Engineer _| _|___| _| _|_\___| Office: 703-883-7755 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message