From: Richard Biener Date: Thu, 10 Apr 2025 11:30:42 +0000 (+0200) Subject: middle-end/119706 - allow POLY_INT_CST as is_gimple_mem_ref_addr X-Git-Tag: releases/gcc-14.3.0~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8fe937b4ed5bcb93d6ae6ccdd497a55f1337dae;p=thirdparty%2Fgcc.git 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. (cherry picked from commit bf812c6ad83ec0b241bb3fecc7e68f883b6083df) --- diff --git a/gcc/gimple-expr.cc b/gcc/gimple-expr.cc index 0477c9d5f44..c58397b4380 100644 --- a/gcc/gimple-expr.cc +++ b/gcc/gimple-expr.cc @@ -879,7 +879,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)))));