analyzer.texi documents --param=analyzer-bb-explosion-factor=0 as a way
to make the analysis bail out early, but I broke this in
r16-6063-g0b786d961d4426.
Fix thusly.
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r16-6824-g160a3995f4ccf0.
gcc/analyzer/ChangeLog:
* engine.cc (exploded_graph::process_worklist): Remove guard on
limit being non-zero when checking for -Wanalyzer-too-complex
on overall number of exploded nodes. Allow for the origin enode.
Signed-off-by: David Malcolm <[email protected]>
---
gcc/analyzer/engine.cc | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 5222f9e32dd..2d22abf0530 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -3400,19 +3400,22 @@ exploded_graph::process_worklist ()
/* Impose a hard limit on the number of exploded nodes, to ensure
that the analysis terminates in the face of pathological state
explosion (or bugs). */
- if (const int limit
- = m_sg.num_nodes () * param_analyzer_bb_explosion_factor)
- if (m_global_stats.m_num_nodes > limit)
- {
- if (logger)
- logger->log ("bailing out; too many nodes");
- warning_at (node->get_point ().get_location (),
- OPT_Wanalyzer_too_complex,
- "analysis bailed out early"
- " (%i enodes)",
- m_nodes.length ());
- return;
- }
+ const int limit
+ = (// Per-supernode limit:
+ (m_sg.num_nodes () * param_analyzer_bb_explosion_factor)
+ // Allow one for the "origin" enode:
+ + 1);
+ if (m_global_stats.m_num_nodes > limit)
+ {
+ if (logger)
+ logger->log ("bailing out; too many nodes");
+ warning_at (node->get_point ().get_location (),
+ OPT_Wanalyzer_too_complex,
+ "analysis bailed out early"
+ " (%i enodes)",
+ m_nodes.length ());
+ return;
+ }
}
}
--
2.26.3