From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 38C69385043A; Fri, 3 Sep 2021 06:13:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38C69385043A From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/17217] not removing removal of nested structs Date: Fri, 03 Sep 2021 06:13:20 +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: 4.0.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: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed 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: Fri, 03 Sep 2021 06:13:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D17217 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed|2005-01-25 03:37:17 |2021-09-03 Ever confirmed|0 |1 --- Comment #8 from Andrew Pinski --- So where is a better testcase (which is not depedent on how gimplifier work= s): int h(int *a); int f(int i, int j) { int t =3D i; int t1 =3D j; int g() { int t11 =3D t1; int t2 =3D h(&t); return t2 + t11; } int t3 =3D g(); return t3 + t1; } ---- CUT --- On the gimple level we get: _3 =3D __builtin_dwarf_cfa (0); FRAME.1.FRAME_BASE.PARENT =3D _3; FRAME.1.t =3D i_5(D); FRAME.1.t1 =3D j_7(D); t2_11 =3D h (&FRAME.1.t); _12 =3D j_7(D) + t2_11; _9 =3D FRAME.1.t1; _10 =3D _9 + _12; We should know that FRAME.1 is special in that h can only escape t field of FRAME.1 and not the other fields of FRAME.1 too.=