From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0B4EE3A3E418; Thu, 22 Apr 2021 16:48:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B4EE3A3E418 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97386] [8/9 Regression] wrong code with __builtin_bswap16() of rotated 64bit value Date: Thu, 22 Apr 2021 16:48:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Thu, 22 Apr 2021 16:48:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97386 --- Comment #8 from CVS Commits --- The releases/gcc-8 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:615b19069a9afd9faf803d6888ac49d03065762d commit r8-10860-g615b19069a9afd9faf803d6888ac49d03065762d Author: Jakub Jelinek Date: Tue Oct 13 19:13:26 2020 +0200 combine: Fix up simplify_shift_const_1 for nested ROTATEs [PR97386] The following testcases are miscompiled (the first one since my improvements to rotate discovery on GIMPLE, the other one for many years) because combiner optimizes nested ROTATEs with narrowing SUBREG in between (i.e. the outer rotate is performed in shorter precision than the inner one) = to just one ROTATE of the rotated constant. While that (under certain conditions) can work for shifts, it can't work for rotates where we can only do that with rotates of the same precision. 2020-10-13 Jakub Jelinek PR rtl-optimization/97386 * combine.c (simplify_shift_const_1): Don't optimize nested ROT= ATEs if they have different modes. * gcc.c-torture/execute/pr97386-1.c: New test. * gcc.c-torture/execute/pr97386-2.c: New test. (cherry picked from commit 1a98b22b0468214ae8463d075dacaeea1d46df15)=