On Thu, Oct 21, 2021 at 6:50 PM H.J. Lu <hjl.to...@gmail.com> wrote:
>
> On Tue, Oct 19, 2021 at 11:42 PM Uros Bizjak <ubiz...@gmail.com> wrote:
> >
> > On Tue, Oct 19, 2021 at 8:23 PM H.J. Lu <hjl.to...@gmail.com> wrote:
> > >
> > > commit 247c407c83f0015f4b92d5f71e45b63192f6757e
> > > Author: Roger Sayle <ro...@nextmovesoftware.com>
> > > Date:   Mon Oct 18 12:15:40 2021 +0100
> > >
> > >     Try placing RTL folded constants in the constant pool.
> > >
> > >     My recent attempts to come up with a testcase for my patch to evaluate
> > >     ss_plus in simplify-rtx.c, identified a missed optimization 
> > > opportunity
> > >     (that's potentially a long-time regression): The RTL optimizers no 
> > > longer
> > >     place constants in the constant pool.
> > >
> > > changed -m32 codegen from
> > >
> > >         movq    .LC1, %mm0
> > >         paddb   .LC0, %mm0
> > >         movq    %mm0, x
> > >         ret
> > >
> > > to
> > >
> > >         movl    $807671820, %eax
> > >         movl    $1616136252, %edx
> > >         movl    %eax, x
> > >         movl    %edx, x+4
> > >         ret
> > >
> > > and -m64 codegen from
> > >
> > >         movq    .LC1(%rip), %mm0
> > >         paddb   .LC0(%rip), %mm0
> > >         movq    %xmm0, x(%rip)
> > >         ret
> > >
> > > to
> > >
> > >         movq    .LC2(%rip), %rax
> > >         movq    %rax, x(%rip)
> > >         ret
> > >
> > > Adjust pr22076.c to check that MMX register isn't used since avoiding
> > > MMX register isn't a bad thing.
> > >
> > >         PR testsuite/102840
> > >         * gcc.target/i386/pr22076.c: Updated to check that MMX register
> > >         isn't used.
> >
> > The compiler is now able to evaluate the result at the compile time
> > and it optimizes the test accordingly. Let's provide some MMX
> > instruction that is implemented with UNSPEC, so the compiler won't be
> > able to outsmart us.
> >
> > Something like the attached patch.
> >
> > Uros.
>
> Works for me.

Committed with the following ChangeLog:

testsuite: Adjust pr22076.c to avoid compile-time optimization [PR102840]

2021-10-21  Uroš Bizjak  <ubiz...@gmail.com>

    PR testsuite/102840

gcc/testsuite/ChangeLog:

    * gcc.target/i386/pr22076.c: Adjust to avoid compile time optimization.

Uros.

Reply via email to