On Wed, Mar 10, 2021 at 7:04 AM Alexandre Oliva <ol...@adacore.com> wrote: > > > ppc configurations that have -mstrict-align enabled by default fail > gcc.dg/strlenopt-80.c, because some memcpy calls don't get turned into > MEM_REFs, which defeats the tested-for strlen optimization. > > This was regstrapped on x86_64-linux-gnu, tested with a cross to a > ppc64-vxworks7r2 configured with -mstrict-align enabled by default, > and I'm now also regstrapping on ppc64-linux-gnu just to be sure. > Ok to install?
Btw, I asked during two stage1s whether relaxing the folding to also apply to strict-align targets would be OK. But I didn't receive any answers and thus dropped the ball ... Basically for the folding turning integer-mode sized copies into separate load + store also allow the load/store to be not aligned according to their mode (and rely on RTL expansion to perform bitfield load/store ops for them). Richard. > > for gcc/testsuite/ChangeLog > > * gcc.dg/strlenopt-80.c: Add -mno-strict-align on ppc. > --- > gcc/testsuite/gcc.dg/strlenopt-80.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/gcc/testsuite/gcc.dg/strlenopt-80.c > b/gcc/testsuite/gcc.dg/strlenopt-80.c > index 9124fe4740a1b..9978f5cf3bc56 100644 > --- a/gcc/testsuite/gcc.dg/strlenopt-80.c > +++ b/gcc/testsuite/gcc.dg/strlenopt-80.c > @@ -5,7 +5,11 @@ > such a store. > { dg-do compile { target aarch64*-*-* i?86-*-* powerpc*-*-* x86_64-*-* } } > > - { dg-options "-O2 -Wall -fdump-tree-optimized" } */ > + { dg-options "-O2 -Wall -fdump-tree-optimized" } > + > + On powerpc configurations that have -mstrict-align by default, > + the memcpy calls for ncpylog >= 3 are not turned into MEM_REFs. > + { dg-additional-options "-mno-strict-align" { target powerpc*-*-* } } */ > > #define CHAR_BIT __CHAR_BIT__ > #define SIZE_MAX __SIZE_MAX__ > > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > Vim, Vi, Voltei pro Emacs -- GNUlius Caesar