From owner-freebsd-current Sat May 6 15: 8: 1 2000 Delivered-To: freebsd-current@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 0B16937BCB6; Sat, 6 May 2000 15:07:59 -0700 (PDT) (envelope-from jmz@FreeBSD.org) Received: (from jmz@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id PAA19385; Sat, 6 May 2000 15:07:58 -0700 (PDT) (envelope-from jmz@FreeBSD.org) Date: Sat, 6 May 2000 15:07:58 -0700 (PDT) Message-Id: <200005062207.PAA19385@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: jmz set sender to jmz@FreeBSD.org using -f From: Jean-Marc Zucconi To: bde@zeta.org.au Cc: dnelson@emsphone.com, current@FreeBSD.ORG In-reply-to: (message from Bruce Evans on Sun, 7 May 2000 06:22:20 +1000 (EST)) Subject: Re: Can someone explain this? X-Mailer: Emacs References: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>>>> Bruce Evans writes: > The default of 4 for -mpreferred-stack-boundary perfectly preserves > any initial misaligment of the stack. Under FreeBSD the stack is > initially misaligned (for doubles) with a probability of 1/2. There > was some discussion of fixing this when gcc-2.95 was imported, but > nothing was committed. I use the following local hack: > diff -c2 kern_exec.c~ kern_exec.c > *** kern_exec.c~ Mon May 1 15:56:40 2000 > --- kern_exec.c Mon May 1 15:56:42 2000 > *************** > *** 627,630 **** > --- 647,659 ---- > vectp = (char **) > (destp - (imgp->argc + imgp->envc + 2) * sizeof(char*)); > + > + /* > + * Align stack to a multiple of 0x20. > + * XXX vectp has the wrong type; we usually want a vm_offset_t; > + * the suword() family takes a void *, but should take a vm_offset_t. > + * XXX should align stack for signals too. > + * XXX should do this more machine/compiler-independently. > + */ > + vectp = (char **)(((vm_offset_t)vectp & ~(vm_offset_t)0x1F) - 4); > /* Any chance that your fix be committed? :-) The impact of misalignments on performance is considerable. Jean-Marc -- Jean-Marc Zucconi PGP Key: finger jmz@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message