From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 953C63858039; Thu, 7 Jan 2021 17:38:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 953C63858039 From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/45791] Missed devirtualization Date: Thu, 07 Jan 2021 17:38:56 +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.6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED 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: resolution 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 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: Thu, 07 Jan 2021 17:38:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D45791 Martin Jambor changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #18 from Martin Jambor --- The release_ssa dump of function main in the testcase from bug description is just "return 0;" The release_ssa dump of function main the testcase from comment #15 is: int main () { [local count: 1073741824]: Sub::bar (&foo); Sub::bar (&foo); return 0; } ...so devirtualized in my book (main is cold, so they are not inlined, of course). The release_ssa dump of function foo in the testcase from comment #5 is: void foo () { void * _3; [local count: 1073741824]: _3 =3D operator new (8); MEM[(struct X *)_3]._vptr.X =3D &MEM [(void *)&_ZTV1X + 1= 6B]; X::~X (_3); return; } ...so also devirtualzied before IPA. Therefore I am going to close this old bug as done. If anyone finds a different testcase where the early optimizers should do a better job to help devirtualziation, please file a new bug.=