2017-10-07 Paul Thomas <pault@gcc.gnu.org>
commitd11013dc3afc33a424248c9700b26427de6b623e
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 7 Oct 2017 21:14:06 +0000 (7 21:14 +0000)
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 7 Oct 2017 21:14:06 +0000 (7 21:14 +0000)
treef35dd21ab87d1b52f109109851b7511d6da2144c
parent60722a03da909c304c892f11c97025b5dd6142c5
2017-10-07  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/82375
* class.c (gfc_find_derived_vtab): Return NULL for a passed
pdt template to prevent bad procedures from being written.
* decl.c (gfc_get_pdt_instance): Do not use the default
initializer for pointer and allocatable pdt type components. If
the component is allocatbale, set the 'alloc_comp' attribute of
'instance'.
* module.c : Add a prototype for 'mio_actual_arglist'. Add a
boolean argument 'pdt'.
(mio_component): Call it for the parameter list of pdt type
components with 'pdt' set to true.
(mio_actual_arg): Add the boolean 'pdt' and, if it is set, call
mio_integer for the 'spec_type'.
(mio_actual_arglist): Add the boolean 'pdt' and use it in the
call to mio_actual_arg.
(mio_expr, mio_omp_udr_expr): Call mio_actual_arglist with
'pdt' set false.
* resolve.c (get_pdt_spec_expr): Add the parameter name to the
KIND parameter error.
(get_pdt_constructor): Check that cons->expr is non-null.
* trans-array.c (structure_alloc_comps): For deallocation of
allocatable components, ensure that parameterized components
are deallocated first. Likewise, when parameterized components
are allocated, nullify allocatable components first. Do not
recurse into pointer or allocatable pdt components while
allocating or deallocating parameterized components. Test that
parameterized arrays or strings are allocated before freeing
them.
(gfc_trans_pointer_assignment): Call the new function. Tidy up
a minor whitespace issue.
trans-decl.c (gfc_trans_deferred_vars): Set 'tmp' to NULL_TREE
to prevent the expression from being used a second time.

2017-10-07  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/82375
* gfortran.dg/pdt_13.f03 : New test.
* gfortran.dg/pdt_14.f03 : New test.
* gfortran.dg/pdt_15.f03 : New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253514 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/fortran/ChangeLog
gcc/fortran/class.c
gcc/fortran/decl.c
gcc/fortran/module.c
gcc/fortran/resolve.c
gcc/fortran/trans-array.c
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pdt_13.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pdt_14.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pdt_15.f03 [new file with mode: 0644]