diff options
author | David Malcolm <dmalcolm@redhat.com> | 2022-10-05 13:52:59 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2022-10-05 13:52:59 -0400 |
commit | 6832c95c0e1a58ba4d342ec002000f9d9d7db5ca (patch) | |
tree | 951995c50245f1af2f47c9685bcc870a4673d533 /gcc/analyzer/region-model.cc | |
parent | e2a228438919d846995bf2c839c9b657442224b2 (diff) | |
download | gcc-6832c95c0e1a58ba4d342ec002000f9d9d7db5ca.zip gcc-6832c95c0e1a58ba4d342ec002000f9d9d7db5ca.tar.gz gcc-6832c95c0e1a58ba4d342ec002000f9d9d7db5ca.tar.bz2 |
analyzer: fix ICEs seen with call summaries on PR 107060
This doesn't fix the various false positives seen with
-fanalyzer-call-summaries on PR 107060, but stops it crashing at -O2.
gcc/analyzer/ChangeLog:
PR analyzer/107060
* call-summary.cc
(call_summary_replay::convert_svalue_from_summary_1): Handle NULL
results from convert_svalue_from_summary in SK_UNARY_OP and
SK_BIN_OP.
* engine.cc (impl_region_model_context::on_unknown_change): Bail
out on svalues that can't have associated state.
* region-model-impl-calls.cc
(region_model::impl_call_analyzer_get_unknown_ptr): New.
* region-model.cc (region_model::on_stmt_pre): Handle
"__analyzer_get_unknown_ptr".
* region-model.h
(region_model::impl_call_analyzer_get_unknown_ptr): New decl.
* store.cc (store::replay_call_summary_cluster): Avoid trying to
create binding clusters for base regions that shouldn't have them.
gcc/ChangeLog:
PR analyzer/107060
* doc/analyzer.texi (__analyzer_get_unknown_ptr): Document.
gcc/testsuite/ChangeLog:
PR analyzer/107060
* gcc.dg/analyzer/analyzer-decls.h (__analyzer_get_unknown_ptr):
New decl.
* gcc.dg/analyzer/call-summaries-2.c
(test_summarized_writes_param_to_ptr_unknown): New test.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/analyzer/region-model.cc')
-rw-r--r-- | gcc/analyzer/region-model.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index d14f3a1..aa3d205 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -1256,6 +1256,12 @@ region_model::on_stmt_pre (const gimple *stmt, { /* This is handled elsewhere. */ } + else if (is_special_named_call_p (call, "__analyzer_get_unknown_ptr", + 0)) + { + call_details cd (call, this, ctxt); + impl_call_analyzer_get_unknown_ptr (cd); + } else *out_unknown_side_effects = on_call_pre (call, ctxt, out_terminate_path); |