>>>>> 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 [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to