Allow -mpreferred-stack-boundary=3 on x86-64
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 22 Jun 2012 17:10:58 +0000 (17:10 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 22 Jun 2012 17:10:58 +0000 (10:10 -0700)
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

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/doc/invoke.texi

index fc34120de2473cb1e5c44d408aeb591600fbd4fd..6ea4ed38a9bf1a7ee9a3cb671afc78c1c54e5454 100644 (file)
@@ -1,3 +1,14 @@
+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.
index 0dc08f3aa3abeffb0ffca90ee1ebd47da19a59a4..81677702772ab8fe1ab341ba42e857f99bbe9125 100644 (file)
@@ -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
index ddb36459e931f79345cf67cbcdb5953a11684e06..f7f13d20cdcb91c48fb17b201fedd55cb597fd53 100644 (file)
@@ -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.  */
index 387d6922f89f06bcca5a1104932a638b5901fc80..029a7ab0ad2e3316f12e1251724c42a7c746c70f 100644 (file)
@@ -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