https://gcc.gnu.org/g:e6f4fb7734f6b802417fa5bd833eea9175e1e3ca

commit r16-5855-ge6f4fb7734f6b802417fa5bd833eea9175e1e3ca
Author: Pierre-Emmanuel Patry <[email protected]>
Date:   Thu Nov 27 13:08:12 2025 +0100

    gccrs: Initialize uninit boolean
    
    Fixes #122886
    
    gcc/rust/ChangeLog:
    
            * backend/rust-constexpr.cc (eval_binary_expression): Set initial 
value
            equality value to false.
    
    Signed-off-by: Pierre-Emmanuel Patry <[email protected]>

Diff:
---
 gcc/rust/backend/rust-constexpr.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/backend/rust-constexpr.cc 
b/gcc/rust/backend/rust-constexpr.cc
index d04f8643306e..e32ba3abd4f0 100644
--- a/gcc/rust/backend/rust-constexpr.cc
+++ b/gcc/rust/backend/rust-constexpr.cc
@@ -3137,7 +3137,7 @@ eval_binary_expression (const constexpr_ctx *ctx, tree t, 
bool lval,
        {
          tree lmem = PTRMEM_CST_MEMBER (lhs);
          tree rmem = PTRMEM_CST_MEMBER (rhs);
-         bool eq;
+         bool eq = false;
          if (TREE_CODE (lmem) == TREE_CODE (rmem)
              && TREE_CODE (lmem) == FIELD_DECL
              && TREE_CODE (DECL_CONTEXT (lmem)) == UNION_TYPE

Reply via email to