public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-1213] ipa-icf: skip variables with body_removed
Date: Thu, 23 Jun 2022 04:08:00 +0000 (GMT)	[thread overview]
Message-ID: <20220623040800.48B183857C4D@sourceware.org> (raw)

https://gcc.gnu.org/g:31ce821a790caec8a2849dd67a9847e78a33d14c

commit r13-1213-g31ce821a790caec8a2849dd67a9847e78a33d14c
Author: Martin Liska <mliska@suse.cz>
Date:   Wed May 18 15:07:53 2022 +0200

    ipa-icf: skip variables with body_removed
    
    Similarly to cgraph_nodes, it may happen that body_removed is set
    during merging of symbols.
    
            PR ipa/105600
    
    gcc/ChangeLog:
    
            * ipa-icf.cc (sem_item_optimizer::filter_removed_items):
            Skip variables with body_removed.

Diff:
---
 gcc/ipa-icf.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/ipa-icf.cc b/gcc/ipa-icf.cc
index 765ae746745..6528a7a10b2 100644
--- a/gcc/ipa-icf.cc
+++ b/gcc/ipa-icf.cc
@@ -2411,10 +2411,11 @@ sem_item_optimizer::filter_removed_items (void)
 	    {
 	      /* Filter out non-readonly variables.  */
 	      tree decl = item->decl;
-	      if (TREE_READONLY (decl))
-		filtered.safe_push (item);
-	      else
+	      varpool_node *vnode = static_cast <sem_variable *>(item)->get_node ();
+	      if (!TREE_READONLY (decl) || vnode->body_removed)
 		remove_item (item);
+	      else
+		filtered.safe_push (item);
 	    }
         }
     }


                 reply	other threads:[~2022-06-23  4:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220623040800.48B183857C4D@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).