public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/96166] New: [10/11 Regression] -O3/-ftree-slp-vectorize turns ROL into a mess
@ 2020-07-11 16:01 nok.raven at gmail dot com
  2020-07-13  8:05 ` [Bug target/96166] " rguenth at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: nok.raven at gmail dot com @ 2020-07-11 16:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96166

            Bug ID: 96166
           Summary: [10/11 Regression] -O3/-ftree-slp-vectorize turns ROL
                    into a mess
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nok.raven at gmail dot com
  Target Milestone: ---

inline void swap(int &x, int &y)
{
  int tmp = x;
  x = y;
  y = tmp;
}

void bar(int (&x)[2])
{
  int y[2];
  __builtin_memcpy(&y, &x, sizeof x);
  swap(y[0], y[1]);
  __builtin_memcpy(&x, &y, sizeof x);
}


GCC 9 (-Os/O2/O3) produces:
  rolq $32, (%rdi)

GCC 10/trunk (-O3/-ftree-slp-vectorize) produces:
  movq (%rdi), %rax
  movd (%rdi), %xmm1
  sarq $32, %rax
  movq %rax, %xmm0
  punpckldq %xmm1, %xmm0
  movq %xmm0, (%rdi)


https://godbolt.org/z/5h3bW8

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-07-07  8:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-11 16:01 [Bug tree-optimization/96166] New: [10/11 Regression] -O3/-ftree-slp-vectorize turns ROL into a mess nok.raven at gmail dot com
2020-07-13  8:05 ` [Bug target/96166] " rguenth at gcc dot gnu.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2020-10-12 12:47 ` rguenth at gcc dot gnu.org
2021-02-11 15:00 ` jakub at gcc dot gnu.org
2021-02-12 10:11 ` jakub at gcc dot gnu.org
2021-02-12 11:18 ` jakub at gcc dot gnu.org
2021-02-12 12:17 ` pinskia at gcc dot gnu.org
2021-02-12 12:21 ` jakub at gcc dot gnu.org
2021-02-12 13:53 ` jakub at gcc dot gnu.org
2021-02-12 14:03 ` rguenth at gcc dot gnu.org
2021-02-12 14:40 ` jakub at gcc dot gnu.org
2021-02-13  9:33 ` cvs-commit at gcc dot gnu.org
2021-02-13  9:34 ` [Bug target/96166] [10 " jakub at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-07-07  8:55 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).