From: H.J. Lu Date: Fri, 22 Jun 2012 17:10:58 +0000 (+0000) Subject: Allow -mpreferred-stack-boundary=3 on x86-64 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5bfb2af2774b43dc6cfd9a28b59a86a41d92e835;p=gcc.git Allow -mpreferred-stack-boundary=3 on x86-64 PR target/53383 * doc/invoke.texi: Add a warning for -mpreferred-stack-boundary=3. * config/i386/i386.c (ix86_option_override_internal): Allow -mpreferred-stack-boundary=3 for 64-bit if SSE is disabled. * config/i386/i386.h (MIN_STACK_BOUNDARY): Set to 64 for 64-bit if SSE is disabled. From-SVN: r188893 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fc34120de24..6ea4ed38a9b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2012-06-22 H.J. Lu + + PR target/53383 + * doc/invoke.texi: Add a warning for -mpreferred-stack-boundary=3. + + * config/i386/i386.c (ix86_option_override_internal): Allow + -mpreferred-stack-boundary=3 for 64-bit if SSE is disabled. + + * config/i386/i386.h (MIN_STACK_BOUNDARY): Set to 64 for 64-bit + if SSE is disabled. + 2012-06-22 Bill Schmidt * double-int.c (double_int_multiple_of): New function. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0dc08f3aa3a..81677702772 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3664,7 +3664,7 @@ ix86_option_override_internal (bool main_args_p) ix86_preferred_stack_boundary = PREFERRED_STACK_BOUNDARY_DEFAULT; if (global_options_set.x_ix86_preferred_stack_boundary_arg) { - int min = (TARGET_64BIT ? 4 : 2); + int min = (TARGET_64BIT ? (TARGET_SSE ? 4 : 3) : 2); int max = (TARGET_SEH ? 4 : 12); if (ix86_preferred_stack_boundary_arg < min diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index ddb36459e93..f7f13d20cdc 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -708,7 +708,7 @@ enum target_cpu_default #define MAIN_STACK_BOUNDARY (TARGET_64BIT ? 128 : 32) /* Minimum stack boundary. */ -#define MIN_STACK_BOUNDARY (TARGET_64BIT ? 128 : 32) +#define MIN_STACK_BOUNDARY (TARGET_64BIT ? (TARGET_SSE ? 128 : 64) : 32) /* Boundary (in *bits*) on which the stack pointer prefers to be aligned; the compiler cannot rely on having this alignment. */ diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 387d6922f89..029a7ab0ad2 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -13577,6 +13577,12 @@ Attempt to keep the stack boundary aligned to a 2 raised to @var{num} byte boundary. If @option{-mpreferred-stack-boundary} is not specified, the default is 4 (16 bytes or 128 bits). +@strong{Warning:} When generating code for the x86-64 architecture with +SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be +used to keep the stack boundary aligned to 8 byte boundary. You must +build all modules with @option{-mpreferred-stack-boundary=3}, including +any libraries. This includes the system libraries and startup modules. + @item -mincoming-stack-boundary=@var{num} @opindex mincoming-stack-boundary Assume the incoming stack is aligned to a 2 raised to @var{num} byte