From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 436673858C78; Sun, 17 Sep 2023 13:09:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 436673858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694956158; bh=x2piXPYmCOyQwVclbLEakIeOJJnT6t7FTrGCqbl3PwM=; h=From:To:Subject:Date:From; b=NQ1k6XtBJjZgM/EWuv7PcAKLIH5g2AVZ+8TfYzF55uX4MQ3Wd5BmRZGyBv2fVjMUm 4fgkyJFHe9VSpLzRSxzRwJPUtda8Xf8aYI0z9Tg/EPE0leg/NzHxum1oO0Eqyjj0pR JvTsQEIzEMkxHCMfHNoY8W3JaY5RLCUwM268/iKE= From: "shaohua.li at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111444] New: Wrong code at -O2/3/s on x86_64-gnu since r14-3226-gd073e2d75d9 Date: Sun, 17 Sep 2023 13:09:17 +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=3D111444 Bug ID: 111444 Summary: Wrong code at -O2/3/s on x86_64-gnu since r14-3226-gd073e2d75d9 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: mjambor at suse dot cz Target Milestone: --- gcc at -O2/3/s produced the wrong code. Bisected to r14-3226-gd073e2d75d9 Compiler explorer: https://godbolt.org/z/xWj9z8foe $ cat a.c int printf(const char *, ...); int a =3D 3, d, e; int *b =3D &a; char c; short f; const int **g; static long h(int **i, int **j) { const int *k[46]; const int **l =3D &k[5]; *j =3D &e; g =3D l; for (; d; d =3D d + 1) ; **i =3D 0; return f; } int main() { int *m =3D &a; h(&m, &m); c =3D *b; printf("%d\n", c); } $ $ gcc -O0 a.c && ./a.out 3 $ gcc -O2 a.c && ./a.out 0 $=