From: H.J. Lu Date: Mon, 6 Jul 2015 11:50:47 +0000 (+0000) Subject: Allow -mincoming-stack-boundary=3 with -mno-sse X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec1590f2571ecf093de855ed2c9c1383320063a1;p=gcc.git Allow -mincoming-stack-boundary=3 with -mno-sse 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 08c1b674b2e..2319b0dca4c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-07-06 H.J. Lu + + 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 * read-md.c (decimal_string): Rename to ... diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7d26e8c2bd0..0a5dfd3554d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1f328c7a383..a0324b50e5a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-07-06 H.J. Lu + + 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 * 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 index 00000000000..d140bdadead --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr53383-1.c @@ -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 index 00000000000..a1b8e418789 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr53383-2.c @@ -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 index 00000000000..e5d3a5b0638 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr53383-3.c @@ -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; +}