}
/* Subroutine of symnode_requires_tracking_p; return true if REF
- within CONTEXT_FNDECL might imply that we should be tracking the
- value of a decl. */
+ might imply that we should be tracking the value of its decl. */
static bool
-ipa_ref_requires_tracking (const ipa_ref *ref, tree context_fndecl)
+ipa_ref_requires_tracking (ipa_ref *ref)
{
/* If we have a load/store/alias of the symbol, then we'll track
the decl's value. */
return true;
case GIMPLE_CALL:
{
- cgraph_node *context_cnode = cgraph_node::get (context_fndecl);
- cgraph_edge *edge = context_cnode->get_edge (ref->stmt);
+ cgraph_node *caller_cnode = dyn_cast <cgraph_node *> (ref->referring);
+ if (caller_cnode == NULL)
+ return true;
+ cgraph_edge *edge = caller_cnode->get_edge (ref->stmt);
if (!edge)
return true;
if (edge->callee == NULL)
if (TREE_CODE (context_fndecl) != FUNCTION_DECL)
return true;
for (auto ref : symnode->ref_list.referring)
- if (ipa_ref_requires_tracking (ref, context_fndecl))
+ if (ipa_ref_requires_tracking (ref))
return true;
/* If we get here, then we don't have uses of this decl that require
--- /dev/null
+/* { dg-additional-options "-O2 -fdump-analyzer-untracked" } */
+
+void _gnutls_log(const char *);
+static void _gnutls_ocsp_verify_mandatory_stapling(void) {
+ _gnutls_log(__func__); /* { dg-warning "track '__func__': no" } */
+}
+void check_ocsp_response_gnutls_x509_cert_verify_peers(void) {
+ _gnutls_ocsp_verify_mandatory_stapling();
+}
extern void extern_fn (struct st *);
static void __attribute__((noinline)) internal_fn (struct st *) {}
extern int extern_get_int (void);
+extern void extern_fn_char_ptr (const char *);
void test_0 (void)
{
static struct st s12 = { __FILE__, __LINE__ }; /* { dg-warning "track 's12': yes" } */
fnptr (&s12);
}
+
+void test_13 (void)
+{
+ extern_fn_char_ptr (__func__); /* { dg-warning "track '__func__': no" } */
+}