From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0F8723858D39; Thu, 21 Sep 2023 13:20:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F8723858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695302428; bh=nWqE+EYfdcZrZ9P6gzvCWxdw0ZMLP6ctIxXlnycwYtg=; h=From:To:Subject:Date:From; b=HoJKSaG4vtWjZtktFqdYnCCBldRGTQFoJceqmKWJhYdxlsuk6e0g/cUSzcNrUFduY sXAHFphioZDoxg0GthIre2Bnv7gbwdbvXBDv3R+vb/hWyWVb1s1hrz5ZM1GrM8g9Y/ q8jQELRsTKHvlc9EBdoKBfxqJt8u+5XHUn84ne1Y= From: "shaohua.li at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111519] New: [13/14 Regression] Wrong code at -O3 on x86_64-linux-gnu since r13-455-g1fe04c497d Date: Thu, 21 Sep 2023 13:20:27 +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: 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 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=3D111519 Bug ID: 111519 Summary: [13/14 Regression] Wrong code at -O3 on x86_64-linux-gnu since r13-455-g1fe04c497d Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: shaohua.li at inf dot ethz.ch CC: roger at nextmovesoftware dot com Target Milestone: --- gcc at -O3 produced the wrong code. Bisected to r13-455-g1fe04c497d Compiler explorer: https://godbolt.org/z/ozEaKa1rY $ cat a.c int printf(const char *, ...); int a, o; char b, f, i; long c; static signed char d; static char g; unsigned *h; signed char *e =3D &f; static signed char **j =3D &e; static long k[2]; unsigned **l =3D &h; short m; int main(int q, char *r[]) { int p =3D 0; if (q =3D=3D 0) p =3D 1; signed char *n =3D &d; *n =3D 0; for (; c;) for (; i; i--) ; g =3D 0; for (; g <=3D 1; g++) { *n =3D **j; k[g] =3D 0 !=3D &m; *e =3D l && k[0]; } if (p) printf(&b); for (; o < 4; o++) { a =3D d; if (p) printf(&b); } printf("%d\n", a); } $ $ gcc -O2 a.c && ./a.out 1 $ gcc -O3 a.c && ./a.out 0 $=