2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-10 06:40:29 +08:00

rs6000: Use pointers in bswap testcases

Currently these bswap testcases use global variables, which causes
problems with -m32: the memory access is a D-form access, and when
combine tries to combine that with the bswap it tries a D-form store
with byte reverse.  That instruction does not exist, and since combine
started with only two insns here it will not try splitting this.

This should be improved, but it is not what this test is testing, and
the "load" case already uses a pointer, so let's do that for the store
case as well.


	* gcc.target/powerpc/bswap16.c: Use a pointer instead of a global for
	the "store" test as well.
	* gcc.target/powerpc/bswap32.c: Ditto.

From-SVN: r269771
This commit is contained in:
Segher Boessenkool 2019-03-18 18:44:56 +01:00 committed by Segher Boessenkool
parent b2ebe97358
commit 0a6d5a9e3e
3 changed files with 8 additions and 4 deletions
gcc/testsuite
ChangeLog
gcc.target/powerpc

@ -1,3 +1,9 @@
2019-03-18 Segher Boessenkool <segher@kernel.crashing.org>
* gcc.target/powerpc/bswap16.c: Use a pointer instead of a global for
the "store" test as well.
* gcc.target/powerpc/bswap32.c: Ditto.
2019-03-18 Segher Boessenkool <segher@kernel.crashing.org>
* gcc.target/powerpc/pr18096-1.c: Allow an error message that says

@ -3,6 +3,5 @@
/* { dg-final { scan-assembler "lhbrx" } } */
/* { dg-final { scan-assembler "sthbrx" } } */
unsigned short us;
unsigned int load_bswap16 (unsigned short *p) { return __builtin_bswap16 (*p); }
void store_bswap16 (unsigned int a) { us = __builtin_bswap16 (a); }
void store_bswap16 (unsigned short *p, unsigned int a) { *p = __builtin_bswap16 (a); }

@ -3,6 +3,5 @@
/* { dg-final { scan-assembler "lwbrx" } } */
/* { dg-final { scan-assembler "stwbrx" } } */
unsigned int ui;
unsigned int load_bswap32 (unsigned int *p) { return __builtin_bswap32 (*p); }
void store_bswap32 (unsigned int a) { ui = __builtin_bswap32 (a); }
void store_bswap32 (unsigned int *p, unsigned int a) { *p = __builtin_bswap32 (a); }