From aa7cfe40579670e5bc0df3220181aad0bee763ab Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Sun, 4 Dec 2016 21:31:26 +0100 Subject: [PATCH] re PR fortran/78618 (ICE in gfc_check_rank, at fortran/check.c:3670) 2016-12-04 Janus Weil PR fortran/78618 * intrinsic.c (gfc_convert_type_warn): Do not set the full typespec for the conversion symbol, but only type and kind. Set the full typespec for the expression. (gfc_convert_chartype): Ditto. From-SVN: r243232 --- gcc/fortran/ChangeLog | 8 ++++++++ gcc/fortran/intrinsic.c | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3489bc4a14e..2c06b31f9e5 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2016-12-04 Janus Weil + + PR fortran/78618 + * intrinsic.c (gfc_convert_type_warn): Do not set the full typespec for + the conversion symbol, but only type and kind. Set the full typespec + for the expression. + (gfc_convert_chartype): Ditto. + 2016-12-03 Janus Weil PR fortran/43207 diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index fdc11d8831c..fb83402c07d 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -4984,12 +4984,14 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag) new_expr->value.function.name = sym->lib_name; new_expr->value.function.isym = sym; new_expr->where = old_where; + new_expr->ts = *ts; new_expr->rank = rank; new_expr->shape = gfc_copy_shape (shape, rank); gfc_get_ha_sym_tree (sym->name, &new_expr->symtree); new_expr->symtree->n.sym->result = new_expr->symtree->n.sym; - new_expr->symtree->n.sym->ts = *ts; + new_expr->symtree->n.sym->ts.type = ts->type; + new_expr->symtree->n.sym->ts.kind = ts->kind; new_expr->symtree->n.sym->attr.flavor = FL_PROCEDURE; new_expr->symtree->n.sym->attr.function = 1; new_expr->symtree->n.sym->attr.elemental = 1; @@ -5055,11 +5057,13 @@ gfc_convert_chartype (gfc_expr *expr, gfc_typespec *ts) new_expr->value.function.name = sym->lib_name; new_expr->value.function.isym = sym; new_expr->where = old_where; + new_expr->ts = *ts; new_expr->rank = rank; new_expr->shape = gfc_copy_shape (shape, rank); gfc_get_ha_sym_tree (sym->name, &new_expr->symtree); - new_expr->symtree->n.sym->ts = *ts; + new_expr->symtree->n.sym->ts.type = ts->type; + new_expr->symtree->n.sym->ts.kind = ts->kind; new_expr->symtree->n.sym->attr.flavor = FL_PROCEDURE; new_expr->symtree->n.sym->attr.function = 1; new_expr->symtree->n.sym->attr.elemental = 1; -- 2.30.2