delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/01/06/18:40:15

From: Andrew Crabtree <andrewc AT typhoon DOT rose DOT hp DOT com>
Message-Id: <199801062338.AA076439918@typhoon.rose.hp.com>
Subject: Stack Alignment
To: djgpp-workers AT delorie DOT com
Date: Tue, 06 Jan 1998 15:38:37 PST
Reply-To: andrewc AT rosemail DOT rose DOT hp DOT com

Hi Guys - 

I can't remember if I ever sent this in or not.  Way back when (maybe 
a year ago), I figured out that the stack wasn't being aligned before the 
call to main.  Well it used to be that you had to manually tell 
pgcc that you wanted it to keep the stack double word aligned (using 
-mstack-align-double) for maximum floating point performance.  
Now however, with the egcs 1.0 and pgcc 1.0
release it apparantly defaults to -mstack-align-double, which is 
bad news if the stack isn't aligned properly (just performance-wise bad
news).  I don't have a patch file handy but it was a 1 line 
fix in crt1.c to add a line that said 'andl $0xFFFFFFF8,%%esp' to
properly align stack before calling main.  I can't think of any 
downside to doing this, other than possibly buring a couple of 
bytes of stack space.  Let me know if I forgot this originally and 
a patch file is needed or if it was not accepted for whatever reason.

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