From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0245F3857830; Mon, 27 Nov 2023 08:04:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0245F3857830 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701072262; bh=uaxW40udQOEd/yKbQOsGPQYjiLaJabjVvcWkkb1JoyQ=; h=From:To:Subject:Date:From; b=roMVqQSRFhn3TcmzpShiFrjXkEg7WqLaoMcVdjqlozHDePNlgeIg+WzdGRpuLwQdr XbMLYKgunYSzdCU64MWfdim8dRn4NPpJc50NUYFB8GOj+GyvX7meGgPdkDBToboc1D JTT6eTvRQ8V6U5mTtQiCDe8W4fEKbJ4y3p/mILOI= From: "shaohua.li at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112721] New: [14 Regression] Wrong code at -O1/s on x86_64-linux-gnu since r14-5831-gaae723d360c Date: Mon, 27 Nov 2023 08: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=3D112721 Bug ID: 112721 Summary: [14 Regression] Wrong code at -O1/s on x86_64-linux-gnu since r14-5831-gaae723d360c 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: mjambor at suse dot cz Target Milestone: --- gcc at -O1/s produces the wrong code. Bisected to r14-5831-gaae723d360c Compiler explorer: https://godbolt.org/z/671M9YPPj $ cat a.c int printf(const char *, ...); struct a { int b; }; int c, e; long d; unsigned *f(unsigned *g) { for (; c;) e =3D d; return g; } int main() { int *h; struct a i =3D {8}; int *j =3D &i.b; h =3D f(j); *h =3D 0; printf("%d\n", i.b); } $ $ gcc -O0 a.c && ./a.out 0 $ gcc -O1 a.c && ./a.out 8 $=