summaryrefslogtreecommitdiff
path: root/gcc/analyzer/region-model.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2021-07-22 22:36:05 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2021-07-22 22:36:05 -0400
commit60933a148ab33c82915b40690b3ced6abc32a1bf (patch)
tree04b6d29d7e1fe885237be0172dd4314fd15deb3f /gcc/analyzer/region-model.h
parent3382846558e02044598556e66e5ea1cb3115429d (diff)
downloadgcc-60933a148ab33c82915b40690b3ced6abc32a1bf.tar.gz
analyzer: fix feasibility false +ve with overly complex svalues
gcc/analyzer/ChangeLog: * diagnostic-manager.cc (class auto_disable_complexity_checks): New. (epath_finder::explore_feasible_paths): Use it to disable complexity checks whilst processing the worklist. * region-model-manager.cc (region_model_manager::region_model_manager): Initialize m_check_complexity. (region_model_manager::reject_if_too_complex): Bail if m_check_complexity is false. * region-model.h (region_model_manager::enable_complexity_check): New. (region_model_manager::disable_complexity_check): New. (region_model_manager::m_check_complexity): New. gcc/testsuite/ChangeLog: * gcc.dg/analyzer/feasibility-3.c: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/analyzer/region-model.h')
-rw-r--r--gcc/analyzer/region-model.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h
index cc39929db26..1c7a3865346 100644
--- a/gcc/analyzer/region-model.h
+++ b/gcc/analyzer/region-model.h
@@ -323,6 +323,9 @@ public:
void log_stats (logger *logger, bool show_objs) const;
+ void enable_complexity_check (void) { m_check_complexity = true; }
+ void disable_complexity_check (void) { m_check_complexity = false; }
+
private:
bool too_complex_p (const complexity &c) const;
bool reject_if_too_complex (svalue *sval);
@@ -407,6 +410,8 @@ private:
conjured_svalue *> conjured_values_map_t;
conjured_values_map_t m_conjured_values_map;
+ bool m_check_complexity;
+
/* Maximum complexity of svalues that weren't rejected. */
complexity m_max_complexity;