From aa53a3f7fba14b04b0ec251a1fa62290d0b4f8ac Mon Sep 17 00:00:00 2001 From: pault Date: Sat, 17 Feb 2018 11:07:32 +0000 Subject: 2018-02-17 Paul Thomas PR fortran/84115 * resolve.c (resolve_assoc_var): If a non-constant target expr. has no string length expression, make the associate variable into a deferred length, allocatable symbol. * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to the symbol. * trans-stmt.c (trans_associate_var): Null and free scalar associate names that are allocatable. After assignment, remove the allocatable attribute to prevent reallocation. 2018-02-17 Paul Thomas PR fortran/84115 * gfortran.dg/associate_35.f90: Remove error, add stop n's and change to run. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257781 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/trans-expr.c') diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index a4185820531..04e06efbe38 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -657,7 +657,7 @@ gfc_conv_derived_to_class (gfc_se *parmse, gfc_expr *e, } /* Array references with vector subscripts and non-variable expressions - need be coverted to a one-based descriptor. */ + need be converted to a one-based descriptor. */ if (ref || e->expr_type != EXPR_VARIABLE) { for (dim = 0; dim < e->rank; ++dim) -- cgit v1.2.1 From c3f718e40bbd2a718eb01b9d18e47e368c1df3ff Mon Sep 17 00:00:00 2001 From: pault Date: Fri, 23 Feb 2018 12:35:30 +0000 Subject: 2018-02-23 Paul Thomas PR fortran/83148 * trans-const.c : Clean up some whitespace issues. * trans-expr.c (gfc_conv_initializer): If an iso_c_binding derived type has a kind value of zero, set it to the default integer kind. 2018-02-23 Paul Thomas PR fortran/83148 * gfortran.dg/class_68.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257930 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-expr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/fortran/trans-expr.c') diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 04e06efbe38..a93257c73bf 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -6868,6 +6868,8 @@ gfc_conv_initializer (gfc_expr * expr, gfc_typespec * ts, tree type, /* The derived symbol has already been converted to a (void *). Use its kind. */ + if (derived->ts.kind == 0) + derived->ts.kind = gfc_default_integer_kind; expr = gfc_get_int_expr (derived->ts.kind, NULL, 0); expr->ts.f90_type = derived->ts.f90_type; -- cgit v1.2.1