From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB1FF3858D1E; Wed, 21 Jun 2023 07:05:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB1FF3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687331156; bh=7n+iGyn5dNYmRPGqAHNKJ5Tc9SH7w5JLAcfQF/4SnqY=; h=From:To:Subject:Date:From; b=CtHNPNxwmXlmgf3yOJeIcj3A3nD6vGThRw4XItWIIS1o3k2wivZqaZo/oJxEKkGeG fAd+eDIY8z/C2jH9fvyxrl4xKFsSsbNTOOce9SErB0z1sZyuODnViJ7EIqAt5t33fC YCrQeHunSWM48+zzOxRpiKpsD7QqnjRYud3jYYS0= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/110334] New: [13/14 Regresssion] unused functions not eliminated before LTO streaming Date: Wed, 21 Jun 2023 07:05:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 13.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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=3D110334 Bug ID: 110334 Summary: [13/14 Regresssion] unused functions not eliminated before LTO streaming Product: gcc Version: 13.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- https://bugzilla.suse.com/show_bug.cgi?id=3D1212101 reports crashes of Firefox because with LTO we end up with comdats built with different ISA flags and the linker choosing the "wrong" one. While that's general a user error the TUs in question have no uses of the offending symbols and they are indeed eliminated when optimizing. But this elimination happens only after LTO streaming which is unfortunate. We also seem to lack any diagnostic at WPA time that we have COMDAT (group members) from several TUs that are not built with the same options. Apart from diagnosing this (with -Wodr?) a possible DWIM solution could be to clone the COMDAT (groups), overriding the linker decision and preserving the edges to the original refered copy. That's also superior to using symbol visibility in the TUs as it would allow to share the comdats across TUs if they are built with the same set of flags. But first and foremost I wonder why we do not eliminate these symbols before LTO streaming.=