Fix availability of functions in other partitions
authorJan Hubicka <jh@suse.cz>
Thu, 17 Sep 2020 10:41:07 +0000 (12:41 +0200)
committerJan Hubicka <jh@suse.cz>
Thu, 17 Sep 2020 10:41:07 +0000 (12:41 +0200)
* cgraph.c (cgraph_node::get_availability): Fix availability of
functions in other partitions
* varpool.c (varpool_node::get_availability): Likewise.

gcc/cgraph.c
gcc/varpool.c

index c0b457950595e800c1a40a60ff3f26879b4953f9..b43adaac7c034f09d0a5693343fdf8d4ea5e72b8 100644 (file)
@@ -2360,7 +2360,7 @@ cgraph_node::get_availability (symtab_node *ref)
        ref = cref->inlined_to;
     }
   enum availability avail;
-  if (!analyzed)
+  if (!analyzed && !in_other_partition)
     avail = AVAIL_NOT_AVAILABLE;
   else if (local)
     avail = AVAIL_LOCAL;
index 458cdf1bf376d54ce441f9f79a934d35cc2b3fdd..31ea2132331b2f9695e0b7f85efa0ec1ce04a04e 100644 (file)
@@ -479,7 +479,7 @@ varpool_node::add (tree decl)
 enum availability
 varpool_node::get_availability (symtab_node *ref)
 {
-  if (!definition)
+  if (!definition && !in_other_partition)
     return AVAIL_NOT_AVAILABLE;
   if (!TREE_PUBLIC (decl))
     return AVAIL_AVAILABLE;