https://gcc.gnu.org/g:2b6722f6d2f5886967d54dd089cf4b0dbf9c5d92
commit 2b6722f6d2f5886967d54dd089cf4b0dbf9c5d92 Author: Mikael Morin <[email protected]> Date: Tue Oct 7 11:30:57 2025 +0200 Correction régression result_in_spec_4.f90 Diff: --- gcc/fortran/trans-decl.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc index ca19dc28de6e..1f59e23011f7 100644 --- a/gcc/fortran/trans-decl.cc +++ b/gcc/fortran/trans-decl.cc @@ -1323,9 +1323,23 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy) || (sym->attr.function && sym == sym->result)) && gfc_return_by_reference (sym)) packed = PACKED_NO; - else if (as->type == AS_ASSUMED_SIZE - || as->type == AS_EXPLICIT) + else if (as->type == AS_ASSUMED_SIZE) packed = PACKED_FULL; + else if (as->type == AS_EXPLICIT) + { + packed = PACKED_FULL; + for (int n = 0; n < as->rank; n++) + { + if (!(as->upper[n] + && as->lower[n] + && as->upper[n]->expr_type == EXPR_CONSTANT + && as->lower[n]->expr_type == EXPR_CONSTANT)) + { + packed = PACKED_PARTIAL; + break; + } + } + } else packed = PACKED_NO;
