Allow -mincoming-stack-boundary=3 with -mno-sse
authorH.J. Lu <hongjiu.lu@intel.com>
Mon, 6 Jul 2015 11:50:47 +0000 (11:50 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 6 Jul 2015 11:50:47 +0000 (04:50 -0700)
Similar to -mpreferred-stack-boundary=3, -mincoming-stack-boundary=3 is
allowed with -mno-sse in 64-bit mode.

gcc/

PR target/53383
* config/i386/i386.c (ix86_option_override_internal): Allow
-mincoming-stack-boundary=3 for 64-bit if SSE is disabled.

gcc/testsuite/

PR target/53383
* gcc.target/i386/pr53383-1.c: New file.
* gcc.target/i386/pr53383-2.c: Likewise.
* gcc.target/i386/pr53383-3.c: Likewise.

From-SVN: r225452

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr53383-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr53383-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr53383-3.c [new file with mode: 0644]

index 08c1b674b2ee2cedd728ffef80b2f64608686fe6..2319b0dca4cca8652ec23775f07c349f104f7f2f 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/53383
+       * config/i386/i386.c (ix86_option_override_internal): Allow
+       -mincoming-stack-boundary=3 for 64-bit if SSE is disabled.
+
 2015-07-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * read-md.c (decimal_string): Rename to ...
index 7d26e8c2bd00df18fc916619615d605ec85e59e2..0a5dfd3554ddd95cab0ab6207247ca9efa133d69 100644 (file)
@@ -4085,12 +4085,13 @@ ix86_option_override_internal (bool main_args_p,
   ix86_incoming_stack_boundary = ix86_default_incoming_stack_boundary;
   if (opts_set->x_ix86_incoming_stack_boundary_arg)
     {
-      if (opts->x_ix86_incoming_stack_boundary_arg
-         < (TARGET_64BIT_P (opts->x_ix86_isa_flags) ? 4 : 2)
+      int min = (TARGET_64BIT_P (opts->x_ix86_isa_flags)
+                ? (TARGET_SSE_P (opts->x_ix86_isa_flags) ? 4 : 3) : 2);
+
+      if (opts->x_ix86_incoming_stack_boundary_arg < min
          || opts->x_ix86_incoming_stack_boundary_arg > 12)
        error ("-mincoming-stack-boundary=%d is not between %d and 12",
-              opts->x_ix86_incoming_stack_boundary_arg,
-              TARGET_64BIT_P (opts->x_ix86_isa_flags) ? 4 : 2);
+              opts->x_ix86_incoming_stack_boundary_arg, min);
       else
        {
          ix86_user_incoming_stack_boundary
index 1f328c7a383176de7ca51b9c3930c80f85c9ac19..a0324b50e5abf2c298294dcfb23b7760c8162efc 100644 (file)
@@ -1,3 +1,10 @@
+2015-07-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/53383
+       * gcc.target/i386/pr53383-1.c: New file.
+       * gcc.target/i386/pr53383-2.c: Likewise.
+       * gcc.target/i386/pr53383-3.c: Likewise.
+
 2015-07-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
        * gcc.target/aarch64/fnmul-1.c: New.
diff --git a/gcc/testsuite/gcc.target/i386/pr53383-1.c b/gcc/testsuite/gcc.target/i386/pr53383-1.c
new file mode 100644 (file)
index 0000000..d140bda
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mno-sse -mpreferred-stack-boundary=3" } */
+
+int
+bar (int x)
+{
+  return x + 9;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr53383-2.c b/gcc/testsuite/gcc.target/i386/pr53383-2.c
new file mode 100644 (file)
index 0000000..a1b8e41
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mno-sse -mpreferred-stack-boundary=3 -mincoming-stack-boundary=3" } */
+
+int
+bar (int x)
+{
+  return x + 9;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr53383-3.c b/gcc/testsuite/gcc.target/i386/pr53383-3.c
new file mode 100644 (file)
index 0000000..e5d3a5b
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mno-sse -mincoming-stack-boundary=3 -mpreferred-stack-boundary=3" } */
+
+int
+bar (int x)
+{
+  return x + 9;
+}