Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 May 2000 15:07:58 -0700 (PDT)
From:      Jean-Marc Zucconi <jmz@FreeBSD.org>
To:        bde@zeta.org.au
Cc:        dnelson@emsphone.com, current@FreeBSD.ORG
Subject:   Re: Can someone explain this?
Message-ID:  <200005062207.PAA19385@freefall.freebsd.org>
In-Reply-To: <Pine.BSF.4.21.0005070611030.8973-100000@besplex.bde.org> (message from Bruce Evans on Sun, 7 May 2000 06:22:20 %2B1000 (EST))
References:   <Pine.BSF.4.21.0005070611030.8973-100000@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> 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




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