From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 09B153857C40; Sat, 11 Jul 2020 16:01:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09B153857C40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594483302; bh=8b4HvPuPUoLhB7xUfZgy9fGdAPI3NqHeJ7uYjiX6N8g=; h=From:To:Subject:Date:From; b=EcMaZbPCA8Enw/PilkQlOsI5CbcpOna2SqzbmIHU16EzAvN9it+aYnM8lf878G4QF CJVXi49K+NAitExuJjnNvR53kNH3QTeMnhP3fC60nrxmTPkFX0Q7CR7NrvstkXqX0h 2zZNOB9HRZMOXUVqqhADD1WfQj5HdNgMDnKuwQJA= From: "nok.raven at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96166] New: [10/11 Regression] -O3/-ftree-slp-vectorize turns ROL into a mess Date: Sat, 11 Jul 2020 16:01:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nok.raven at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2020 16:01:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96166 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 =3D x; x =3D y; y =3D 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=