aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2012-06-22 17:10:58 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2012-06-22 10:10:58 -0700
commit5bfb2af2774b43dc6cfd9a28b59a86a41d92e835 (patch)
tree0003aa8aaa6d843a98cf3a0c9c56d2d6c8773942 /gcc
parent7735d6c72eba0eebcabb4613e893b35c874e7091 (diff)
downloadgcc-5bfb2af2774b43dc6cfd9a28b59a86a41d92e835.zip
gcc-5bfb2af2774b43dc6cfd9a28b59a86a41d92e835.tar.gz
gcc-5bfb2af2774b43dc6cfd9a28b59a86a41d92e835.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/i386/i386.c2
-rw-r--r--gcc/config/i386/i386.h2
-rw-r--r--gcc/doc/invoke.texi6
4 files changed, 19 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fc34120..6ea4ed3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 0dc08f3..8167770 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 ddb3645..f7f13d2 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 387d692..029a7ab 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