summaryrefslogtreecommitdiff
path: root/gcc/analyzer
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2020-02-11 09:45:48 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2020-02-11 13:34:08 -0500
commita0e4929b0461226722d6d08b1fdc2852b9100b75 (patch)
treeb675c3a2305cdb6ad19f8ed0bba21c3a63063c1d /gcc/analyzer
parentcd28b75921354c64fd4c8a1c238991e522abc38e (diff)
analyzer: fix ICE in "__analyzer_dump_exploded_nodes" on non-empty worklist (PR 93669)
gcc/analyzer/ChangeLog: PR analyzer/93669 * engine.cc (exploded_graph::dump_exploded_nodes): Handle missing case of STATUS_WORKLIST in implementation of "__analyzer_dump_exploded_nodes". gcc/testsuite/ChangeLog: PR analyzer/93669 * gcc.dg/analyzer/pr93669.c: New test.
Diffstat (limited to 'gcc/analyzer')
-rw-r--r--gcc/analyzer/ChangeLog7
-rw-r--r--gcc/analyzer/engine.cc17
2 files changed, 20 insertions, 4 deletions
diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog
index 38afa69da64..0734716a8a8 100644
--- a/gcc/analyzer/ChangeLog
+++ b/gcc/analyzer/ChangeLog
@@ -1,5 +1,12 @@
2020-02-11 David Malcolm <dmalcolm@redhat.com>
+ PR analyzer/93669
+ * engine.cc (exploded_graph::dump_exploded_nodes): Handle missing
+ case of STATUS_WORKLIST in implementation of
+ "__analyzer_dump_exploded_nodes".
+
+2020-02-11 David Malcolm <dmalcolm@redhat.com>
+
PR analyzer/93649
* constraint-manager.cc (constraint_manager::add_constraint): When
merging equivalence classes and updating m_constant, also update
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 63579da953a..8d5f9c69724 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -3197,15 +3197,15 @@ exploded_graph::dump_exploded_nodes () const
/* Emit a warning at any call to "__analyzer_dump_exploded_nodes",
giving the number of processed exploded nodes for "before-stmt",
- and the IDs of processed and merger enodes.
+ and the IDs of processed, merger, and worklist enodes.
We highlight the count of *processed* enodes since this is of most
interest in DejaGnu tests for ensuring that state merger has
happened.
- We don't show the count of merger enodes, as this is more of an
- implementation detail of the merging that we don't want to bake
- into our expected DejaGnu messages. */
+ We don't show the count of merger and worklist enodes, as this is
+ more of an implementation detail of the merging/worklist that we
+ don't want to bake into our expected DejaGnu messages. */
unsigned i;
exploded_node *enode;
@@ -3225,6 +3225,7 @@ exploded_graph::dump_exploded_nodes () const
auto_vec<exploded_node *> processed_enodes;
auto_vec<exploded_node *> merger_enodes;
+ auto_vec<exploded_node *> worklist_enodes;
/* This is O(N^2). */
unsigned j;
exploded_node *other_enode;
@@ -3237,6 +3238,9 @@ exploded_graph::dump_exploded_nodes () const
{
default:
gcc_unreachable ();
+ case exploded_node::STATUS_WORKLIST:
+ worklist_enodes.safe_push (other_enode);
+ break;
case exploded_node::STATUS_PROCESSED:
processed_enodes.safe_push (other_enode);
break;
@@ -3254,6 +3258,11 @@ exploded_graph::dump_exploded_nodes () const
pp_string (&pp, "] merger(s): [");
print_enode_indices (&pp, merger_enodes);
}
+ if (worklist_enodes.length () > 0)
+ {
+ pp_string (&pp, "] worklist: [");
+ print_enode_indices (&pp, worklist_enodes);
+ }
pp_character (&pp, ']');
warning_n (stmt->location, 0, processed_enodes.length (),