+2012-06-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ 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 <wschmidt@linux.ibm.com>
* double-int.c (double_int_multiple_of): New function.
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
#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. */
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