From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1ECF53858C3A; Mon, 16 Oct 2023 19:25:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1ECF53858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697484320; bh=4ldrf9gdXr7LcrmBW0b4UiDcG6NbHod3UII+RrsAFq8=; h=From:To:Subject:Date:From; b=DpYWUABj5E2ivAK4BtWGHoTgNuAwXi5cUH8E2XYlA296Iz6ZoCSQ5RiE1Zdbm9BeV hSd4D+FpqVeuW3afthppqAHS/xWevZI5Txv1Taanx/i+SH6OgkLpvAXxCAO2Dp9NHf biequp6/mNRjEaEnB4gjdJ9GfBFYrU5/IbZHPb38= From: "shaohua.li at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111839] New: Wrong code at -O3 on x86_64-linux-gnu since r12-2097-g9f34b780b0 Date: Mon, 16 Oct 2023 19:25:19 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: shaohua.li 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: bug_id short_desc product version bug_status keywords 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111839 Bug ID: 111839 Summary: Wrong code at -O3 on x86_64-linux-gnu since r12-2097-g9f34b780b0 Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: shaohua.li at inf dot ethz.ch CC: rguenth at gcc dot gnu.org Target Milestone: --- gcc at -O3 produced the wrong code. Bisected to r12-2097-g9f34b780b0 Compiler explorer: https://godbolt.org/z/Ea1hGGnob $ cat a.c int printf(const char *, ...); long a; int b, c, e, g, i; long *d, *h; char f =3D -26; int main() { long j; c =3D 0; for (; c !=3D 7; ++c) { long k=3D0; long l =3D k; long **m =3D &d; for (; f + i!=3D0; i++) h =3D &l; g =3D h !=3D (*m =3D &j); int *n =3D &b; *n =3D g; for (; e;) for (; a; a =3D a + 1) ; } printf("%d\n", b); } $ $ gcc -fsanitize=3Daddress,undefined a.c && ./a.out 1 $ gcc -O3 a.c && ./a.out 0 $=