diff options
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/fortran/decl.cc | 2 | ||||
-rw-r--r-- | gcc/fortran/trans-array.cc | 9 |
3 files changed, 26 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 31a19ed..ad537f7 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,18 @@ +2025-09-30 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/102241 + * gfortran.h: Add symbol attribute 'pdt_comp'. + * module.cc : Add 'pdt_comp' to 'ab_attribute' and 'attr_bits'. + (mio_symbol_attribute): Set 'pdt_comp'. + * resolve.cc (resolve_component): If a PDT component is found + in a non-PDT type, generate the PDT instance, if necessary, and + set the 'pdt_comp' attribute. Fix some whitespace issues. + * trans-decl.cc (gfc_get_symbol_decl, gfc_trans_deferred_vars): + If 'pdt_comp' set, initialize the PDT components. + * trans-stmt.cc (gfc_trans_deallocate): Verify that a typespec + parameter list is available for PDT components of ordinary + derived types. + 2025-09-27 Paul Thomas <pault@gcc.gnu.org> PR fortran/87908 diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc index a891dc8..f00f0e1 100644 --- a/gcc/fortran/decl.cc +++ b/gcc/fortran/decl.cc @@ -4076,6 +4076,8 @@ gfc_get_pdt_instance (gfc_actual_arglist *param_list, gfc_symbol **sym, /* Start building the new instance of the parameterized type. */ gfc_copy_attr (&instance->attr, &pdt->attr, &pdt->declared_at); + if (pdt->attr.use_assoc) + instance->module = pdt->module; instance->attr.pdt_template = 0; instance->attr.pdt_type = 1; instance->declared_at = gfc_current_locus; diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index 0111c95..db34de4 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -9446,6 +9446,15 @@ gfc_conv_array_parameter (gfc_se *se, gfc_expr *expr, bool g77, gfc_add_expr_to_block (&se->pre, tmp); } + else if (pass_optional && full_array_var && sym->as && sym->as->rank != 0) + { + /* Perform calculation of bounds and strides of optional array dummy + only if the argument is present. */ + tmp = build3_v (COND_EXPR, gfc_conv_expr_present (sym), + gfc_finish_block (&se->pre), + build_empty_stmt (input_location)); + gfc_add_expr_to_block (&se->pre, tmp); + } } /* Deallocate the allocatable components of structures that are |