Message ID | ortupjd0pt.fsf@lxoliva.fsfla.org |
---|---|
State | New |
Headers | show |
Series | use -mno-strict-align for strlenopt-80.c on powerpc | expand |
On Wed, Mar 10, 2021 at 02:41:50AM -0300, Alexandre Oliva 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? The -mstrict-align option is defined in sysv4.opt, which is not used in all configurations (like, powerpc64-darwin*, and the AIX configs). So no, sorry; you'll need more work here. Btw, aarch64 has this same option. Segher
On Wed, Mar 10, 2021 at 7:04 AM Alexandre Oliva <oliva@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
Segher Boessenkool <segher@kernel.crashing.org> wrote: > On Wed, Mar 10, 2021 at 02:41:50AM -0300, Alexandre Oliva 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? > > The -mstrict-align option is defined in sysv4.opt, which is not used in > all configurations (like, powerpc64-darwin*, and the AIX configs). this works for me on powerpc-darwin, I haven’t tried to test AIX. Iain diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c b/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c index 554cd0c..6d51ea8 100644 --- a/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c +++ b/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c @@ -1,7 +1,9 @@ /* { dg-do compile } */ /* { dg-require-effective-target powerpc_prefixed_addr } */ /* { dg-require-effective-target lp64 } */ -/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10 -mfloat128 " } */ +/* { dg-additional-options "-mno-strict-align" { target { ! { *-*-darwin* *-*-aix* } } } } */ +/* { dg-prune-output ".-mfloat128. option may not be fully supported" } */ /* Tests whether we generate a prefixed load/store operation for addresses that don't meet DS/DQ offset constraints. 64-bit is needed for testing the use
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__