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

commit r15-9358-gbf812c6ad83ec0b241bb3fecc7e68f883b6083df
Author: Richard Biener <rguent...@suse.de>
Date:   Thu Apr 10 13:30:42 2025 +0200

    middle-end/119706 - allow POLY_INT_CST as is_gimple_mem_ref_addr
    
    We currently only INTEGER_CST, but not POLY_INT_CST, which leads
    to the situation that when the POLY_INT_CST is only indrectly
    present via a SSA def the IL is valid but when propagated it's not.
    That's unsustainable.
    
            PR middle-end/119706
            * gimple-expr.cc (is_gimple_mem_ref_addr): Also allow
            POLY_INT_CST.

Diff:
---
 gcc/gimple-expr.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/gimple-expr.cc b/gcc/gimple-expr.cc
index a670e4648d3f..c0367f490d69 100644
--- a/gcc/gimple-expr.cc
+++ b/gcc/gimple-expr.cc
@@ -884,7 +884,7 @@ bool
 is_gimple_mem_ref_addr (tree t)
 {
   return (is_gimple_reg (t)
-         || TREE_CODE (t) == INTEGER_CST
+         || poly_int_tree_p (t)
          || (TREE_CODE (t) == ADDR_EXPR
              && (CONSTANT_CLASS_P (TREE_OPERAND (t, 0))
                  || decl_address_invariant_p (TREE_OPERAND (t, 0)))));

Reply via email to