This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Stack alignment for Solaris x86
- To: gcc-patches at gcc dot gnu dot org
- Subject: Stack alignment for Solaris x86
- From: Mathias Froehlich <frohlich at na dot uni-tuebingen dot de>
- Date: Fri, 30 Jul 1999 15:13:26 +0200 (MET DST)
Hi EGCS Hackers ...
I use gcc on Solaris_x86. On Solaris main is not called with an
aligned stackpointer. I have reported that some time ago.
(http://egcs.cygnus.com/ml/gcc-bugs/1999-07/msg00522.html)
Now I had the time to fix that. This patch leads to correctly aligned
doubles into the stack frame. I have included this patch below.
Regards,
Mathias Froehlich
-----------------------------------------------------------------------------
diff -Nrc3p egcs-19990718/gcc/config/i386/sol2-c1.asm egcs-19990718-x86/gcc/config/i386/sol2-c1.asm
*** egcs-19990718/gcc/config/i386/sol2-c1.asm Wed Dec 16 22:04:08 1998
--- egcs-19990718-x86/gcc/config/i386/sol2-c1.asm Thu Jul 15 11:05:17 1999
*************** _start:
*** 115,120 ****
--- 115,126 ----
! is the argument vector pointer, which is at a fixed address off
! the initial frame pointer.
+ !
+ ! Make sure the stack ist propper aligned
+ !
+ andl $0xfffffff0,%esp
+ subl $4,%esp
+
pushl %edx
leal 12(%ebp),%edx
pushl %edx
diff -Nrc3p egcs-19990718/gcc/config/i386/sol2-gc1.asm egcs-19990718-x86/gcc/config/i386/sol2-gc1.asm
*** egcs-19990718/gcc/config/i386/sol2-gc1.asm Wed Dec 16 22:04:12 1998
--- egcs-19990718-x86/gcc/config/i386/sol2-gc1.asm Thu Jul 15 11:05:17 1999
*************** _start:
*** 128,133 ****
--- 128,139 ----
! is the argument vector pointer, which is at a fixed address off
! the initial frame pointer.
+ !
+ ! Make sure the stack ist propper aligned
+ !
+ andl $0xfffffff0,%esp
+ subl $4,%esp
+
pushl %edx
leal 12(%ebp),%edx
pushl %edx
-----------------------------------------------------------------------------
--
Mathias Fr"ohlich e-mail: frohlich@na.uni-tuebingen.de
Institut f"ur Mathematik, Universit"at T"ubingen, D-72076 T"ubingen