delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/01/08/12:01:07

From: Andrew Crabtree <andrewc AT typhoon DOT rose DOT hp DOT com>
Message-Id: <199801081658.AA015268737@typhoon.rose.hp.com>
Subject: Re: Stack Alignment
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Thu, 08 Jan 1998 8:58:56 PST
Cc: djgpp-workers AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.980108104735.8789H-100000@is>; from "Eli Zaretskii" at Jan 8, 98 10:47 am
Reply-To: andrewc AT rosemail DOT rose DOT hp DOT com

> > The only downside to it is that it requires crt1.c to be compiled
> > with -mstack-align-double enabled as well

> Could you please explain why -mstack-align-double is necessary when
> compiling crt1.c?
-mstack-align-double is similar in function to -malign-double
(which is documented in the submodel-options for the i386).  
Its purpose is to keep the stack aligned on a double boundary.
This gives a big speedup when passing long long ints or 
floating point doubles as arguments to functions (any 64 bit value).  
The catch with using -mstack-align-double though is that it must 
be enabled in all of the modules, especially anything that is 
called before main.  
If you didn't recompile crt1.c with it enabled, 
then __crt_startup would not preserve the double alignment of 
the stack before the call to main, and you would get whatever alignment
the combination of local variables and arguments dictated.

But - since this would only affect pgcc users, and the first thing
they are instructed to do in the readme is to download the dj
sources and rebuild, I don't see this being a problem.  If the
fix was put in crt1.c then people would not have to recompile any of
the startup code, but no big deal as far as I am concerned.

Andy

--
_______       ___________________________________________________________
           /                       	                  Andrew Crabtree 
          /                          	      Workgroup Networks Division 
         ____       ___  /                                Hewlett-Packard 
        /     /    /    /   		                    Roseville, CA 
     __/   __/    _____/                                     916/785-1675
                 /                           andrewc AT rosemail DOT rose DOT hp DOT com
___________   __/   _____________________________________________________

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019