analyzer: fix ICE with incorrect lookup of cgraph node [PR105074]
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 29 Mar 2022 00:40:16 +0000 (20:40 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 29 Mar 2022 00:40:16 +0000 (20:40 -0400)
commit1203e8f7880c9751ece5f5302e413b20f4608a00
treedda0f9c6c414928c4011092f48a2f29ab9c6d5af
parentaab0127dae4e7d6069fa6963e9f4c5b013a48b66
analyzer: fix ICE with incorrect lookup of cgraph node [PR105074]

gcc/analyzer/ChangeLog:
PR analyzer/105074
* region.cc (ipa_ref_requires_tracking): Drop "context_fndecl",
instead using the ref->referring to get the cgraph node of the
caller.
(symnode_requires_tracking_p): Likewise.

gcc/testsuite/ChangeLog:
PR analyzer/105074
* gcc.dg/analyzer/pr105074.c: New test.
* gcc.dg/analyzer/untracked-1.c (extern_fn_char_ptr): New decl.
(test_13): New.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/region.cc
gcc/testsuite/gcc.dg/analyzer/pr105074.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/analyzer/untracked-1.c