From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 35DC23858C20; Sat, 30 Sep 2023 14:04:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35DC23858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696082662; bh=xhGcZX9Xlq9hZPWhQ3ApNa4M1RYdy4Bx7/qTyjIOOOo=; h=From:To:Subject:Date:From; b=QHERSb1ek7sL6DQwB7CImfARDpgt10CGFuiYYRe7k/Es5DSMcxWTJ6Ptq5mUJm3Pa t9MTW57Ind9a3JSPBMMHxPwvyA1W7E/Kx1bTQB70TaBlilOOzwVs1m2D7FyonvGOJL RAs03HqiJO3g9APf+Cz1D07pCS1xfvSnsetegMOk= From: "shaohua.li at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111648] New: Wrong code at -O2/3 on x86_64-linux-gnu since r14-3243-ga7dba4a1c05 Date: Sat, 30 Sep 2023 14:04:21 +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=3D111648 Bug ID: 111648 Summary: Wrong code at -O2/3 on x86_64-linux-gnu since r14-3243-ga7dba4a1c05 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: prathamesh3492 at gcc dot gnu.org Target Milestone: --- gcc at -O2/3 produced the wrong code Bisected to r14-3243-ga7dba4a1c05 Compiler explorer: https://godbolt.org/z/1bvWTrEK1 $ cat a.c int printf(const char *, ...); int a; int *b =3D &a; static int **c =3D &b; static int d; short e; char f; int main() { f =3D -21; for (; f < -5; f++) { e =3D f ^ 3; d =3D *b; **c =3D e; } printf("%d\n", d); } $ $ gcc -O0 a.c && ./a.out -6 $ gcc -O2 a.c && ./a.out 2 $=