https://gcc.gnu.org/g:1266c7794bcc13945e0b56addab0832c3a994e95

commit 1266c7794bcc13945e0b56addab0832c3a994e95
Author: Mikael Morin <[email protected]>
Date:   Tue Sep 30 15:08:54 2025 +0200

    gimple-simulate: Sauvegarde modifs

Diff:
---
 gcc/gimple-simulate.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gcc/gimple-simulate.cc b/gcc/gimple-simulate.cc
index adf02ed29610..428b8a172cec 100644
--- a/gcc/gimple-simulate.cc
+++ b/gcc/gimple-simulate.cc
@@ -1079,7 +1079,7 @@ select_subref (simul_scope & context, tree data_ref, 
unsigned offset,
   if (val_type == VAL_ADDRESS)
     min_size = HOST_BITS_PER_PTR;
   else
-    min_size = CHAR_BIT;
+    min_size = 1;
 
   int first_ignored = 0;
   tree default_ref = NULL_TREE;
@@ -1987,8 +1987,10 @@ simul_valueize (tree t)
 {
   if (TREE_CODE (t) == SSA_NAME)
     {
-      gimple * def = SSA_NAME_DEF_STMT (t);
+      if (SSA_NAME_IS_DEFAULT_DEF (t))
+       return simul_valueize (SSA_NAME_VAR (t));
 
+      gimple * def = SSA_NAME_DEF_STMT (t);
       if (gimple_code (def) == GIMPLE_ASSIGN
          && gimple_assign_rhs_code (def) == ADDR_EXPR)
        return gimple_assign_rhs1 (def);
@@ -2094,7 +2096,8 @@ simul_scope::evaluate (tree expr) const
            gcc_assert (is_constant && off >= 0);
            unsigned off_bits = off * CHAR_BIT;
 
-           if (TREE_CODE (var) == VAR_DECL)
+           if (TREE_CODE (var) == VAR_DECL
+               || TREE_CODE (var) == PARM_DECL)
              {
                data_storage *strg = find_reachable_var (var);
                gcc_assert (strg != nullptr);

Reply via email to