From 81eb77395b935605b00ac5099d297f69eafcba3f Mon Sep 17 00:00:00 2001 From: tkoenig Date: Sat, 17 Feb 2018 15:53:07 +0000 Subject: 2018-02-17 Thomas Koenig PR fortran/84270 * frontend-passes (scalarized_expr): If the expression is an assumed size array, leave in the last reference and pass AR_SECTION instead of AR_FULL to gfc_resolve in order to avoid an error. 2018-02-17 Thomas Koenig PR fortran/84270 * gfortran.dg/inline_matmul_22.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257783 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/frontend-passes.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/frontend-passes.c') diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index 11a5b9b779c..d07d142faa4 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -3567,10 +3567,26 @@ scalarized_expr (gfc_expr *e_in, gfc_expr **index, int count_index) is the lbound of a full ref. */ int j; gfc_array_ref *ar; + int to; ar = &ref->u.ar; - ar->type = AR_FULL; - for (j = 0; j < ar->dimen; j++) + + /* For assumed size, we need to keep around the final + reference in order not to get an error on resolution + below, and we cannot use AR_FULL. */ + + if (ar->as->type == AS_ASSUMED_SIZE) + { + ar->type = AR_SECTION; + to = ar->dimen - 1; + } + else + { + to = ar->dimen; + ar->type = AR_FULL; + } + + for (j = 0; j < to; j++) { gfc_free_expr (ar->start[j]); ar->start[j] = NULL; -- cgit v1.2.1 From 94e046ceffedf5c981fc6af1e3b08ff097f6d320 Mon Sep 17 00:00:00 2001 From: tkoenig Date: Mon, 19 Feb 2018 18:21:45 +0000 Subject: 2018-02-19 Thomas Koenig PR fortran/35339 * frontend-passes.c (traverse_io_block): Remove workaround for PR 80945. 2018-02-19 Thomas Koenig PR fortran/35339 * gfortran.dg/implied_do_io_4.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257814 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/frontend-passes.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'gcc/fortran/frontend-passes.c') diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index d07d142faa4..1ffd27d686a 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -1162,14 +1162,7 @@ traverse_io_block (gfc_code *code, bool *has_reached, gfc_code *prev) gcc_assert (curr->op == EXEC_TRANSFER); - /* FIXME: Workaround for PR 80945 - array slices with deferred character - lenghts do not work. Remove this section when the PR is fixed. */ e = curr->expr1; - if (e->expr_type == EXPR_VARIABLE && e->ts.type == BT_CHARACTER - && e->ts.deferred) - return false; - /* End of section to be removed. */ - ref = e->ref; if (!ref || ref->type != REF_ARRAY || ref->u.ar.codimen != 0 || ref->next) return false; -- cgit v1.2.1