From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 20B0A3857831; Tue, 27 Jul 2021 12:08:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20B0A3857831 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101641] Bogus redundant store removal Date: Tue, 27 Jul 2021 12:08: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: 11.1.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to everconfirmed cf_reconfirmed_on bug_status keywords 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2021 12:08:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101641 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org Ever confirmed|0 |1 Last reconfirmed| |2021-07-27 Status|UNCONFIRMED |ASSIGNED Keywords| |wrong-code --- Comment #1 from Richard Biener --- We're already going great lengths trying to preserve stores that change the dynamic type in a way relevant for downstream users (which we actually do n= ot see). In particular we've settled to alias_set_type set =3D ao_ref_alias_set (&lhs_ref); alias_set_type base_set =3D ao_ref_base_alias_set (&lhs_ref); if ((vnresult->set !=3D set && ! alias_set_subset_of (set, vnresult->set)) || (vnresult->base_set !=3D base_set && ! alias_set_subset_of (base_set, vnresult->base_set))) resultsame =3D false; but this case is so degenerate that all the alias sets and base alias sets of both pu->y (vnresult) and pu->x (lhs_ref) are 2 since we use the alias set of the union type for all accesses that have the union in their path. The only remaining chance we have here is to look at the actual types and reject punning attempts. We are really missing a way to preserve the TBAA effect of a store but not the store itself.=