diff options
author | David Malcolm <dmalcolm@redhat.com> | 2020-10-27 09:48:00 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2020-10-27 09:48:00 -0400 |
commit | 9e78634c74c540cad6a2ca447af0d5df1ac4c60b (patch) | |
tree | 632c6653443fb17584adcad1482aa173fd261f58 /gcc/analyzer | |
parent | 31ec7242e1ff1e8da376ec9ffef10b07ac562881 (diff) | |
download | gcc-9e78634c74c540cad6a2ca447af0d5df1ac4c60b.zip gcc-9e78634c74c540cad6a2ca447af0d5df1ac4c60b.tar.gz gcc-9e78634c74c540cad6a2ca447af0d5df1ac4c60b.tar.bz2 |
analyzer: implement region_model::get_representative_path_var for labels
This fixes an ICE seen e.g. with gcc.dg/analyzer/data-model-16.c when
enabling -fdump-analyzer.
gcc/analyzer/ChangeLog:
* region-model.cc (region_model::get_representative_path_var):
Implement case RK_LABEL.
* region-model.h (label_region::get_label): New accessor.
Diffstat (limited to 'gcc/analyzer')
-rw-r--r-- | gcc/analyzer/region-model.cc | 5 | ||||
-rw-r--r-- | gcc/analyzer/region-model.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index 06c0c86..9050b44 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -2192,7 +2192,10 @@ region_model::get_representative_path_var (const region *reg, return path_var (function_reg->get_fndecl (), 0); } case RK_LABEL: - gcc_unreachable (); // TODO + { + const label_region *label_reg = as_a <const label_region *> (reg); + return path_var (label_reg->get_label (), 0); + } case RK_SYMBOLIC: { diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h index 5ad4a49..3298d05 100644 --- a/gcc/analyzer/region-model.h +++ b/gcc/analyzer/region-model.h @@ -1694,6 +1694,8 @@ public: void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; enum region_kind get_kind () const FINAL OVERRIDE { return RK_LABEL; } + tree get_label () const { return m_label; } + private: tree m_label; }; |