From owner-freebsd-hackers Tue Feb 5 11:40:14 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from patrocles.silby.com (d179.as0.nwbl0.wi.voyager.net [169.207.130.181]) by hub.freebsd.org (Postfix) with ESMTP id 6EB8B37B404 for ; Tue, 5 Feb 2002 11:40:03 -0800 (PST) Received: from localhost (silby@localhost) by patrocles.silby.com (8.11.6/8.11.6) with ESMTP id g15DhMn02520; Tue, 5 Feb 2002 13:43:24 GMT (envelope-from silby@silby.com) X-Authentication-Warning: patrocles.silby.com: silby owned process doing -bs Date: Tue, 5 Feb 2002 13:43:22 +0000 (GMT) From: Mike Silbersack To: Bruce Evans Cc: Michal Mertl , , Subject: Re: stack alignment issues In-Reply-To: <20020205163210.G25358-100000@gamplex.bde.org> Message-ID: <20020205134035.M1617-100000@patrocles.silby.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Tue, 5 Feb 2002, Bruce Evans wrote: > On Mon, 4 Feb 2002, Mike Silbersack wrote: > > > On Tue, 5 Feb 2002, Bruce Evans wrote: > > > I haven't done anything to clean up the patch. I hope the problem > > > will go away in future versions of gcc (align the stack at runtime in > > > the few routines that actually need it). > > > > Well, if Linux aligns the initial stack, the chance that gcc will have > > auto-alignment added sounds to be about zero. You might as well go ahead > > with your patch when you get a chance. > > There is a nonzero probability that the pessimization of aligning in almost > every routine will be fixed someday. Actually, the pessimization is worse > -- the alignment is done before every call. Even so, I'd wager that you can align the initial stack a few months ahead of when gcc's alignment is improved. > foo: > pushl %ebp > movl %esp,%ebp > subl $8,%esp # <- extra instruction for alignment (for foo) > addl $-12,%esp # <- extra instruction for alignment (for f1) What disgusting code. I find it amazing that they didn't even stick in some peephole optimizer to at least limit it to one operation. > My patch is not suitable for committing verbatim. It has 2 or 3 XXX's. > > Bruce True, but I'm sure you're capable of fixing it up if you so desire. :) Mike "Silby" Silbersack To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message