From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1224B38708B9; Tue, 13 Oct 2020 17:14:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1224B38708B9 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97386] [8/9/10/11 Regression] wrong code with __builtin_bswap16() of rotated 64bit value Date: Tue, 13 Oct 2020 17:14:23 +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: Tue, 13 Oct 2020 17:14:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97386 --- Comment #4 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:f76949cee9560d04d5417481dbcda5ca089c9ebc commit r11-3855-gf76949cee9560d04d5417481dbcda5ca089c9ebc 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.=