]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
analyzer: fix for older version of GCC
authorMarc Poulhiès <dkm@kataplop.net>
Tue, 29 Apr 2025 17:53:42 +0000 (19:53 +0200)
committerMarc Poulhiès <dkm@kataplop.net>
Tue, 29 Apr 2025 20:21:30 +0000 (22:21 +0200)
Having both an enum and a variable with the same name triggers an error with
gcc 5.

  exploded-graph.h:351:29: error: ‘status’ is not a class, namespace, or enumeration

gcc/analyzer/ChangeLog:
* exploded-graph.h (set_status): Rename parameter.
* constraint-manager.cc (bound::ensure_closed): Likewise.
(range::add_bound): Likewise.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Reviewed-by: David Malcolm <dmalcolm@redhat.com>
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
gcc/analyzer/constraint-manager.cc
gcc/analyzer/exploded-graph.h

index a3e682c49389631c0a09cb16d8ed995157e6bba2..869e437d7c51a6907b336a19652038edc88841f6 100644 (file)
@@ -104,7 +104,7 @@ minus_one (tree cst)
    closed one.  */
 
 void
-bound::ensure_closed (enum bound_kind bound_kind)
+bound::ensure_closed (enum bound_kind bnd_kind)
 {
   if (!m_closed)
     {
@@ -113,7 +113,7 @@ bound::ensure_closed (enum bound_kind bound_kind)
         and convert x < 5 into x <= 4.  */
       gcc_assert (CONSTANT_CLASS_P (m_constant));
       gcc_assert (INTEGRAL_TYPE_P (TREE_TYPE (m_constant)));
-      m_constant = fold_build2 (bound_kind == bound_kind::upper ? MINUS_EXPR : PLUS_EXPR,
+      m_constant = fold_build2 (bnd_kind == bound_kind::upper ? MINUS_EXPR : PLUS_EXPR,
                                TREE_TYPE (m_constant),
                                m_constant, integer_one_node);
       gcc_assert (CONSTANT_CLASS_P (m_constant));
@@ -290,15 +290,15 @@ range::above_upper_bound (tree rhs_const) const
    Return true if feasible; false if infeasible.  */
 
 bool
-range::add_bound (bound b, enum bound_kind bound_kind)
+range::add_bound (bound b, enum bound_kind bnd_kind)
 {
   /* Bail out on floating point constants.  */
   if (!INTEGRAL_TYPE_P (TREE_TYPE (b.m_constant)))
     return true;
 
-  b.ensure_closed (bound_kind);
+  b.ensure_closed (bnd_kind);
 
-  switch (bound_kind)
+  switch (bnd_kind)
     {
     default:
       gcc_unreachable ();
index 32c72dc2076ab947eb230c69766f2093cc9aabb7..23e344d87e4aa3a823d6edae892eed69795ed19f 100644 (file)
@@ -346,10 +346,10 @@ class exploded_node : public dnode<eg_traits>
   void dump_succs_and_preds (FILE *outf) const;
 
   enum status get_status () const { return m_status; }
-  void set_status (enum status status)
+  void set_status (enum status s)
   {
     gcc_assert (m_status == status::worklist);
-    m_status = status;
+    m_status = s;
   }
 
   void add_diagnostic (const saved_diagnostic *sd)