From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 523EB3857C7E; Sun, 15 Nov 2020 12:53:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 523EB3857C7E From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/97836] wrong code at -O1 on x86_64-pc-linux-gnu Date: Sun, 15 Nov 2020 12:53:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhendong.su at inf dot ethz.ch 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: 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: Sun, 15 Nov 2020 12:53:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97836 --- Comment #1 from Zhendong Su --- Another related test that triggers the miscompilation at -Os, but not -O1:= =20 [621] % gcctk -O1 small.c; ./a.out [622] %=20 [622] % gcctk -Os small.c; ./a.out Aborted [623] %=20 [623] % cat small.c int a; int b(int c) { return 0; } static int *d(int *e) { if (a) { a =3D a && b(*e); } return e; } int main() { int f; if (d(&f) !=3D &f) __builtin_abort(); return 0; }=