From 264f4afafc4128b154263561cbb8435540f99e7e Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Fri, 3 Oct 2014 21:32:20 +0000 Subject: [PATCH] rs6000-c.c (altivec_resolve_overloaded_builtin): Issue a warning message when vec_lvsl or vec_lvsr is used with a little endian... [gcc] 2014-10-03 Bill Schmidt * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Issue a warning message when vec_lvsl or vec_lvsr is used with a little endian target. [gcc/testsuite] 2014-10-03 Bill Schmidt * g++.dg/ext/altivec-2.C: Compile with -Wno-deprecated to avoid failing with the new warning message. * gcc.dg/vmx/3c-01a.c: Likewise. * gcc.dg/vmx/ops-long-1.c: Likewise. * gcc.dg/vmx/ops.c: Likewise. * gcc.target/powerpc/altivec-20.c: Likewise. * gcc.target/powerpc/altivec-6.c: Likewise. * gcc.target/powerpc/altivec-vec-merge.c: Likewise. * gcc.target/powerpc/vsx-builtin-8.c: Likewise. * gcc.target/powerpc/warn-lvsl-lvsr.c: New test. From-SVN: r215880 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000-c.c | 8 ++++++++ gcc/testsuite/ChangeLog | 13 +++++++++++++ gcc/testsuite/g++.dg/ext/altivec-2.C | 2 +- gcc/testsuite/gcc.dg/vmx/3c-01a.c | 1 + gcc/testsuite/gcc.dg/vmx/ops-long-1.c | 1 + gcc/testsuite/gcc.dg/vmx/ops.c | 1 + gcc/testsuite/gcc.target/powerpc/altivec-20.c | 2 +- gcc/testsuite/gcc.target/powerpc/altivec-6.c | 2 +- .../gcc.target/powerpc/altivec-vec-merge.c | 2 +- gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c | 2 +- gcc/testsuite/gcc.target/powerpc/warn-lvsl-lvsr.c | 14 ++++++++++++++ 12 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/warn-lvsl-lvsr.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 96845dd8a32..04991981f45 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-10-03 Bill Schmidt + + * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): + Issue a warning message when vec_lvsl or vec_lvsr is used with a + little endian target. + 2014-10-03 Manuel López-Ibáñez * tree-pretty-print.c (dump_location): Make it extern. Dump also diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index 9c16a886d77..f024dccfdfc 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -4326,6 +4326,14 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, if (TARGET_DEBUG_BUILTIN) fprintf (stderr, "altivec_resolve_overloaded_builtin, code = %4d, %s\n", (int)fcode, IDENTIFIER_POINTER (DECL_NAME (fndecl))); + + /* vec_lvsl and vec_lvsr are deprecated for use with LE element order. */ + if (fcode == ALTIVEC_BUILTIN_VEC_LVSL && !VECTOR_ELT_ORDER_BIG) + warning (OPT_Wdeprecated, "vec_lvsl is deprecated for little endian; use \ +assignment for unaligned loads and stores"); + else if (fcode == ALTIVEC_BUILTIN_VEC_LVSR && !VECTOR_ELT_ORDER_BIG) + warning (OPT_Wdeprecated, "vec_lvsr is deprecated for little endian; use \ +assignment for unaligned loads and stores"); /* For now treat vec_splats and vec_promote as the same. */ if (fcode == ALTIVEC_BUILTIN_VEC_SPLATS diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d0587414873..489f3ee8411 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2014-10-03 Bill Schmidt + + * g++.dg/ext/altivec-2.C: Compile with -Wno-deprecated to avoid + failing with the new warning message. + * gcc.dg/vmx/3c-01a.c: Likewise. + * gcc.dg/vmx/ops-long-1.c: Likewise. + * gcc.dg/vmx/ops.c: Likewise. + * gcc.target/powerpc/altivec-20.c: Likewise. + * gcc.target/powerpc/altivec-6.c: Likewise. + * gcc.target/powerpc/altivec-vec-merge.c: Likewise. + * gcc.target/powerpc/vsx-builtin-8.c: Likewise. + * gcc.target/powerpc/warn-lvsl-lvsr.c: New test. + 2014-10-03 Manuel López-Ibáñez * gcc.dg/tm/debug-1.c: Update regex. diff --git a/gcc/testsuite/g++.dg/ext/altivec-2.C b/gcc/testsuite/g++.dg/ext/altivec-2.C index eb8a92942bc..e14e6f800f7 100644 --- a/gcc/testsuite/g++.dg/ext/altivec-2.C +++ b/gcc/testsuite/g++.dg/ext/altivec-2.C @@ -1,6 +1,6 @@ /* { dg-do compile { target powerpc*-*-* } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ -/* { dg-options "-maltivec -Wall -Wno-unused-but-set-variable" } */ +/* { dg-options "-maltivec -Wall -Wno-unused-but-set-variable -Wno-deprecated" } */ /* This test checks if AltiVec builtins accept const-qualified arguments. */ diff --git a/gcc/testsuite/gcc.dg/vmx/3c-01a.c b/gcc/testsuite/gcc.dg/vmx/3c-01a.c index 2499ca66598..3b02ebe6971 100644 --- a/gcc/testsuite/gcc.dg/vmx/3c-01a.c +++ b/gcc/testsuite/gcc.dg/vmx/3c-01a.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-options "-Wno-deprecated" } */ #include typedef const volatile unsigned int _1; typedef const unsigned int _2; diff --git a/gcc/testsuite/gcc.dg/vmx/ops-long-1.c b/gcc/testsuite/gcc.dg/vmx/ops-long-1.c index 5471706790a..15f7a5bbc1f 100644 --- a/gcc/testsuite/gcc.dg/vmx/ops-long-1.c +++ b/gcc/testsuite/gcc.dg/vmx/ops-long-1.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-options "-Wno-deprecated" } */ /* Checks from the original ops.c that pass pointers to long or unsigned long for operations that support that in released versions diff --git a/gcc/testsuite/gcc.dg/vmx/ops.c b/gcc/testsuite/gcc.dg/vmx/ops.c index 6c00e963828..ee7a418ed8c 100644 --- a/gcc/testsuite/gcc.dg/vmx/ops.c +++ b/gcc/testsuite/gcc.dg/vmx/ops.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-options "-Wno-deprecated" } */ #include #include extern char * *var_char_ptr; diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-20.c b/gcc/testsuite/gcc.target/powerpc/altivec-20.c index b2c29a979d9..1af8ed7dc54 100644 --- a/gcc/testsuite/gcc.target/powerpc/altivec-20.c +++ b/gcc/testsuite/gcc.target/powerpc/altivec-20.c @@ -1,5 +1,5 @@ /* { dg-do compile { target powerpc_altivec_ok } } */ -/* { dg-options "-maltivec -mcpu=G5 -O2" } */ +/* { dg-options "-maltivec -mcpu=G5 -O2 -Wno-deprecated" } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-6.c b/gcc/testsuite/gcc.target/powerpc/altivec-6.c index 51d411688fb..29856fd0794 100644 --- a/gcc/testsuite/gcc.target/powerpc/altivec-6.c +++ b/gcc/testsuite/gcc.target/powerpc/altivec-6.c @@ -1,6 +1,6 @@ /* { dg-do compile { target powerpc*-*-* } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ -/* { dg-options "-maltivec -O0 -Wall" } */ +/* { dg-options "-maltivec -O0 -Wall -Wno-deprecated" } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-vec-merge.c b/gcc/testsuite/gcc.target/powerpc/altivec-vec-merge.c index 3689f97490c..b1ed8b86491 100644 --- a/gcc/testsuite/gcc.target/powerpc/altivec-vec-merge.c +++ b/gcc/testsuite/gcc.target/powerpc/altivec-vec-merge.c @@ -1,7 +1,7 @@ /* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */ /* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ -/* { dg-options "-maltivec -O2" } */ +/* { dg-options "-maltivec -O2 -Wno-deprecated" } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c index 836b3851cad..934cdad250c 100644 --- a/gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ /* { dg-require-effective-target powerpc_vsx_ok } */ -/* { dg-options "-O3 -mcpu=power7" } */ +/* { dg-options "-O3 -mcpu=power7 -Wno-deprecated" } */ /* Test the various load/store varients. */ diff --git a/gcc/testsuite/gcc.target/powerpc/warn-lvsl-lvsr.c b/gcc/testsuite/gcc.target/powerpc/warn-lvsl-lvsr.c new file mode 100644 index 00000000000..bf889aaa22b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/warn-lvsl-lvsr.c @@ -0,0 +1,14 @@ +/* Test for deprecation messages on use of lvsl and lvsr for little endian. */ + +/* { dg-do compile { target { powerpc64le-*-* } } } */ +/* { dg-options "-O0 -Wdeprecated" } */ + +#include + +float f[20]; + +void foo () +{ + vector unsigned char a = vec_lvsl (4, f); /* { dg-warning "vec_lvsl is deprecated for little endian; use assignment for unaligned loads and stores" } */ + vector unsigned char b = vec_lvsr (8, f); /* { dg-warning "vec_lvsr is deprecated for little endian; use assignment for unaligned loads and stores" } */ +} -- 2.30.2