aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer/ChangeLog
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2020-02-24 12:12:28 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2020-02-24 18:28:35 -0500
commit3a25f345d1fbe2de8c12cae84b0c7d2a76c0b78e (patch)
treeae11948c8297d90695c72caf23cb4c6ff9379eb6 /gcc/analyzer/ChangeLog
parenta4dbb9b25a60143c699de55cd6226cebeb3b3c3e (diff)
downloadgcc-3a25f345d1fbe2de8c12cae84b0c7d2a76c0b78e.zip
gcc-3a25f345d1fbe2de8c12cae84b0c7d2a76c0b78e.tar.gz
gcc-3a25f345d1fbe2de8c12cae84b0c7d2a76c0b78e.tar.bz2
analyzer: fix ICE with OFFSET_TYPE [PR 93899]
PR analyzer/93899 reports an ICE within make_region_for_type when handling a param of type OFFSET_TYPE within exploded_graph::add_function_entry. This patch fixes the ICE by further generalizing the "give up on this tree code" logic from r10-6667-gf76a88ebf089871dcce215aa0cb1956ccc060895 for PR analyzer/93388 and r10-6695-g2e6233935c77b56a68e939c629702f960b8e6fb2 for PR analyzer/93778 by replacing the gcc_unreachable in make_region_for_type with a return of NULL, and handling this in add_region_for_type by notifying the ctxt. Doing so means that numerous places that create regions now need to have a context passed to them, so most of the patch is churn involved in passing a context around to where it's needed. gcc/analyzer/ChangeLog: PR analyzer/93899 * engine.cc (impl_region_model_context::impl_region_model_context): Add logger param. * engine.cc (exploded_graph::add_function_entry): Create an impl_region_model_context and pass it to the push_frame call. Bail if the resulting state is invalid. (exploded_graph::build_initial_worklist): Likewise. (exploded_graph::build_initial_worklist): Handle the case where add_function_entry fails. * exploded-graph.h (impl_region_model_context::impl_region_model_context): Add logger param. * region-model.cc (map_region::get_or_create): Add ctxt param and pass it to add_region_for_type. (map_region::can_merge_p): Pass NULL as a ctxt to call to get_or_create. (array_region::get_element): Pass ctxt to call to get_or_create. (array_region::get_or_create): Add ctxt param and pass it to add_region_for_type. (root_region::push_frame): Pass ctxt to get_or_create calls. (region_model::get_lvalue_1): Likewise. (region_model::make_region_for_unexpected_tree_code): Assert that ctxt is non-NULL. (region_model::get_rvalue_1): Pass ctxt to get_svalue_for_fndecl and get_svalue_for_label calls. (region_model::get_svalue_for_fndecl): Add ctxt param and pass it to get_region_for_fndecl. (region_model::get_region_for_fndecl): Add ctxt param and pass it to get_or_create. (region_model::get_svalue_for_label): Add ctxt param and pass it to get_region_for_label. (region_model::get_region_for_label): Add ctxt param and pass it to get_region_for_fndecl and get_or_create. (region_model::get_field_region): Add ctxt param and pass it to get_or_create_view and get_or_create. (make_region_for_type): Replace gcc_unreachable with return NULL. (region_model::add_region_for_type): Add ctxt param. Handle a return of NULL from make_region_for_type by calling make_region_for_unexpected_tree_code. (region_model::get_or_create_mem_ref): Pass ctxt to calls to get_or_create_view. (region_model::get_or_create_view): Add ctxt param and pass it to add_region_for_type. (selftest::test_state_merging): Pass ctxt to get_or_create_view. * region-model.h (region_model::get_or_create): Add ctxt param. (region_model::add_region_for_type): Likewise. (region_model::get_svalue_for_fndecl): Likewise. (region_model::get_svalue_for_label): Likewise. (region_model::get_region_for_fndecl): Likewise. (region_model::get_region_for_label): Likewise. (region_model::get_field_region): Likewise. (region_model::get_or_create_view): Likewise. gcc/testsuite/ChangeLog: PR analyzer/93899 * g++.dg/analyzer/pr93899.C: New test.
Diffstat (limited to 'gcc/analyzer/ChangeLog')
-rw-r--r--gcc/analyzer/ChangeLog56
1 files changed, 56 insertions, 0 deletions
diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog
index bc70e88..0882ec6 100644
--- a/gcc/analyzer/ChangeLog
+++ b/gcc/analyzer/ChangeLog
@@ -1,5 +1,61 @@
2020-02-24 David Malcolm <dmalcolm@redhat.com>
+ PR analyzer/93899
+ * engine.cc
+ (impl_region_model_context::impl_region_model_context): Add logger
+ param.
+ * engine.cc (exploded_graph::add_function_entry): Create an
+ impl_region_model_context and pass it to the push_frame call.
+ Bail if the resulting state is invalid.
+ (exploded_graph::build_initial_worklist): Likewise.
+ (exploded_graph::build_initial_worklist): Handle the case where
+ add_function_entry fails.
+ * exploded-graph.h
+ (impl_region_model_context::impl_region_model_context): Add logger
+ param.
+ * region-model.cc (map_region::get_or_create): Add ctxt param and
+ pass it to add_region_for_type.
+ (map_region::can_merge_p): Pass NULL as a ctxt to call to
+ get_or_create.
+ (array_region::get_element): Pass ctxt to call to get_or_create.
+ (array_region::get_or_create): Add ctxt param and pass it to
+ add_region_for_type.
+ (root_region::push_frame): Pass ctxt to get_or_create calls.
+ (region_model::get_lvalue_1): Likewise.
+ (region_model::make_region_for_unexpected_tree_code): Assert that
+ ctxt is non-NULL.
+ (region_model::get_rvalue_1): Pass ctxt to get_svalue_for_fndecl
+ and get_svalue_for_label calls.
+ (region_model::get_svalue_for_fndecl): Add ctxt param and pass it
+ to get_region_for_fndecl.
+ (region_model::get_region_for_fndecl): Add ctxt param and pass it
+ to get_or_create.
+ (region_model::get_svalue_for_label): Add ctxt param and pass it
+ to get_region_for_label.
+ (region_model::get_region_for_label): Add ctxt param and pass it
+ to get_region_for_fndecl and get_or_create.
+ (region_model::get_field_region): Add ctxt param and pass it to
+ get_or_create_view and get_or_create.
+ (make_region_for_type): Replace gcc_unreachable with return NULL.
+ (region_model::add_region_for_type): Add ctxt param. Handle a
+ return of NULL from make_region_for_type by calling
+ make_region_for_unexpected_tree_code.
+ (region_model::get_or_create_mem_ref): Pass ctxt to calls to
+ get_or_create_view.
+ (region_model::get_or_create_view): Add ctxt param and pass it to
+ add_region_for_type.
+ (selftest::test_state_merging): Pass ctxt to get_or_create_view.
+ * region-model.h (region_model::get_or_create): Add ctxt param.
+ (region_model::add_region_for_type): Likewise.
+ (region_model::get_svalue_for_fndecl): Likewise.
+ (region_model::get_svalue_for_label): Likewise.
+ (region_model::get_region_for_fndecl): Likewise.
+ (region_model::get_region_for_label): Likewise.
+ (region_model::get_field_region): Likewise.
+ (region_model::get_or_create_view): Likewise.
+
+2020-02-24 David Malcolm <dmalcolm@redhat.com>
+
* checker-path.cc (superedge_event::should_filter_p): Update
filter for empty descriptions to cover verbosity level 3 as well
as 2.