diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2014-02-19 16:53:59 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2014-02-19 16:53:59 +0100 |
commit | 6aa5b4b87e30d82f34088b9c47a3542ca6c2e438 (patch) | |
tree | 6bb87e4078fc1b673d61b83334e93f11e2d57f4f | |
parent | 7531103aca20f63de3353cccca66b55cb10eda81 (diff) | |
download | gcc-6aa5b4b87e30d82f34088b9c47a3542ca6c2e438.zip gcc-6aa5b4b87e30d82f34088b9c47a3542ca6c2e438.tar.gz gcc-6aa5b4b87e30d82f34088b9c47a3542ca6c2e438.tar.bz2 |
re PR target/59794 (i386 backend fails to detect MMX/SSE/AVX ABI changes)
PR target/59794
* config/i386/i386.c (type_natural_mode): Warn for ABI changes
only when -Wpsabi is enabled.
testsuite/ChangeLog:
PR target/59794
* gcc.target/i386/pr39162.c: Add dg-prune-output.
(dg-options): Remove -Wno-psabi.
* gcc.target/i386/59794-2.c: Ditto.
* gcc.target/i386/60205-1.c: Ditto.
* gcc.target/i386/sse-5.c: Ditto.
From-SVN: r207910
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 82 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr39162.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr59794-2.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr59794-3.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr60205-1.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/sse-5.c | 3 |
8 files changed, 62 insertions, 53 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5007b7a..5000f33 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-02-19 Uros Bizjak <ubizjak@gmail.com> + + PR target/59794 + * config/i386/i386.c (type_natural_mode): Warn for ABI changes + only when -Wpsabi is enabled. + 2014-02-19 Michael Hudson-Doyle <michael.hudson@linaro.org> PR target/59799 @@ -43,8 +49,7 @@ (compute_complex_ancestor_jump_func): Likewise. (update_jump_functions_after_inlining): Fix updating of ancestor function. - * ipa-cp.c (ipa_get_jf_ancestor_result): Be ready for type - to be NULL. + * ipa-cp.c (ipa_get_jf_ancestor_result): Be ready for type to be NULL. 2014-02-18 Jan Hubicka <hubicka@ucw.cz> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index acfc021..0d30eb0 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6155,10 +6155,10 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ cum->nregs = 0; cum->sse_nregs = 0; cum->mmx_nregs = 0; - cum->warn_avx512f = 0; - cum->warn_avx = 0; - cum->warn_sse = 0; - cum->warn_mmx = 0; + cum->warn_avx512f = false; + cum->warn_avx = false; + cum->warn_sse = false; + cum->warn_mmx = false; return; } @@ -6234,19 +6234,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum, static bool warnedavx512f; static bool warnedavx512f_ret; - if (cum - && !warnedavx512f - && cum->warn_avx512f) + if (cum && cum->warn_avx512f && !warnedavx512f) { - warnedavx512f = true; - warning (0, "AVX512F vector argument without AVX512F " - "enabled changes the ABI"); + if (warning (OPT_Wpsabi, "AVX512F vector argument " + "without AVX512F enabled changes the ABI")) + warnedavx512f = true; } - else if (in_return & !warnedavx512f_ret) + else if (in_return && !warnedavx512f_ret) { - warnedavx512f_ret = true; - warning (0, "AVX512F vector return without AVX512F " - "enabled changes the ABI"); + if (warning (OPT_Wpsabi, "AVX512F vector return " + "without AVX512F enabled changes the ABI")) + warnedavx512f_ret = true; } return TYPE_MODE (type); @@ -6256,19 +6254,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum, static bool warnedavx; static bool warnedavx_ret; - if (cum - && !warnedavx - && cum->warn_avx) + if (cum && cum->warn_avx && !warnedavx) { - warnedavx = true; - warning (0, "AVX vector argument without AVX " - "enabled changes the ABI"); + if (warning (OPT_Wpsabi, "AVX vector argument " + "without AVX enabled changes the ABI")) + warnedavx = true; } - else if (in_return & !warnedavx_ret) + else if (in_return && !warnedavx_ret) { - warnedavx_ret = true; - warning (0, "AVX vector return without AVX " - "enabled changes the ABI"); + if (warning (OPT_Wpsabi, "AVX vector return " + "without AVX enabled changes the ABI")) + warnedavx_ret = true; } return TYPE_MODE (type); @@ -6279,21 +6275,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum, static bool warnedsse; static bool warnedsse_ret; - if (cum - && !warnedsse - && cum->warn_sse) + if (cum && cum->warn_sse && !warnedsse) { - warnedsse = true; - warning (0, "SSE vector argument without SSE " - "enabled changes the ABI"); + if (warning (OPT_Wpsabi, "SSE vector argument " + "without SSE enabled changes the ABI")) + warnedsse = true; } - else if (!TARGET_64BIT - && in_return - & !warnedsse_ret) + else if (!TARGET_64BIT && in_return && !warnedsse_ret) { - warnedsse_ret = true; - warning (0, "SSE vector return without SSE " - "enabled changes the ABI"); + if (warning (OPT_Wpsabi, "SSE vector return " + "without SSE enabled changes the ABI")) + warnedsse_ret = true; } } else if ((size == 8 && !TARGET_64BIT) && !TARGET_MMX) @@ -6301,19 +6293,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum, static bool warnedmmx; static bool warnedmmx_ret; - if (cum - && !warnedmmx - && cum->warn_mmx) + if (cum && cum->warn_mmx && !warnedmmx) { - warnedmmx = true; - warning (0, "MMX vector argument without MMX " - "enabled changes the ABI"); + if (warning (OPT_Wpsabi, "MMX vector argument " + "without MMX enabled changes the ABI")) + warnedmmx = true; } - else if (in_return & !warnedmmx_ret) + else if (in_return && !warnedmmx_ret) { - warnedmmx_ret = true; - warning (0, "MMX vector return without MMX " - "enabled changes the ABI"); + if (warning (OPT_Wpsabi, "MMX vector return " + "without MMX enabled changes the ABI")) + warnedmmx_ret = true; } } return mode; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1e4e6ab..3cf924b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2014-02-19 Uros Bizjak <ubizjak@gmail.com> + + PR target/59794 + * gcc.target/i386/pr39162.c: Add dg-prune-output. + (dg-options): Remove -Wno-psabi. + * gcc.target/i386/59794-2.c: Ditto. + * gcc.target/i386/60205-1.c: Ditto. + * gcc.target/i386/sse-5.c: Ditto. + 2014-02-18 Nick Clifton <nickc@redhat.com> * gcc.dg/graphite/pr46966.c: Only run on 32-bit+ targets. diff --git a/gcc/testsuite/gcc.target/i386/pr39162.c b/gcc/testsuite/gcc.target/i386/pr39162.c index 94f3910..efb46de 100644 --- a/gcc/testsuite/gcc.target/i386/pr39162.c +++ b/gcc/testsuite/gcc.target/i386/pr39162.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -Wno-psabi -msse2 -mno-avx" } */ +/* { dg-prune-output "ABI for passing parameters" } */ +/* { dg-options "-O2 -msse2 -mno-avx" } */ /* { dg-additional-options "-mabi=sysv" { target x86_64-*-mingw* } } */ typedef long long __m256i __attribute__ ((__vector_size__ (32), __may_alias__)); diff --git a/gcc/testsuite/gcc.target/i386/pr59794-2.c b/gcc/testsuite/gcc.target/i386/pr59794-2.c index ce30346..f139982 100644 --- a/gcc/testsuite/gcc.target/i386/pr59794-2.c +++ b/gcc/testsuite/gcc.target/i386/pr59794-2.c @@ -1,5 +1,6 @@ /* PR target/59794 */ -/* { dg-options "-Wno-psabi -O2 -mno-sse" } */ +/* { dg-prune-output "ABI for passing parameters" } */ +/* { dg-options "-O2 -mno-sse" } */ /* { dg-skip-if "no SSE vector" { *-*-mingw* } } */ typedef double __v2df __attribute__ ((__vector_size__ (16))); diff --git a/gcc/testsuite/gcc.target/i386/pr59794-3.c b/gcc/testsuite/gcc.target/i386/pr59794-3.c index deaf676..a65893c 100644 --- a/gcc/testsuite/gcc.target/i386/pr59794-3.c +++ b/gcc/testsuite/gcc.target/i386/pr59794-3.c @@ -1,5 +1,6 @@ /* PR target/59794 */ -/* { dg-options "-O2 -mno-avx -Wno-psabi" } */ +/* { dg-prune-output "ABI for passing parameters" } */ +/* { dg-options "-O2 -mno-avx" } */ /* { dg-skip-if "no AVX vector" { *-*-mingw* } } */ typedef int __v8si __attribute__ ((__vector_size__ (32))); diff --git a/gcc/testsuite/gcc.target/i386/pr60205-1.c b/gcc/testsuite/gcc.target/i386/pr60205-1.c index 9ae1212..259959a 100644 --- a/gcc/testsuite/gcc.target/i386/pr60205-1.c +++ b/gcc/testsuite/gcc.target/i386/pr60205-1.c @@ -1,5 +1,6 @@ /* PR target/60205 */ -/* { dg-options "-O2 -mno-avx512f -Wno-psabi" } */ +/* { dg-prune-output "ABI for passing parameters" } */ +/* { dg-options "-O2 -mno-avx512f" } */ /* { dg-skip-if "no AVX512F vector" { *-*-mingw* } } */ typedef int __v16si __attribute__ ((__vector_size__ (64))); diff --git a/gcc/testsuite/gcc.target/i386/sse-5.c b/gcc/testsuite/gcc.target/i386/sse-5.c index af935c2..8f5d9bc 100644 --- a/gcc/testsuite/gcc.target/i386/sse-5.c +++ b/gcc/testsuite/gcc.target/i386/sse-5.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target ia32 } */ -/* { dg-options "-Winline -Wno-psabi -O2 -mno-sse" } */ +/* { dg-prune-output "ABI for passing parameters" } */ +/* { dg-options "-Winline -O2 -mno-sse" } */ typedef double v2df __attribute__ ((vector_size (16))); v2df p; |