https://gcc.gnu.org/g:6cda43fa1821ccc7c256c3e1c532dff8453a4ce6

commit 6cda43fa1821ccc7c256c3e1c532dff8453a4ce6
Author: Mikael Morin <[email protected]>
Date:   Tue Oct 14 20:55:32 2025 +0200

    Correction régression class_dummy_8.f90

Diff:
---
 gcc/fortran/trans-array.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 73342da365b0..7d29672c574e 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -6803,7 +6803,10 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, 
tree * poffset,
          tmp = fold_build3_loc (input_location, COND_EXPR,
                                 gfc_array_index_type, cond,
                                 size, gfc_index_zero_node);
-         gfc_add_modify (pblock, size, tmp);
+         if (TREE_CODE (size) == VAR_DECL)
+           gfc_add_modify (pblock, size, tmp);
+         else
+           gcc_assert (TREE_CODE (size) == INTEGER_CST);
        }
 
       prev_stride = stride;

Reply via email to