public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] ipa/92606 - IPA ICF merging variables in different address-space
@ 2023-12-05 13:54 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-12-05 13:54 UTC (permalink / raw)
  To: gcc-patches

The following aovids merging variables that are put in different
address-spaces.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

	PR ipa/92606
	* ipa-icf.cc (sem_variable::equals_wpa): Compare address-spaces.
---
 gcc/ipa-icf.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/ipa-icf.cc b/gcc/ipa-icf.cc
index c72c9d57a80..81232d5706e 100644
--- a/gcc/ipa-icf.cc
+++ b/gcc/ipa-icf.cc
@@ -1666,6 +1666,10 @@ sem_variable::equals_wpa (sem_item *item,
   if (DECL_IN_TEXT_SECTION (decl) != DECL_IN_TEXT_SECTION (item->decl))
     return return_false_with_msg ("text section");
 
+  if (TYPE_ADDR_SPACE (TREE_TYPE (decl))
+      != TYPE_ADDR_SPACE (TREE_TYPE (item->decl)))
+    return return_false_with_msg ("address-space");
+
   ipa_ref *ref = NULL, *ref2 = NULL;
   for (unsigned i = 0; node->iterate_reference (i, ref); i++)
     {
-- 
2.35.3

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-05 13:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 13:54 [PATCH] ipa/92606 - IPA ICF merging variables in different address-space Richard Biener

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).