From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 8F1D9385734A; Thu, 8 Jun 2023 10:44:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F1D9385734A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686221069; bh=KfjAzGxOLoqO0Loe7uuRUhjqjGanknWpjUHdxdJICFA=; h=From:To:Subject:Date:From; b=qEPjonO326ueslQJb8whx3TH60XcuWAR875Yrvt/mzOkInI1otthIrpJ2keVGxLYQ b4pxGqFSTsTOTSAhhqgOQHUQS6gMnNTIDlgAe+RWVkGfkkTSCqKbVq5dFdEfe7puYu 03TBXYpCwl+1jp7nXvy5OFj/Yyh/pJMX/9vK80Wk= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] strub: preserve comdat group X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: e2a186c30c5f46fbdf283b707de7b80bcbf85cb6 X-Git-Newrev: c88244498fe1667381145c1fadee8d79bfe1f2c0 Message-Id: <20230608104429.8F1D9385734A@sourceware.org> Date: Thu, 8 Jun 2023 10:44:29 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c88244498fe1667381145c1fadee8d79bfe1f2c0 commit c88244498fe1667381145c1fadee8d79bfe1f2c0 Author: Alexandre Oliva Date: Thu Jun 8 07:41:02 2023 -0300 strub: preserve comdat group Diff: --- gcc/cgraph.h | 2 +- gcc/cgraphunit.cc | 5 +++-- gcc/ipa-strub.cc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/cgraph.h b/gcc/cgraph.h index cedaaac3a45..177bd9dc5b7 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -153,7 +153,7 @@ public: void remove (void); /* Undo any definition or use of the symbol. */ - void reset (void); + void reset (bool preserve_comdat_group = false); /* Dump symtab node to F. */ void dump (FILE *f); diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc index bccd2f2abb5..9a550a5cce6 100644 --- a/gcc/cgraphunit.cc +++ b/gcc/cgraphunit.cc @@ -384,7 +384,7 @@ symbol_table::process_new_functions (void) functions or variables. */ void -symtab_node::reset (void) +symtab_node::reset (bool preserve_comdat_group) { /* Reset our data structures so we can analyze the function again. */ analyzed = false; @@ -395,7 +395,8 @@ symtab_node::reset (void) cpp_implicit_alias = false; remove_all_references (); - remove_from_same_comdat_group (); + if (!preserve_comdat_group) + remove_from_same_comdat_group (); if (cgraph_node *cn = dyn_cast (this)) { diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc index 921e4eb05ac..73a8771315c 100644 --- a/gcc/ipa-strub.cc +++ b/gcc/ipa-strub.cc @@ -2902,7 +2902,7 @@ pass_ipa_strub::execute (function *) /* Remove the function's body but keep arguments to be reused for thunk. */ onode->release_body (true); - onode->reset (); + onode->reset (/* unlike create_wrapper: preserve_comdat_group = */true); DECL_UNINLINABLE (decl) = false; DECL_RESULT (decl) = decl_result;