From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 79F983894C19; Tue, 13 Oct 2020 16:36:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 79F983894C19 From: "acoplan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/97404] New: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d Date: Tue, 13 Oct 2020 16:36:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: acoplan at gcc dot gnu.org 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 cc 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: Tue, 13 Oct 2020 16:36:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97404 Bug ID: 97404 Summary: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: acoplan at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- AArch64 GCC miscompiles the following testcase: char a, b; long c; short d, e; long *f =3D &c; int g; char h(signed char i) { return 0; } static short j(short i, int k) { return i < 0 ? 0 : i >> k; } void l(void); void m(void) { e =3D j(d | 9766, 11); *f =3D e; } void l(void) { a =3D 5 | g; b =3D h(a); } int main() { m(); if (c !=3D 4) __builtin_abort(); } when built with -O2 -fno-inline since r9-3666-g74ca1c01d02e548f32aa26f9a887dcc0730703fb. Immediately prior to this revision we have: j.constprop.0: .LFB5: .cfi_startproc tst w0, 32768 sbfx w0, w0, 11, 5 csel w0, w0, wzr, eq ret and afterwards we have: j.constprop.0: .LFB5: .cfi_startproc mov w0, 0 ret which would suggest that GCC has determined that j is always called with arguments such that it returns 0, but this is not the case.=