[gcc r17-3559] forwprop: wrap long_mul_summand, long_mul_kind, and long_mul_extract in an anonymous namespace

Andrea Pinski via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:98a6b0be1dda04d3155723f596041a41fc18678b

commit r17-3559-g98a6b0be1dda04d3155723f596041a41fc18678b
Author: Andrea Pinski <[email protected]>
Date:   Sat Aug 22 19:05:35 2026 -0700

    forwprop: wrap long_mul_summand, long_mul_kind, and long_mul_extract in an anonymous namespace
    
    The way C++ works is struct (and enum) names are in the global scope
    so wrapping them in an anonymous namespaces makes sure they are local
    to the file and won't get an ODR conflict.
    
    Pushed as obvious after bootstrap/test on x86_64-linux-gnu.
    
    gcc/ChangeLog:
    
            * tree-ssa-forwprop.cc (enum long_mul_kind): Put in an anonymous namespace.
            (enum long_mul_extract): Likewise.
            (struct long_mul_summand): Likewise.
    
    Signed-off-by: Andrea Pinski <[email protected]>

Diff:
---
 gcc/tree-ssa-forwprop.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc
index c31dd1c94ec0..23a50decab11 100644
--- a/gcc/tree-ssa-forwprop.cc
+++ b/gcc/tree-ssa-forwprop.cc
@@ -3730,6 +3730,8 @@ static constexpr unsigned LONG_MUL_MAX_SUMMANDS = 4;
    arbitrarily long unrelated chain still bails early.  */
 static constexpr unsigned LONG_MUL_MAX_EXTRAS = 4;
 
+namespace {
+
 enum long_mul_kind {
   LMK_MUL_HIHI,
   LMK_MUL_LOLO,
@@ -3766,6 +3768,8 @@ struct long_mul_summand {
   unsigned HOST_WIDE_INT shift;
 };
 
+}
+
 /* Walk the OUTER addition or BIT_IOR chain rooted at STMT and collect
    the leaf operands into LEAVES.  Descends through single-use
    intermediate stmts of the same code.  Returns false once the leaf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.