[gcc(refs/users/mikael/heads/refactor_descriptor_v05)] Revert "Correction régression power_4"

Mikael Morin mikael@gcc.gnu.org
Fri Jun 13 15:04:22 GMT 2025


https://gcc.gnu.org/g:5851276ec00d2693fd38a276d32d728a166be101

commit 5851276ec00d2693fd38a276d32d728a166be101
Author: Mikael Morin <mikael@gcc.gnu.org>
Date:   Wed May 14 10:11:03 2025 +0200

    Revert "Correction régression power_4"
    
    This reverts commit 75d789cc46aa5a680db11715b1130fe14c23be29.

Diff:
---
 gcc/tree.cc | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gcc/tree.cc b/gcc/tree.cc
index c8b8b3edd35a..fa5df47e8111 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -13046,7 +13046,17 @@ array_ref_up_bound (tree exp)
   /* If there is a domain type and it has an upper bound, use it, substituting
      for a PLACEHOLDER_EXPR as needed.  */
   if (domain_type && TYPE_MAX_VALUE (domain_type))
-    return SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_MAX_VALUE (domain_type), exp);
+    {
+      tree val = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_MAX_VALUE (domain_type), exp);
+      if (TREE_OPERAND (exp, 2))
+        return fold_build2_loc (EXPR_LOCATION (exp), PLUS_EXPR,
+				TREE_TYPE (val), val,
+				fold_convert_loc (EXPR_LOCATION (exp),
+						  TREE_TYPE (val),
+						  TREE_OPERAND (exp, 2)));
+      else
+	return val;
+    }
 
   /* Otherwise fail.  */
   return NULL_TREE;


More information about the Gcc-cvs mailing list