On Thu, Jul 23, 2020 at 4:50 PM Martin Sebor <mse...@gmail.com> wrote: > > On 7/23/20 2:18 PM, H.J. Lu wrote: > > On Thu, Jul 23, 2020 at 1:14 PM Martin Sebor via Gcc-patches > > <gcc-patches@gcc.gnu.org> wrote: > >> > >> On 7/22/20 2:23 AM, Rainer Orth wrote: > >>> Hi Martin, > >>> > >>>> I have committed this change in r11-2231 after Jeff approved it > >>>> off list last Thursday. > >>> > >>> the new gcc.target/i386/memcpy-pr95886.c test FAILs on 32-bit x86 > >>> (i386-pc-solaris2.11): > >>> > >>> +FAIL: gcc.target/i386/memcpy-pr95886.c scan-rtl-dump-times expand > >>> "const_int 1976943448883713" 1 > >>> +FAIL: gcc.target/i386/memcpy-pr95886.c scan-rtl-dump-times expand > >>> "const_int 576467370915332609" 1 > >>> +FAIL: gcc.target/i386/memcpy-pr95886.c scan-rtl-dump-times expand > >>> "const_int 578431098682540545" 1 > >>> +FAIL: gcc.target/i386/memcpy-pr95886.c scan-rtl-dump-times expand > >>> "const_int 578437695685198337" 1 > >>> +FAIL: gcc.target/i386/memcpy-pr95886.c scan-rtl-dump-times expand > >>> "const_int 578437695685198337" 1 > >>> +FAIL: gcc.target/i386/memcpy-pr95886.c scan-rtl-dump-times expand > >>> "const_int 578437695752110593" 1 > >>> +FAIL: gcc.target/i386/memcpy-pr95886.c scan-rtl-dump-times expand > >>> "const_int 578437695752306689" 1 > >>> +FAIL: gcc.target/i386/memcpy-pr95886.c scan-rtl-dump-times expand > >>> "const_int 578437695752307200" 1 > >>> +FAIL: gcc.target/i386/memcpy-pr95886.c scan-rtl-dump-times expand > >>> "const_int 578437695752307201" 2 > >> > >> Thanks for letting me know. The test looks for patterns that are > >> apparently LP64-specific so I restricted it to just that data model. > >> > > > > Shouldn't it also work for x32? > > I would expect the optimization to work on any target that does > the piecemeal copy, including x32. But you probably meant if > the test should pass as is on x32. Possibly yes, but I didn't > check. > > A better test would exercise the solution at least on all three > i386 targets. It could probably be done fairly simply by reducing > the sizes of the arrays, or by using the large arrays only on LP64 > or whatever makes the difference and figuring out the right magic > target selector to use in the dg- directives.
Here is the patch I am checking in. -- H.J.
From 23daf7386b07c78b79223a00a85c8b002a5a67e3 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" <hjl.to...@gmail.com> Date: Thu, 23 Jul 2020 19:14:06 -0700 Subject: [PATCH] Restrict PR middle-end/95886 x86 test to !ia32 Since gcc.target/i386/memcpy-pr95886.c requires 64-bit register, restrict it to !ia32. PR middle-end/95886 * gcc.target/i386/memcpy-pr95886.c: Restrict test to !ia32. --- gcc/testsuite/gcc.target/i386/memcpy-pr95886.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.target/i386/memcpy-pr95886.c b/gcc/testsuite/gcc.target/i386/memcpy-pr95886.c index ddfdfd2bc78..0699146296a 100644 --- a/gcc/testsuite/gcc.target/i386/memcpy-pr95886.c +++ b/gcc/testsuite/gcc.target/i386/memcpy-pr95886.c @@ -1,7 +1,6 @@ /* PR middle-end/95886 - suboptimal memcpy with embedded zero bytes - { dg-do compile } - { dg-options "-O2 -Wall -fdump-rtl-expand" } - { dg-require-effective-target lp64 } */ + { dg-do compile { target { ! ia32 } } } + { dg-options "-O2 -Wall -fdump-rtl-expand" } */ const char a1234567890[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; -- 2.26.2