This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: x86 stack alignment redux


>   > 1997-11-13  Dave Love  <d.love@dl.ac.uk>
>   > 
>   > 	* config/i386/linux.h (STACK_BOUNDARY): Define as 64 for glibc2.
>   > 	* config/i386/gnu.h (STACK_BOUNDARY): Define as 64.
> I installed this.

I don't think it is a good idea. Please check out Marc's patch.

> 
> However, I'm a little worried about things breaking if we happen to mix
> code compiled with an old compiler (say egcs-1.0 or gcc-2.7) with code
> which assumes a 64bit stack boundary.  Isn't this change going to break
> that case, or does the prologue/epilogue code for older compilers always
> allocate 64bit hunks?
> 

pcg@goof.com (Marc Lehmann) and I have discussed it a few months ago.
There are several alignments. We should enable those which won't
break old binaries by default. We only enable those which are not
compatible with old binaries when asked for. Please check the egcs
mail archive. I have forwarded Marc's patch to egcs at the beginning.

I am enclosing the ChangeLog here:

Thu Aug  7 22:30:59 1997  Marc Lehmann  <pcg@goof.com>

        * i386.c (ix86_sp_offset, ix86_frame_size): New function.
        (function_prologue, ix86_expand_prologue, ix86_expand_epilogue):
        use ix86_frame_size () instead of get_frame_size ().
        * i386.h (MASK_STACK_ALIGN_DOUBLE, MASK_ARG_ALIGN_DOUBLE,
        TARGET_STACK_ALIGN_DOUBLE, TARGET_ARG_ALIGN_DOUBLE):
        new defines.
        (TARGET_SWITCHES): new switches -m[no-]stack-align-double,
        -m[no]-arg-align-double, -mall-align-double.  -mstack-align-double
        enabled by default.
        (FUNCTION_ARG_BOUNDARY): align DFmode and XFmode arguments
        to 64 bit when -marg-align-double.
        (STACK_BOUNDARY, BIGGEST_ALIGNMENT): set to 64 if double-alignment
        requested.
        (INITIAL_ELIMINATION_OFFSET): use ix86_sp_offset () instead
        of get_frame_size ().
 


-- 
H.J. Lu (hjl@gnu.org)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]