diff options
author | Mikael Morin <morin-mikael@orange.fr> | 2025-08-05 14:58:03 +0200 |
---|---|---|
committer | Mikael Morin <mikael@gcc.gnu.org> | 2025-08-05 22:35:07 +0200 |
commit | 14ca0646962f291d1b13497b35061020a97305b4 (patch) | |
tree | cdab8b0aa64dc006eb77f64ba2aaa9bbb9186c76 | |
parent | 0634bd56978478c567a29841b6f99ac7050764e6 (diff) | |
download | gcc-14ca0646962f291d1b13497b35061020a97305b4.zip gcc-14ca0646962f291d1b13497b35061020a97305b4.tar.gz gcc-14ca0646962f291d1b13497b35061020a97305b4.tar.bz2 |
fortran: Remove overwrite of polymorphic associate variable offset
The array descriptor returned by gfc_conv_expr_descriptor should be
usable as is. No need to overwrite the offset.
gcc/fortran/ChangeLog:
* trans-stmt.cc (trans_associate_var): Remove overwrite of
the polymorphic associate variable's array descriptor offset.
-rw-r--r-- | gcc/fortran/trans-stmt.cc | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/gcc/fortran/trans-stmt.cc b/gcc/fortran/trans-stmt.cc index 5974e40..f4e6c57 100644 --- a/gcc/fortran/trans-stmt.cc +++ b/gcc/fortran/trans-stmt.cc @@ -1876,9 +1876,6 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block) bool class_target; bool unlimited; tree desc; - tree offset; - tree dim; - int n; tree charlen; bool need_len_assign; bool whole_array = true; @@ -2292,21 +2289,6 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block) desc = gfc_class_data_get (se.expr); - /* Set the offset. */ - offset = gfc_index_zero_node; - for (n = 0; n < e->rank; n++) - { - dim = gfc_rank_cst[n]; - tmp = fold_build2_loc (input_location, MULT_EXPR, - gfc_array_index_type, - gfc_conv_descriptor_stride_get (desc, dim), - gfc_conv_descriptor_lbound_get (desc, dim)); - offset = fold_build2_loc (input_location, MINUS_EXPR, - gfc_array_index_type, - offset, tmp); - } - gfc_conv_descriptor_offset_set (&se.pre, desc, offset); - if (need_len_assign) { if (e->symtree |