https://gcc.gnu.org/g:75d789cc46aa5a680db11715b1130fe14c23be29

commit 75d789cc46aa5a680db11715b1130fe14c23be29
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Fri May 9 13:29:56 2025 +0200

    Correction régression power_4

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

diff --git a/gcc/tree.cc b/gcc/tree.cc
index 86e6515f9cee..eccfcc89da40 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -13058,17 +13058,7 @@ 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))
-    {
-      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;
-    }
+    return SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_MAX_VALUE (domain_type), exp);
 
   /* Otherwise fail.  */
   return NULL_TREE;

Reply via email to