https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95315

--- Comment #4 from Arseny Solokha <asolokha at gmx dot com> ---
(In reply to Jakub Jelinek from comment #2)
> Created attachment 48603 [details]
> gcc11-pr95315.patch
> 
> Untested fix.

@@ -1823,6 +1850,12 @@ omp_resolve_declare_variant (tree base)
            }
        }

+      static struct cgraph_node_hook_list *node_removal_hook_holder;
+      if (node_removal_hook_holder)
+       node_removal_hook_holder
+         = symtab->add_cgraph_removal_hook (omp_declare_variant_remove_hook,
+                                            NULL);
+
       if (omp_declare_variants == NULL)
        omp_declare_variants
          = hash_table<omp_declare_variant_hasher>::create_ggc (64);

Shouldn't there be

  if (!node_removal_hook_holder)
    node_removal_hook_holder
      = symtab->add_cgraph_removal_hook (…

instead?

Reply via email to