]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa/92606 - IPA ICF merging variables in different address-space
authorRichard Biener <rguenther@suse.de>
Tue, 5 Dec 2023 12:56:10 +0000 (13:56 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 5 Dec 2023 13:55:15 +0000 (14:55 +0100)
The following aovids merging variables that are put in different
address-spaces.

PR ipa/92606
* ipa-icf.cc (sem_variable::equals_wpa): Compare address-spaces.

gcc/ipa-icf.cc

index c72c9d57a80968330748aafa0c476971605c53b4..81232d5706e1e8eaf4671e0e9e501528ce1bb193 100644 (file)
@@ -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++)
     {