Responding to: http://gcc.gnu.org/ml/gcc-patches/2006-04/msg00539.html
Patch history URL: http://gcc.gnu.org/ml/gcc-patches/2006-03/
On Apr 14, 2006, at 11:26 AM, Richard Henderson wrote:
On Mon, Apr 03, 2006 at 09:27:58AM -0700, Stuart Hastings wrote:
(1) I don't think your handling of regparm interaction is correct.
You should be generating an error for functions with 3 regparm
parameters, and the attribute set.
(2) You can choose *any* register that's free on function entry
and function exit. So a nested function returning void and no
regparm could choose either eax or edx. The register is *not*
handled like the pic register and reserved for the life of the
function -- your documentation is incorrect on that score.
(3) I'm not sure of the utility of the command line option. Since
this isn't an alternate entry point, but rather an alternate
prologue, the overhead for compiling all functions with this could
I agree, but my customer /asked/ for the commandline option, and is
currently relying upon it.
Bootstrapped, DejaGnu on Darwin/x86, no regressions.
2006-05-12 Stuart Hastings <stuart@xxxxxxxxx>
* 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
(ix86_function_regparm): Limit regparms when used with
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.
Description: Text document
O.K? (If O.K., where?)