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
+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
/* { 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); }
/* { 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); }