https://gcc.gnu.org/g:3ba75485bb6cd721ffcd23e038613470270290c0

commit r17-576-g3ba75485bb6cd721ffcd23e038613470270290c0
Author: David Malcolm <[email protected]>
Date:   Mon May 18 16:33:34 2026 -0400

    analyzer: rename --param=analyzer-{bb->supernode}-explosion-factor=
    
    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 <[email protected]>

Diff:
---
 gcc/analyzer/analyzer.opt                                     | 8 ++++----
 gcc/analyzer/engine.cc                                        | 7 ++++---
 gcc/doc/analyzer.texi                                         | 2 +-
 gcc/doc/params.texi                                           | 6 +++---
 gcc/testsuite/c-c++-common/analyzer/fibonacci.c               | 2 +-
 gcc/testsuite/c-c++-common/analyzer/raw-data-cst-pr117262-1.c | 2 +-
 gcc/testsuite/gcc.dg/analyzer/explode-2a.c                    | 2 +-
 gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c   | 2 +-
 gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c | 2 +-
 9 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/gcc/analyzer/analyzer.opt b/gcc/analyzer/analyzer.opt
index 992ef9f8a08f..5e2d913a7ce8 100644
--- a/gcc/analyzer/analyzer.opt
+++ b/gcc/analyzer/analyzer.opt
@@ -22,10 +22,6 @@
 
 ; 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.
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 16af51e6ad70..d31cb5d9d178 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -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;
        }
     }
diff --git a/gcc/doc/analyzer.texi b/gcc/doc/analyzer.texi
index c9f5a3acbff5..d530ea497a5d 100644
--- a/gcc/doc/analyzer.texi
+++ b/gcc/doc/analyzer.texi
@@ -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
 
diff --git a/gcc/doc/params.texi b/gcc/doc/params.texi
index e6c89607e0d8..8d0eb971964f 100644
--- a/gcc/doc/params.texi
+++ b/gcc/doc/params.texi
@@ -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
diff --git a/gcc/testsuite/c-c++-common/analyzer/fibonacci.c 
b/gcc/testsuite/c-c++-common/analyzer/fibonacci.c
index 0b24314bc230..f0a8cee74aad 100644
--- a/gcc/testsuite/c-c++-common/analyzer/fibonacci.c
+++ b/gcc/testsuite/c-c++-common/analyzer/fibonacci.c
@@ -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\]*" } */
diff --git a/gcc/testsuite/c-c++-common/analyzer/raw-data-cst-pr117262-1.c 
b/gcc/testsuite/c-c++-common/analyzer/raw-data-cst-pr117262-1.c
index bf2b09c857d9..e25d397e5920 100644
--- a/gcc/testsuite/c-c++-common/analyzer/raw-data-cst-pr117262-1.c
+++ b/gcc/testsuite/c-c++-common/analyzer/raw-data-cst-pr117262-1.c
@@ -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 ()
diff --git a/gcc/testsuite/gcc.dg/analyzer/explode-2a.c 
b/gcc/testsuite/gcc.dg/analyzer/explode-2a.c
index d07ce5b270a1..2a3c8367a980 100644
--- a/gcc/testsuite/gcc.dg/analyzer/explode-2a.c
+++ b/gcc/testsuite/gcc.dg/analyzer/explode-2a.c
@@ -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>
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c 
b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
index 575776c8a2a5..cc30e0fe6a07 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
@@ -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.  */
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c 
b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
index 1ee16c3faad2..5b3b5c68217c 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
@@ -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.  */

Reply via email to