]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
middle-end/119706 - allow POLY_INT_CST as is_gimple_mem_ref_addr
authorRichard Biener <rguenther@suse.de>
Thu, 10 Apr 2025 11:30:42 +0000 (13:30 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 10 Apr 2025 12:34:29 +0000 (14:34 +0200)
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.

gcc/gimple-expr.cc

index a670e4648d3f697340fdd72689a72351473299f0..c0367f490d69ee6f88b7997aa1328a5851908c6c 100644 (file)
@@ -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)))));