diff options
author | Stuart Hastings <stuart@apple.com> | 2006-05-18 00:34:44 +0000 |
---|---|---|
committer | Stuart Hastings <stuart@gcc.gnu.org> | 2006-05-18 00:34:44 +0000 |
commit | 339329463663199b22e18901d101b680979c980e (patch) | |
tree | 76255841987be3306d958753a8feba9aea4e6b6e /gcc/doc | |
parent | 71abbf1620f10d59cd6afcbf56b47f2f488ff1bf (diff) | |
download | gcc-339329463663199b22e18901d101b680979c980e.zip gcc-339329463663199b22e18901d101b680979c980e.tar.gz gcc-339329463663199b22e18901d101b680979c980e.tar.bz2 |
i386.opt (-mstackrealign): New flag.
* gcc/config/i386/i386.opt (-mstackrealign): New flag. *
gcc/config/i386/i386.c (force_align_arg_pointer): New attribute.
(ix86_handle_cconv_attribute): Emit error when
force_align_arg_pointer attribute collides with too many regparms.
(ix86_function_regparm): Limit regparms when used with
force_align_arg_pointer attribute. (ix86_internal_arg_pointer):
Support stack-realigning prologue in non-main functions. Emit
warning for nested functions under -mstackrealign, emit error for
nested functions with force_align_arg_pointer attribute.
* gcc/doc/extend.texi (force_align_arg_pointer): Document it.
* gcc/doc/invoke.texi (-mstackrealign): Document it.
* testsuite/gcc.target/i386/20060512-1.c: New.
* testsuite/gcc.target/i386/20060512-2.c: New.
* testsuite/gcc.target/i386/20060512-3.c: New.
* testsuite/gcc.target/i386/20060512-4.c: New.
From-SVN: r113880
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/extend.texi | 14 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 16 |
2 files changed, 30 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index a72fb7f..a281f92 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2207,6 +2207,20 @@ SSE registers instead of on the stack. Functions that take a variable number of arguments will continue to pass all of their floating point arguments on the stack. +@item force_align_arg_pointer +@cindex @code{force_align_arg_pointer} attribute +On the Intel x86, the @code{force_align_arg_pointer} attribute may be +applied to individual function definitions, generating an alternate +prologue and epilogue that realigns the runtime stack. This supports +mixing legacy codes that run with a 4-byte aligned stack with modern +codes that keep a 16-byte stack for SSE compatibility. The alternate +prologue and epilogue are slower and bigger than the regular ones, and +the alternate prologue requires a scratch register; this lowers the +number of registers available if used in conjunction with the +@code{regparm} attribute. The @code{force_align_arg_pointer} +attribute is incompatible with nested functions; this is considered a +hard error. + @item returns_twice @cindex @code{returns_twice} attribute The @code{returns_twice} attribute tells the compiler that a function may diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index df6074c..9ac49e9 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -537,6 +537,7 @@ Objective-C and Objective-C++ Dialects}. -mthreads -mno-align-stringops -minline-all-stringops @gol -mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol -m96bit-long-double -mregparm=@var{num} -msseregparm @gol +-mstackrealign @gol -momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs @gol -mcmodel=@var{code-model} @gol -m32 -m64 -mlarge-data-threshold=@var{num}} @@ -9464,6 +9465,21 @@ function by using the function attribute @samp{sseregparm}. modules with the same value, including any libraries. This includes the system libraries and startup modules. +@item -mstackrealign +@opindex mstackrealign +Realign the stack at entry. On the Intel x86, the +@option{-mstackrealign} option will generate an alternate prologue and +epilogue that realigns the runtime stack. This supports mixing legacy +codes that keep a 4-byte aligned stack with modern codes that keep a +16-byte stack for SSE compatibility. The alternate prologue and +epilogue are slower and bigger than the regular ones, and the +alternate prologue requires an extra scratch register; this lowers the +number of registers available if used in conjunction with the +@code{regparm} attribute. The @option{-mstackrealign} option is +incompatible with the nested function prologue; this is considered a +hard error. See also the attribute @code{force_align_arg_pointer}, +applicable to individual functions. + @item -mpreferred-stack-boundary=@var{num} @opindex mpreferred-stack-boundary Attempt to keep the stack boundary aligned to a 2 raised to @var{num} |