From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BE8923858D28; Tue, 10 Oct 2023 02:38:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE8923858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696905494; bh=tDx8Fkw5+o6Sp/onBRprElNimG26HkbXfcTLUI19TWk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WTRh+tcBGGGl2+9s83sxLXbv2OS1WB9lYDdW+1WCYoTr309dArAvvvVbH4RAODg9B G0ffmwzSLlv+dGfG44cGGkm61OOaWFpqw9/+ZH7NvOPmNJsEY/REP9TaBrUvOYEJ9c /kqJUhWQqyD08l4spg/ILTi/BWCsvpYf5Iow1YeY= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111734] [14 Regression] wrong code with '-O3 -fno-inline-functions-called-once -fno-inline-small-functions -fno-omit-frame-pointer -fno-toplevel-reorder -fno-tree-fre' Date: Tue, 10 Oct 2023 02:38:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: needs-reduction, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed short_desc cf_reconfirmed_on component target_milestone bug_status Message-ID: In-Reply-To: References: 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=3D111734 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Summary|wrong code with '-O3 |[14 Regression] wrong code |-fno-inline-functions-calle |with '-O3 |d-once |-fno-inline-functions-calle |-fno-inline-small-functions |d-once |-fno-omit-frame-pointer |-fno-inline-small-functions |-fno-toplevel-reorder |-fno-omit-frame-pointer |-fno-tree-fre' |-fno-toplevel-reorder | |-fno-tree-fre' Last reconfirmed| |2023-10-10 Component|c |tree-optimization Target Milestone|--- |14.0 Status|UNCONFIRMED |NEW --- Comment #3 from Andrew Pinski --- PRE does: Processing block 0: BB2 Value numbering stmt =3D *m_1(D) =3D &e; RHS &e simplified to &e No store match Value numbering store *m_1(D) to &e Setting value number of .MEM_3 to .MEM_ ... Starting insert iteration 1 Deleted redundant store *m_1(D) =3D &e; Removing dead stmt *m_1(D) =3D &e; Better reduced testcase: ``` struct a {}; struct { unsigned b; unsigned short c; } d, f =3D {9, 1}; int e; static void g(unsigned, __SIZE_TYPE__, int **m); static void h() { int *i =3D &e; g(0, (__SIZE_TYPE__)i, &i); if (*i) f =3D d; } void g(unsigned a, __SIZE_TYPE__ b, int **m) { *m =3D &e; } int main() { h(); if (f.c !=3D 1) __builtin_abort(); } ```=