Commit 264f4afa by Bill Schmidt Committed by William Schmidt

rs6000-c.c (altivec_resolve_overloaded_builtin): Issue a warning message when…

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  <wschmidt@linux.vnet.ibm.com>

	* 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  <wschmidt@linux.vnet.ibm.com>

	* 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
parent bb42836b
2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* 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 <manu@gcc.gnu.org> 2014-10-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
* tree-pretty-print.c (dump_location): Make it extern. Dump also * tree-pretty-print.c (dump_location): Make it extern. Dump also
...@@ -4326,6 +4326,14 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, ...@@ -4326,6 +4326,14 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
if (TARGET_DEBUG_BUILTIN) if (TARGET_DEBUG_BUILTIN)
fprintf (stderr, "altivec_resolve_overloaded_builtin, code = %4d, %s\n", fprintf (stderr, "altivec_resolve_overloaded_builtin, code = %4d, %s\n",
(int)fcode, IDENTIFIER_POINTER (DECL_NAME (fndecl))); (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. */ /* For now treat vec_splats and vec_promote as the same. */
if (fcode == ALTIVEC_BUILTIN_VEC_SPLATS if (fcode == ALTIVEC_BUILTIN_VEC_SPLATS
......
2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* 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 <manu@gcc.gnu.org> 2014-10-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/tm/debug-1.c: Update regex. * gcc.dg/tm/debug-1.c: Update regex.
......
/* { dg-do compile { target powerpc*-*-* } } */ /* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */ /* { 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 /* This test checks if AltiVec builtins accept const-qualified
arguments. */ arguments. */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-Wno-deprecated" } */
#include <altivec.h> #include <altivec.h>
typedef const volatile unsigned int _1; typedef const volatile unsigned int _1;
typedef const unsigned int _2; typedef const unsigned int _2;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-Wno-deprecated" } */
/* Checks from the original ops.c that pass pointers to long or /* Checks from the original ops.c that pass pointers to long or
unsigned long for operations that support that in released versions unsigned long for operations that support that in released versions
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-Wno-deprecated" } */
#include <altivec.h> #include <altivec.h>
#include <stdlib.h> #include <stdlib.h>
extern char * *var_char_ptr; extern char * *var_char_ptr;
......
/* { dg-do compile { target powerpc_altivec_ok } } */ /* { dg-do compile { target powerpc_altivec_ok } } */
/* { dg-options "-maltivec -mcpu=G5 -O2" } */ /* { dg-options "-maltivec -mcpu=G5 -O2 -Wno-deprecated" } */
#include <altivec.h> #include <altivec.h>
......
/* { dg-do compile { target powerpc*-*-* } } */ /* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec -O0 -Wall" } */ /* { dg-options "-maltivec -O0 -Wall -Wno-deprecated" } */
#include <altivec.h> #include <altivec.h>
......
/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */ /* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */ /* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
/* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec -O2" } */ /* { dg-options "-maltivec -O2 -Wno-deprecated" } */
#include <altivec.h> #include <altivec.h>
......
/* { dg-do compile { target { powerpc*-*-* } } } */ /* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */ /* { 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. */ /* Test the various load/store varients. */
......
/* Test for deprecation messages on use of lvsl and lvsr for little endian. */
/* { dg-do compile { target { powerpc64le-*-* } } } */
/* { dg-options "-O0 -Wdeprecated" } */
#include <altivec.h>
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" } */
}
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