Hello!
Also use boolean AND instead of bitwise AND in a couple of places.
2014-02-18 Uros Bizjak <[email protected]>
PR target/59794
* config/i386/i386.c (type_natural_mode): Warn for ABI changes
only when -Wpsabi is enabled.
testsuite/ChangeLog:
2014-02-18 Uros Bizjak <[email protected]>
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.
Tested on x86_64-pc-linux-gnu {,-m32}, will commit tomorrow to
mainline SVN and 4.8 branch.
Uros.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 207851)
+++ config/i386/i386.c (working copy)
@@ -6155,10 +6155,10 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Ar
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 CUMULATI
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 CUMULATI
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 CUMULATI
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 CUMULATI
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;
Index: testsuite/gcc.target/i386/pr39162.c
===================================================================
--- testsuite/gcc.target/i386/pr39162.c (revision 207850)
+++ testsuite/gcc.target/i386/pr39162.c (working copy)
@@ -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__));
Index: testsuite/gcc.target/i386/pr59794-2.c
===================================================================
--- testsuite/gcc.target/i386/pr59794-2.c (revision 207850)
+++ testsuite/gcc.target/i386/pr59794-2.c (working copy)
@@ -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)));
Index: testsuite/gcc.target/i386/pr59794-3.c
===================================================================
--- testsuite/gcc.target/i386/pr59794-3.c (revision 207850)
+++ testsuite/gcc.target/i386/pr59794-3.c (working copy)
@@ -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)));
Index: testsuite/gcc.target/i386/pr60205-1.c
===================================================================
--- testsuite/gcc.target/i386/pr60205-1.c (revision 207851)
+++ testsuite/gcc.target/i386/pr60205-1.c (working copy)
@@ -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)));
Index: testsuite/gcc.target/i386/sse-5.c
===================================================================
--- testsuite/gcc.target/i386/sse-5.c (revision 207850)
+++ testsuite/gcc.target/i386/sse-5.c (working copy)
@@ -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;