https://gcc.gnu.org/g:bec9cb8de934b8f191ef81e38f3757f8db787d8b
commit bec9cb8de934b8f191ef81e38f3757f8db787d8b Author: Mikael Morin <mik...@gcc.gnu.org> Date: Thu Feb 6 17:22:49 2025 +0100 Correction compil' Diff: --- gcc/fortran/trans-array.cc | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index bcdc89ac8133..afec6dcc45cb 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -1593,6 +1593,23 @@ conv_shift_descriptor (stmtblock_t *block, tree desc, int rank, } +class conditional_lb +{ + tree cond; +public: + conditional_lb (tree arg_cond) + : cond (arg_cond) { } + + tree lower_bound (tree src, int n) const { + tree lbound = gfc_conv_descriptor_lbound_get (src, gfc_rank_cst[n]); + lbound = fold_build3_loc (input_location, COND_EXPR, + gfc_array_index_type, cond, + gfc_index_one_node, lbound); + return lbound; + } +}; + + static void gfc_conv_shift_descriptor (stmtblock_t *block, tree dest, tree src, int rank, const conditional_lb &lb) @@ -1610,7 +1627,7 @@ gfc_conv_shift_descriptor (stmtblock_t *block, tree dest, tree src, lbound = lb.lower_bound (dest, n); lbound = gfc_evaluate_now (lbound, block); - conv_shift_descriptor_lbound (block, src, dest, dim, lbound, offset_var); + conv_shift_descriptor_lbound (block, src, dest, n, lbound, offset_var); } gfc_conv_descriptor_offset_set (block, dest, offset_var); @@ -1886,23 +1903,6 @@ gfc_conv_remap_descriptor (stmtblock_t *block, tree dest, tree src, } -class conditional_lb -{ - tree cond; -public: - conditional_lb (tree arg_cond) - : cond (arg_cond) { } - - tree lower_bound (tree src, int n) const { - tree lbound = gfc_conv_descriptor_lbound_get (src, gfc_rank_cst[n]); - lbound = fold_build3_loc (input_location, COND_EXPR, - gfc_array_index_type, cond, - gfc_index_one_node, lbound); - return lbound; - } -}; - - void gfc_conv_shift_descriptor (stmtblock_t *block, tree dest, tree src, int rank, tree zero_cond)