+2020-03-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/94277
+ * cgraphunit.c (check_global_declaration): For DECL_EXTERNAL and
+ non-TREE_PUBLIC non-DECL_ARTIFICIAL FUNCTION_DECLs, set TREE_PUBLIC
+ regardless of whether TREE_NO_WARNING is set on it or whether
+ warn_unused_function is true or not.
+
2020-03-23 Jeff Law <law@redhat.com>
PR rtl-optimization/90275
&& DECL_INITIAL (decl) == 0
&& DECL_EXTERNAL (decl)
&& ! DECL_ARTIFICIAL (decl)
- && ! TREE_NO_WARNING (decl)
- && ! TREE_PUBLIC (decl)
- && (warn_unused_function
- || snode->referred_to_p (/*include_self=*/false)))
+ && ! TREE_PUBLIC (decl))
{
- if (snode->referred_to_p (/*include_self=*/false))
+ if (TREE_NO_WARNING (decl))
+ ;
+ else if (snode->referred_to_p (/*include_self=*/false))
pedwarn (input_location, 0, "%q+F used but never defined", decl);
else
- warning (OPT_Wunused_function, "%q+F declared %<static%> but never defined", decl);
+ warning (OPT_Wunused_function, "%q+F declared %<static%> but never "
+ "defined", decl);
/* This symbol is effectively an "extern" declaration now. */
TREE_PUBLIC (decl) = 1;
}