Commit 6aa5b4b8 by Uros Bizjak

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
parent 7531103a
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> 2014-02-19 Michael Hudson-Doyle <michael.hudson@linaro.org>
PR target/59799 PR target/59799
...@@ -43,8 +49,7 @@ ...@@ -43,8 +49,7 @@
(compute_complex_ancestor_jump_func): Likewise. (compute_complex_ancestor_jump_func): Likewise.
(update_jump_functions_after_inlining): Fix updating of (update_jump_functions_after_inlining): Fix updating of
ancestor function. ancestor function.
* ipa-cp.c (ipa_get_jf_ancestor_result): Be ready for type * ipa-cp.c (ipa_get_jf_ancestor_result): Be ready for type to be NULL.
to be NULL.
2014-02-18 Jan Hubicka <hubicka@ucw.cz> 2014-02-18 Jan Hubicka <hubicka@ucw.cz>
......
...@@ -6155,10 +6155,10 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ ...@@ -6155,10 +6155,10 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
cum->nregs = 0; cum->nregs = 0;
cum->sse_nregs = 0; cum->sse_nregs = 0;
cum->mmx_nregs = 0; cum->mmx_nregs = 0;
cum->warn_avx512f = 0; cum->warn_avx512f = false;
cum->warn_avx = 0; cum->warn_avx = false;
cum->warn_sse = 0; cum->warn_sse = false;
cum->warn_mmx = 0; cum->warn_mmx = false;
return; return;
} }
...@@ -6234,19 +6234,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum, ...@@ -6234,19 +6234,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum,
static bool warnedavx512f; static bool warnedavx512f;
static bool warnedavx512f_ret; static bool warnedavx512f_ret;
if (cum if (cum && cum->warn_avx512f && !warnedavx512f)
&& !warnedavx512f
&& cum->warn_avx512f)
{ {
warnedavx512f = true; if (warning (OPT_Wpsabi, "AVX512F vector argument "
warning (0, "AVX512F vector argument without AVX512F " "without AVX512F enabled changes the ABI"))
"enabled changes the ABI"); warnedavx512f = true;
} }
else if (in_return & !warnedavx512f_ret) else if (in_return && !warnedavx512f_ret)
{ {
warnedavx512f_ret = true; if (warning (OPT_Wpsabi, "AVX512F vector return "
warning (0, "AVX512F vector return without AVX512F " "without AVX512F enabled changes the ABI"))
"enabled changes the ABI"); warnedavx512f_ret = true;
} }
return TYPE_MODE (type); return TYPE_MODE (type);
...@@ -6256,19 +6254,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum, ...@@ -6256,19 +6254,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum,
static bool warnedavx; static bool warnedavx;
static bool warnedavx_ret; static bool warnedavx_ret;
if (cum if (cum && cum->warn_avx && !warnedavx)
&& !warnedavx
&& cum->warn_avx)
{ {
warnedavx = true; if (warning (OPT_Wpsabi, "AVX vector argument "
warning (0, "AVX vector argument without AVX " "without AVX enabled changes the ABI"))
"enabled changes the ABI"); warnedavx = true;
} }
else if (in_return & !warnedavx_ret) else if (in_return && !warnedavx_ret)
{ {
warnedavx_ret = true; if (warning (OPT_Wpsabi, "AVX vector return "
warning (0, "AVX vector return without AVX " "without AVX enabled changes the ABI"))
"enabled changes the ABI"); warnedavx_ret = true;
} }
return TYPE_MODE (type); return TYPE_MODE (type);
...@@ -6279,21 +6275,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum, ...@@ -6279,21 +6275,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum,
static bool warnedsse; static bool warnedsse;
static bool warnedsse_ret; static bool warnedsse_ret;
if (cum if (cum && cum->warn_sse && !warnedsse)
&& !warnedsse
&& cum->warn_sse)
{ {
warnedsse = true; if (warning (OPT_Wpsabi, "SSE vector argument "
warning (0, "SSE vector argument without SSE " "without SSE enabled changes the ABI"))
"enabled changes the ABI"); warnedsse = true;
} }
else if (!TARGET_64BIT else if (!TARGET_64BIT && in_return && !warnedsse_ret)
&& in_return
& !warnedsse_ret)
{ {
warnedsse_ret = true; if (warning (OPT_Wpsabi, "SSE vector return "
warning (0, "SSE vector return without SSE " "without SSE enabled changes the ABI"))
"enabled changes the ABI"); warnedsse_ret = true;
} }
} }
else if ((size == 8 && !TARGET_64BIT) && !TARGET_MMX) else if ((size == 8 && !TARGET_64BIT) && !TARGET_MMX)
...@@ -6301,19 +6293,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum, ...@@ -6301,19 +6293,17 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum,
static bool warnedmmx; static bool warnedmmx;
static bool warnedmmx_ret; static bool warnedmmx_ret;
if (cum if (cum && cum->warn_mmx && !warnedmmx)
&& !warnedmmx
&& cum->warn_mmx)
{ {
warnedmmx = true; if (warning (OPT_Wpsabi, "MMX vector argument "
warning (0, "MMX vector argument without MMX " "without MMX enabled changes the ABI"))
"enabled changes the ABI"); warnedmmx = true;
} }
else if (in_return & !warnedmmx_ret) else if (in_return && !warnedmmx_ret)
{ {
warnedmmx_ret = true; if (warning (OPT_Wpsabi, "MMX vector return "
warning (0, "MMX vector return without MMX " "without MMX enabled changes the ABI"))
"enabled changes the ABI"); warnedmmx_ret = true;
} }
} }
return mode; return mode;
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> 2014-02-18 Nick Clifton <nickc@redhat.com>
* gcc.dg/graphite/pr46966.c: Only run on 32-bit+ targets. * gcc.dg/graphite/pr46966.c: Only run on 32-bit+ targets.
......
/* { dg-do compile } */ /* { 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* } } */ /* { dg-additional-options "-mabi=sysv" { target x86_64-*-mingw* } } */
typedef long long __m256i __attribute__ ((__vector_size__ (32), __may_alias__)); typedef long long __m256i __attribute__ ((__vector_size__ (32), __may_alias__));
......
/* PR target/59794 */ /* 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* } } */ /* { dg-skip-if "no SSE vector" { *-*-mingw* } } */
typedef double __v2df __attribute__ ((__vector_size__ (16))); typedef double __v2df __attribute__ ((__vector_size__ (16)));
......
/* PR target/59794 */ /* 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* } } */ /* { dg-skip-if "no AVX vector" { *-*-mingw* } } */
typedef int __v8si __attribute__ ((__vector_size__ (32))); typedef int __v8si __attribute__ ((__vector_size__ (32)));
......
/* PR target/60205 */ /* 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* } } */ /* { dg-skip-if "no AVX512F vector" { *-*-mingw* } } */
typedef int __v16si __attribute__ ((__vector_size__ (64))); typedef int __v16si __attribute__ ((__vector_size__ (64)));
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-require-effective-target ia32 } */ /* { 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))); typedef double v2df __attribute__ ((vector_size (16)));
v2df p; v2df p;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment