+2020-02-05 David Malcolm <dmalcolm@redhat.com>
+
+ * doc/analyzer.texi
+ (Special Functions for Debugging the Analyzer): Update description
+ of __analyzer_dump_exploded_nodes.
+
2020-02-05 Jakub Jelinek <jakub@redhat.com>
PR target/92190
+2020-02-05 David Malcolm <dmalcolm@redhat.com>
+
+ * engine.cc (exploded_node::dump_dot): Show merger enodes.
+ (worklist::add_node): Assert that the node's m_status is
+ STATUS_WORKLIST.
+ (exploded_graph::process_worklist): Likewise for nodes from the
+ worklist. Set status of merged nodes to STATUS_MERGER.
+ (exploded_graph::process_node): Set status of node to
+ STATUS_PROCESSED.
+ (exploded_graph::dump_exploded_nodes): Rework handling of
+ "__analyzer_dump_exploded_nodes", splitting enodes by status into
+ "processed" and "merger", showing the count of just the processed
+ enodes at the call, rather than the count of all enodes.
+ * exploded-graph.h (exploded_node::status): New enum.
+ (exploded_node::exploded_node): Initialize m_status to
+ STATUS_WORKLIST.
+ (exploded_node::get_status): New getter.
+ (exploded_node::set_status): New setter.
+
2020-02-04 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93543
pp_write_text_to_stream (pp);
pp_printf (pp, "EN: %i", m_index);
+ if (m_status == STATUS_MERGER)
+ pp_string (pp, " (merger)");
pp_newline (pp);
format f (true);
void
worklist::add_node (exploded_node *enode)
{
+ gcc_assert (enode->get_status () == exploded_node::STATUS_WORKLIST);
m_queue.insert (key_t (*this, enode), enode);
}
while (m_worklist.length () > 0)
{
exploded_node *node = m_worklist.take_next ();
+ gcc_assert (node->get_status () == exploded_node::STATUS_WORKLIST);
gcc_assert (node->m_succs.length () == 0
|| node == m_origin);
if (flag_analyzer_state_merge && node != m_origin)
if (exploded_node *node_2 = m_worklist.peek_next ())
{
+ gcc_assert (node_2->get_status ()
+ == exploded_node::STATUS_WORKLIST);
gcc_assert (node->m_succs.length () == 0);
gcc_assert (node_2->m_succs.length () == 0);
/* Remove node_2 from the worklist. */
m_worklist.take_next ();
+ node_2->set_status (exploded_node::STATUS_MERGER);
/* Continue processing "node" below. */
}
in the worklist, to be processed on the next
iteration. */
add_edge (node, node_2, NULL, change);
+ node->set_status (exploded_node::STATUS_MERGER);
continue;
}
else
if (merged_enode == node)
m_worklist.add_node (merged_enode);
else
- add_edge (node, merged_enode, NULL, change);
+ {
+ add_edge (node, merged_enode, NULL, change);
+ node->set_status (exploded_node::STATUS_MERGER);
+ }
if (merged_enode == node_2)
m_worklist.add_node (merged_enode);
else
- add_edge (node_2, merged_enode, NULL, change);
+ {
+ add_edge (node_2, merged_enode, NULL, change);
+ node_2->set_status (exploded_node::STATUS_MERGER);
+ }
continue;
}
logger * const logger = get_logger ();
LOG_FUNC_1 (logger, "EN: %i", node->m_index);
+ node->set_status (exploded_node::STATUS_PROCESSED);
+
const program_point &point = node->get_point ();
/* Update cfun and input_location in case of an ICE: make it easier to
}
/* Emit a warning at any call to "__analyzer_dump_exploded_nodes",
- giving the number of exploded nodes for "before-stmt", and their
- IDs. */
+ giving the number of processed exploded nodes for "before-stmt",
+ and the IDs of processed and merger 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. */
unsigned i;
exploded_node *enode;
if (seen.contains (stmt))
continue;
+ auto_vec<exploded_node *> processed_enodes;
+ auto_vec<exploded_node *> merger_enodes;
/* This is O(N^2). */
unsigned j;
- auto_vec<exploded_node *> enodes;
exploded_node *other_enode;
FOR_EACH_VEC_ELT (m_nodes, j, other_enode)
{
if (other_enode->get_point ().get_kind () != PK_BEFORE_STMT)
continue;
if (other_enode->get_stmt () == stmt)
- enodes.safe_push (other_enode);
+ switch (other_enode->get_status ())
+ {
+ default:
+ gcc_unreachable ();
+ case exploded_node::STATUS_PROCESSED:
+ processed_enodes.safe_push (other_enode);
+ break;
+ case exploded_node::STATUS_MERGER:
+ merger_enodes.safe_push (other_enode);
+ break;
+ }
}
pretty_printer pp;
- print_enode_indices (&pp, enodes);
+ pp_character (&pp, '[');
+ print_enode_indices (&pp, processed_enodes);
+ if (merger_enodes.length () > 0)
+ {
+ pp_string (&pp, "] merger(s): [");
+ print_enode_indices (&pp, merger_enodes);
+ }
+ pp_character (&pp, ']');
- warning_n (stmt->location, 0, enodes.length (),
- "%i exploded node: %s",
- "%i exploded nodes: %s",
- enodes.length (), pp_formatted_text (&pp));
+ warning_n (stmt->location, 0, processed_enodes.length (),
+ "%i processed enode: %s",
+ "%i processed enodes: %s",
+ processed_enodes.length (), pp_formatted_text (&pp));
seen.add (stmt);
/* If the argument is non-zero, then print all of the states
if (i_arg)
{
exploded_node *other_enode;
- FOR_EACH_VEC_ELT (enodes, j, other_enode)
+ FOR_EACH_VEC_ELT (processed_enodes, j, other_enode)
{
fprintf (stderr, "%i of %i: EN %i:\n",
- j + 1, enodes.length (), other_enode->m_index);
+ j + 1, processed_enodes.length (),
+ other_enode->m_index);
other_enode->dump_succs_and_preds (stderr);
/* Dump state. */
other_enode->get_state ().dump (m_ext_state, false);
class exploded_node : public dnode<eg_traits>
{
public:
+ /* Has this enode had exploded_graph::process_node called on it?
+ This allows us to distinguish enodes that were merged during
+ worklist-handling, and thus never had process_node called on them
+ (in favor of processing the merged node). */
+ enum status
+ {
+ /* Node is in the worklist. */
+ STATUS_WORKLIST,
+
+ /* Node has had exploded_graph::process_node called on it. */
+ STATUS_PROCESSED,
+
+ /* Node was left unprocessed due to merger; it won't have had
+ exploded_graph::process_node called on it. */
+ STATUS_MERGER
+ };
+
exploded_node (point_and_state ps,
int index)
- : m_ps (ps), m_index (index)
+ : m_ps (ps), m_status (STATUS_WORKLIST), m_index (index)
{
gcc_checking_assert (ps.get_state ().m_region_model->canonicalized_p ());
}
void dump_succs_and_preds (FILE *outf) const;
+ enum status get_status () const { return m_status; }
+ void set_status (enum status status)
+ {
+ gcc_assert (m_status == STATUS_WORKLIST);
+ m_status = status;
+ }
+
private:
DISABLE_COPY_AND_ASSIGN (exploded_node);
is immutable once the exploded_node has been created. */
const point_and_state m_ps;
+ enum status m_status;
+
public:
/* The index of this exploded_node. */
const int m_index;
will emit a placeholder ``note'' diagnostic with a path to that call site,
if the analyzer finds a feasible path to it.
-The builtin @code{__analyzer_dump_exploded_nodes} will dump information
-after analysis on all of the exploded nodes at that program point:
+The builtin @code{__analyzer_dump_exploded_nodes} will emit a warning
+after analysis containing information on all of the exploded nodes at that
+program point:
@smallexample
__analyzer_dump_exploded_nodes (0);
@end smallexample
-will dump just the number of nodes, and their IDs.
+will output the number of ``processed'' nodes, and the IDs of
+both ``processed'' and ``merger'' nodes, such as:
+
+@smallexample
+warning: 2 processed enodes: [EN: 56, EN: 58] merger(s): [EN: 54-55, EN: 57, EN: 59]
+@end smallexample
+
+With a non-zero argument
@smallexample
__analyzer_dump_exploded_nodes (1);
@end smallexample
-will also dump all of the states within those nodes.
+it will also dump all of the states within the ``processed'' nodes.
@smallexample
__analyzer_dump_region_model ();
+2020-02-05 David Malcolm <dmalcolm@redhat.com>
+
+ * gcc.dg/analyzer/data-model-1.c: Update for changed output to
+ __analyzer_dump_exploded_nodes, dropping redundant call at merger.
+ * gcc.dg/analyzer/data-model-7.c: Likewise.
+ * gcc.dg/analyzer/loop-2.c: Update for changed output format.
+ * gcc.dg/analyzer/loop-2a.c: Likewise.
+ * gcc.dg/analyzer/loop-4.c: Likewise.
+ * gcc.dg/analyzer/loop.c: Likewise.
+ * gcc.dg/analyzer/malloc-paths-10.c: Likewise; drop redundant
+ call at merger.
+ * gcc.dg/analyzer/malloc-vs-local-1a.c: Likewise.
+ * gcc.dg/analyzer/malloc-vs-local-1b.c: Likewise.
+ * gcc.dg/analyzer/malloc-vs-local-2.c: Likewise.
+ * gcc.dg/analyzer/malloc-vs-local-3.c: Likewise.
+ * gcc.dg/analyzer/paths-1.c: Likewise.
+ * gcc.dg/analyzer/paths-1a.c: Likewise.
+ * gcc.dg/analyzer/paths-2.c: Likewise.
+ * gcc.dg/analyzer/paths-3.c: Likewise.
+ * gcc.dg/analyzer/paths-4.c: Update for changed output format.
+ * gcc.dg/analyzer/paths-5.c: Likewise.
+ * gcc.dg/analyzer/paths-6.c: Likewise; drop redundant calls
+ at merger.
+ * gcc.dg/analyzer/paths-7.c: Likewise.
+ * gcc.dg/analyzer/torture/conditionals-2.c: Update for changed
+ output format.
+ * gcc.dg/analyzer/zlib-1.c: Likewise; drop redundant calls.
+ * gcc.dg/analyzer/zlib-5.c: Update for changed output format.
+
2020-02-05 Jakub Jelinek <jakub@redhat.com>
PR target/92190
i = 17;
/* With state-merging, we lose the relationship between 'flag' and 'i'. */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (flag)
__analyzer_eval (i == 43); /* { dg-warning "UNKNOWN" } */
i = 17;
/* Without state-merging, we retain the relationship between 'flag' and 'i'. */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (flag)
__analyzer_eval (i == 43); /* { dg-warning "TRUE" } */
{
struct s s;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
for (s.i=0; s.i<256; s.i++) {
__analyzer_eval (s.i < 256); /* { dg-warning "TRUE" } */
/* (should report TRUE twice). */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
//__analyzer_eval (s.i == 0); /* { d-todo-g-warning "UNKNOWN" "" { xfail *-*-* } } */
/* { d-todo-g-warning "TRUE" "" { target *-*-* } .-1 } */
/* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
/* TODO(xfail^^^): ideally it should figure out i == 256 at exit. */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
}
{
union u u;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
for (u.i=0; u.i<256; u.i++) {
/* { dg-bogus "UNKNOWN" "status quo" { xfail *-*-* } .-2 } */
/* (should report TRUE twice). */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
//__analyzer_eval (u.i == 0); /* { d-todo-g-warning "UNKNOWN" "" { xfail *-*-* } } */
/* { d-todo-g-warning "TRUE" "" { target *-*-* } .-1 } */
/* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
/* TODO(xfail^^^): ideally it should figure out i == 256 at exit. */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
}
{
int i, j, k;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
for (i=0; i<256; i++) {
__analyzer_eval (j < 256); /* { dg-warning "TRUE" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
for (k=0; k<256; k++) {
__analyzer_eval (k < 256); /* { dg-warning "TRUE" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "4 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "4 processed enodes" } */
}
}
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
}
{
int i;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
for (i=0; i<256; i++) {
__analyzer_eval (i < 256); /* { dg-warning "TRUE" } */
/* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-2 } */
/* TODO(xfail^^^): ideally we ought to figure out i >= 0 for all iterations. */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
}
__analyzer_eval (i >= 256); /* { dg-warning "TRUE" } */
/* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
/* TODO(xfail^^^): it only figures out i >= 256, rather than i == 256. */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
}
other_flag = 0;
/* With state-merging, we lose the relationship between 'flag' and 'other_flag'. */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (other_flag)
__analyzer_eval (flag); /* { dg-warning "UNKNOWN" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
// FIXME: why 3 here?
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
// FIXME: why 3 here?
if (n > 10)
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff_2 (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
// FIXME: why 3 here?
if (need_to_free)
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
// FIXME: why 3 here?
if (ptr != buf)
/* Due to state-merging, we lose the relationship between 'n > 10'
and 'on_heap' here; we have to rely on feasibility-checking
in the diagnostic_manager to reject the false warnings. */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (on_heap)
ptr = (int *)malloc (sizeof (int) * n);
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 processed enodes" } */
// FIXME: why 5 here?
if (n > 10)
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff_2 (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (need_to_free)
free (ptr); /* { dg-bogus "not on the heap" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (ptr != buf)
free (ptr); /* { dg-bogus "not on the heap" } */
/* Due to state-merging, we lose the relationship between 'n > 10'
and 'on_heap' here; we have to rely on feasibility-checking
in the diagnostic_manager to reject the false warnings. */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (on_heap)
ptr = (int *)malloc (sizeof (int) * n);
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
{
int *p = ptr;
result = sum;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
{
int *p = ptr;
result = sum;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff_2 (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (n > 10)
free (ptr); /* { dg-bogus "not on the heap" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
{
int *p = ptr;
result = sum;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
if (need_to_free)
free (ptr); /* { dg-bogus "not on the heap" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
{
int *p = ptr;
result = sum;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
if (ptr != buf)
free (ptr); /* { dg-bogus "not on the heap" } */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
{
int *p = ptr;
result = sum;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
return result; /* { dg-message "leak of 'p'" } */
/* FIXME: should this be 'ptr'? */
else
ptr = buf;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
result = do_stuff_2 (ptr, n);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
return result; /* { dg-message "leak of 'ptr'" } */
}
bar (0);
else
bar (1);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
}
bar (0);
else
bar (1);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
}
return (-2);
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
-
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
return 0;
}
return (-2);
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "4 exploded nodes" } */
-
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
return 0;
}
else
p = malloc (32);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "4 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (a > 5)
{
free (p);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
}
return 0; /* { dg-bogus "leak" } */
else
p = malloc (32);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "4 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (a > 6) /* different condition */
{
free (p);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
}
return 0; /* { dg-warning "leak of 'p'" } */
int test_1 (struct state *s)
{
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
while (1)
{
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+ /* TODO: why does the above need an extra stmt to merge state? */
do_stuff (s, s->mode);
}
}
int test_2 (struct state *s)
{
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
while (1)
{
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "3 processed enodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
+ /* TODO: why does the above need an extra stmt to merge state? */
switch (s->mode)
{
case 0:
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
do_stuff (s, 0);
break;
case 1:
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
do_stuff (s, 17);
break;
case 2:
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
do_stuff (s, 5);
break;
case 3:
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
return 42;
case 4:
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
return -3;
}
}
void test (int *p, int n)
{
int i;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
for (i = 0; i < n; i++)
{
p[i] = i; /* { dg-bogus "uninitialized" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
}
}
a = 3;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- // FIXME: the above can vary between 2 and 3 exploded nodes
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
__analyzer_eval (a == 3); /* { dg-warning "TRUE" } */
__analyzer_eval (b == 4); /* { dg-warning "TRUE" } */
}
f = 3;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
__analyzer_eval (f == 3); /* { dg-warning "TRUE" } */
__analyzer_eval (g == 4); /* { dg-warning "TRUE" } */
}
break;
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "6 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enode" } */
__analyzer_eval (f == 3); /* { dg-warning "TRUE" } */
__analyzer_eval (g == 4); /* { dg-warning "TRUE" } */
__analyzer_eval (h == 5); /* { dg-warning "TRUE" } */
q = malloc (256);
p = malloc (256);
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
free (p);
free (q);
}
int sum = 0;
int i;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (flag)
free (ptr);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
for (i = 0; i < n; i++)
p[i] = i;
sum += foo (p[i]); /* { dg-bogus "uninitialized" } */
result = sum;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
if (flag)
free (ptr); /* { dg-warning "double-'free' of 'ptr'" } */
void *ptr = malloc (16);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (flag)
free (ptr);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */
for (i = 0; i < n; i++)
p[i] = i;
sum += foo (p[i]); /* { dg-bogus "uninitialized" } */
result = sum;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 exploded nodes" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "5 processed enodes" } */
// FIXME: why 5 here?
free (ptr); /* { dg-warning "double-'free' of 'ptr'" } */
static void __attribute__((noinline))
test_1_callee (void *p, void *q)
{
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
__analyzer_eval (p == Z_NULL); /* { dg-warning "FALSE" } */
__analyzer_eval (p != Z_NULL); /* { dg-warning "TRUE" } */
static void __attribute__((noinline))
test_2_callee (void *p, void *q)
{
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
__analyzer_eval (p == Z_NULL); /* { dg-warning "FALSE" } */
__analyzer_eval (p != Z_NULL); /* { dg-warning "TRUE" } */
{
int status;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (strm == 0 || strm->state == 0)
return (-2);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
status = strm->state->status;
if (status != 42 && status != 113 && status != 666) {
return (-2);
}
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "4 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (strm->state->pending_buf)
(*(strm->zfree))(strm->opaque, (void *)(strm->state->pending_buf));
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (strm->state->head)
(*(strm->zfree))(strm->opaque, (void *)(strm->state->head));
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (strm->state->prev)
(*(strm->zfree))(strm->opaque, (void *)(strm->state->prev));
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
if (strm->state->window)
(*(strm->zfree))(strm->opaque, (void *)(strm->state->window));
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
(*(strm->zfree))(strm->opaque, (void *)(strm->state));
strm->state = 0;
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
return status == 113 ? (-3) : 0;
}
if (compr == 0 || uncompr == 0)
exit(1);
- __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+ __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
test_compress(compr, comprLen, uncompr, uncomprLen);