re PR fortran/78618 (ICE in gfc_check_rank, at fortran/check.c:3670)
authorJanus Weil <janus@gcc.gnu.org>
Sun, 4 Dec 2016 20:31:26 +0000 (21:31 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Sun, 4 Dec 2016 20:31:26 +0000 (21:31 +0100)
2016-12-04  Janus Weil  <janus@gcc.gnu.org>

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
gcc/fortran/intrinsic.c

index 3489bc4..2c06b31 100644 (file)
@@ -1,3 +1,11 @@
+2016-12-04  Janus Weil  <janus@gcc.gnu.org>
+
+       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  <janus@gcc.gnu.org>
 
        PR fortran/43207
index fdc11d8..fb83402 100644 (file)
@@ -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;