public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-10089] ipa-icf: skip variables with body_removed
@ 2022-06-23 10:12 Martin Liska
0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2022-06-23 10:12 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:3f1637f8b17ded9e08841abc1182dcde0e35e660
commit r11-10089-g3f1637f8b17ded9e08841abc1182dcde0e35e660
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.c (sem_item_optimizer::filter_removed_items):
Skip variables with body_removed.
(cherry picked from commit 31ce821a790caec8a2849dd67a9847e78a33d14c)
Diff:
---
gcc/ipa-icf.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 5dd33a75c3a..44407e1b5cd 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -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);
}
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-23 10:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 10:12 [gcc r11-10089] ipa-icf: skip variables with body_removed Martin Liska
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).