]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
analyzer: rename --param=analyzer-{bb->supernode}-explosion-factor=
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 18 May 2026 20:33:34 +0000 (16:33 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Mon, 18 May 2026 20:33:34 +0000 (16:33 -0400)
This param name is confusing, due to it changing meaning in
r16-6063-g0b786d961d4426.  Update the name to better express what it now
controls, and clarify the wording of the warning that fires when that
limit is hit by the analyzer, and to give more info.

gcc/analyzer/ChangeLog:
* analyzer.opt (-param=analyzer-bb-explosion-factor=): Rename to...
(-param=analyzer-supernode-explosion-factor=): ...this.
* engine.cc (exploded_graph::process_worklist): Update for change
to param name.  Clarify the -Wanalyzer-too-complex message when
hitting the overall limit on enodes by also showing the number
of snodes.

gcc/ChangeLog:
* doc/analyzer.texi: Update for change in param name.
* doc/params.texi: Likewise.  Clarify wording.

gcc/testsuite/ChangeLog:
* c-c++-common/analyzer/fibonacci.c: Update for change in message
wording.
* c-c++-common/analyzer/raw-data-cst-pr117262-1.c: Update for
change in param name.
* gcc.dg/analyzer/explode-2a.c: Likewise.
* gcc.dg/analyzer/pr93032-mztools-signed-char.c: Likewise.
* gcc.dg/analyzer/pr93032-mztools-unsigned-char.c: Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/analyzer.opt
gcc/analyzer/engine.cc
gcc/doc/analyzer.texi
gcc/doc/params.texi
gcc/testsuite/c-c++-common/analyzer/fibonacci.c
gcc/testsuite/c-c++-common/analyzer/raw-data-cst-pr117262-1.c
gcc/testsuite/gcc.dg/analyzer/explode-2a.c
gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c

index 992ef9f8a08fa9e142c6630fb1880cd15959e6af..5e2d913a7ce8d6333f1e22fafd442497f51cb31f 100644 (file)
 
 ; Please try to keep this file in ASCII collating order.
 
--param=analyzer-bb-explosion-factor=
-Common Joined UInteger Var(param_analyzer_bb_explosion_factor) Init(5) Param
-The maximum number of 'after supernode' exploded nodes within the analyzer per supernode, before terminating analysis.
-
 -param=analyzer-max-enodes-per-program-point=
 Common Joined UInteger Var(param_analyzer_max_enodes_per_program_point) Init(8) Param
 The maximum number of exploded nodes per program point within the analyzer, before terminating analysis of that point.
@@ -54,6 +50,10 @@ The minimum number of supernodes within a function for the analyzer to consider
 Common Joined UInteger Var(param_analyzer_max_enodes_for_full_dump) Init(200) Param
 The maximum depth of exploded nodes that should appear in a dot dump before switching to a less verbose format.
 
+-param=analyzer-supernode-explosion-factor=
+Common Joined UInteger Var(param_analyzer_supernode_explosion_factor) Init(5) Param
+The maximum number of exploded nodes within the analyzer per supernode, before terminating analysis.
+
 -param=analyzer-text-art-string-ellipsis-threshold=
 Common Joined UInteger Var(param_analyzer_text_art_string_ellipsis_threshold) Init(15) Param
 The number of bytes at which to ellipsize string literals in analyzer text art diagrams.
index 16af51e6ad705426f33cbf5f10185c7d19c4ae70..d31cb5d9d17837ca8c09f07ff0a4c2a0d384c58f 100644 (file)
@@ -3152,7 +3152,7 @@ exploded_graph::process_worklist ()
         explosion (or bugs).  */
       const int limit
        = (// Per-supernode limit:
-          (m_sg.num_nodes () * param_analyzer_bb_explosion_factor)
+          (m_sg.num_nodes () * param_analyzer_supernode_explosion_factor)
           // Allow one for the "origin" enode:
           + 1);
       if (m_global_stats.m_num_nodes > limit)
@@ -3162,8 +3162,9 @@ exploded_graph::process_worklist ()
          warning_at (node->get_point ().get_location (),
                      OPT_Wanalyzer_too_complex,
                      "analysis bailed out early"
-                     " (%i enodes)",
-                     m_nodes.length ());
+                     " (%i enodes for %i snodes)",
+                     m_nodes.length (),
+                     m_sg.num_nodes ());
          return;
        }
     }
index c9f5a3acbff5d20b347f1a12088f321f3c698624..d530ea497a5d52f6e836ebbb63e9441fc2ea9ad4 100644 (file)
@@ -34,7 +34,7 @@ just emit warnings.
 The gimple representation can be seen using @option{-fdump-ipa-analyzer}.
 @quotation Tip
 If the analyzer ICEs before this is written out, one workaround is to use
-@option{--param=analyzer-bb-explosion-factor=0} to force the analyzer
+@option{--param=analyzer-supernode-explosion-factor=0} to force the analyzer
 to bail out after analyzing the first basic block.
 @end quotation
 
index e6c89607e0d832fb3b5941af577dab0557402a84..8d0eb971964f33944f3faf1233f5994e4287062e 100644 (file)
@@ -1877,9 +1877,9 @@ a diagnostic as infeasible.
 The number of executions of a basic block that is considered hot.
 The parameter is used only in GIMPLE FE.
 
-@paindex analyzer-bb-explosion-factor
-@item analyzer-bb-explosion-factor
-The maximum number of ``after supernode'' exploded nodes within the analyzer
+@paindex analyzer-supernode-explosion-factor
+@item analyzer-supernode-explosion-factor
+The maximum number of exploded nodes within the analyzer
 per supernode, before terminating analysis.
 
 @paindex analyzer-text-art-string-ellipsis-threshold
index 0b24314bc2305e90bca04ae833da96600ae61906..f0a8cee74aad44747c76fb24ead5b588b21970e2 100644 (file)
@@ -6,4 +6,4 @@ int fib (int n)
     return n;
 } 
 
-/* { dg-regexp "\[^\n\r\]+: warning: analysis bailed out early \\(\[0-9\]+ enodes\\) \[^\n\r\]*" } */
+/* { dg-regexp "\[^\n\r\]+: warning: analysis bailed out early \\(\[0-9\]+ enodes for \[0-9\]+ snodes\\) \[^\n\r\]*" } */
index bf2b09c857d9c0e0a233aa43252dba7b0cb0e819..e25d397e592015b1071dbf64581aeb1ff486b1ab 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-additional-options "--param analyzer-max-enodes-per-program-point=50 --param analyzer-bb-explosion-factor=50" } */
+/* { dg-additional-options "--param analyzer-max-enodes-per-program-point=50 --param analyzer-supernode-explosion-factor=50" } */
 
 int
 main ()
index d07ce5b270a1e9080e2dfd1068bbcf23f81c1660..2a3c8367a9801ba0f0998b21a1e491f8ccc1c30d 100644 (file)
@@ -1,6 +1,6 @@
 /* PR analyzer/101068.  */
 
-/* { dg-additional-options "--param analyzer-max-enodes-per-program-point=200 --param analyzer-bb-explosion-factor=50" } */
+/* { dg-additional-options "--param analyzer-max-enodes-per-program-point=200 --param analyzer-supernode-explosion-factor=50" } */
 
 #include <stdlib.h>
 
index 575776c8a2a56b2b89a492c1a27d6232e19f779c..cc30e0fe6a079064b8631f81349171997e164b91 100644 (file)
@@ -8,7 +8,7 @@
 /* { dg-require-effective-target int32plus } */
 
 /* TODO (PR analyzer/112528): remove need for this.  */
-/* { dg-additional-options "--param analyzer-max-enodes-per-program-point=200 --param analyzer-bb-explosion-factor=50" } */
+/* { dg-additional-options "--param analyzer-max-enodes-per-program-point=200 --param analyzer-supernode-explosion-factor=50" } */
 
 /* Minimal replacement of system headers.  */
 
index 1ee16c3faad2011ace4ef55cd4a0b2ae5e22a716..5b3b5c68217cdc7e8f232ce0b73069addaae6ae5 100644 (file)
@@ -8,7 +8,7 @@
 /* { dg-require-effective-target int32plus } */
 
 /* TODO (PR analyzer/112528): remove need for this.  */
-/* { dg-additional-options "--param analyzer-max-enodes-per-program-point=200 --param analyzer-bb-explosion-factor=50" } */
+/* { dg-additional-options "--param analyzer-max-enodes-per-program-point=200 --param analyzer-supernode-explosion-factor=50" } */
 
 /* Minimal replacement of system headers.  */