From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BB7F3858D35; Mon, 15 Apr 2024 10:20:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BB7F3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713176419; bh=+vpCDftkhioUFFOXlLNb5dryBgnZNUZwOwSyX4+/VDU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JN+p2Osq6L6hZaEJGp0OxefX2SefQof1IAtBrqGS3vWlPzklghjGlneRQ2Xa1CCI6 5ziVGYaM1xkmPnIY0BwVjsgX5/BtBPkyoONc3A/whobBLeuayYL62zdFB1hOrIJiEX AzUT/yI3sfRyHT3spRXXrw9D0uA6l1EIa/ywS9GA= From: "hubicka at ucw dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/114703] Missed devirtualization in rather simple case Date: Mon, 15 Apr 2024 10:20:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: hubicka at ucw dot cz 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: 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=3D114703 --- Comment #3 from Jan Hubicka --- > Yep, 'new' memory escapes. Yep, this is blocking a lot of propagation in common C++ code. Here it may help to do speculative devirtualization during IPA stage that will let the late optimization to get rid of the speculation (since after inlning we will know that the virtual call does not overwrite virtual table pointer). This is technically not too hard to add. We can optimistically rule out (some) may aliases while walking the alias oracle. I will take a look next stage1.=