From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A91AC384AB49; Fri, 12 Apr 2024 22:39:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A91AC384AB49 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712961579; bh=7RzjbJM9Yc2kAQ10Dg6DP7hNljqi4ZhoxEMtecElBYA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=j2vq4zHttFqkMlswF0qWcRV7DGiDXsBRJsKN6Sal6ADxZVJ9l7jRDlMYJMG/sRzPS ayomtVy7Pm3tXD315eYo2zlru7/zxm7QOkggG6BC3yZjOUonGtmVFORJtMGX2mrMOe Ebarq5/97oQ+o7toq+Kmke/w6l59vD/Z1ngljXSI= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114704] Missed optimization : eliminate store if the value is known in all predecessors Date: Fri, 12 Apr 2024 22:39:38 +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: missed-optimization X-Bugzilla-Severity: enhancement 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed cf_reconfirmed_on 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=3D114704 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2024-04-12 Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski --- Confirmed. A more general testcase: ``` void dummy(); void src(int *p, int a){ int t =3D *p; if(t =3D=3D a) goto then; else { dummy(); t =3D *p; if(t =3D=3D a) goto then; else return; } then: *p =3D t; // *p is already a, it's dead now } ```=