This patch fixes the above PRs and the additional problems in comment #1 of both 82606 and 82622. For the main part, the patch consists of 'obvious' tweaks to the PDT machinery. The exception to this is the chunk in trans-array.c(set_loop_bounds), which is needed to handle parameterized array components coming from trans-io.c. This is safe because the code would have fallen through to gcc_unreachable otherwise. If the info->end is present then this can be used. Bootstrapped and regtested on FC23/x86_64 - OK for trunk? I will commit tomorrow morning if there are no complaints in the meantime. Regards Paul 2017-11-30 Paul Thomas PR fortran/82605 * resolve.c (get_pdt_constructor): Initialize 'cons' to NULL. (resolve_pdt): Correct typo in prior comment. Emit an error if any parameters are deferred and the object is neither pointer nor allocatable. PR fortran/82606 * decl.c (gfc_get_pdt_instance): Continue if the parameter sym is not present or has no name. Select the parameter by name of component, rather than component order. Remove all the other manipulations of 'tail' when building the pdt instance. (gfc_match_formal_arglist): Emit and error if a star is picked up in a PDT decl parameter list. PR fortran/82622 * trans-array.c (set_loop_bounds): If a GFC_SS_COMPONENT has an info->end, use it rather than falling through to gcc_unreachable. (structure_alloc_comps): Check that param->name is non-null before comparing with the component name. * trans-decl.c (gfc_get_symbol_decl): Do not use the static initializer for PDT symbols. (gfc_init_default_dt): Do nothing for PDT symbols. * trans-io.c (transfer_array_component): Parameterized array components use the descriptor ubound since the shape is not available. 2017-11-30 Paul Thomas PR fortran/82605 * gfortran.dg/pdt_4.f03 : Incorporate the new error. PR fortran/82606 * gfortran.dg/pdt_19.f03 : New test. * gfortran.dg/pdt_21.f03 : New test. PR fortran/82622 * gfortran.dg/pdt_20.f03 : New test. * gfortran.dg/pdt_22.f03 : New test.