From: Steven G. Kargl Date: Fri, 16 Sep 2016 17:55:38 +0000 (+0000) Subject: re PR fortran/77612 (ICE on invalid character len in contained procedure) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d987deb5be9484c103d3a786590c84b54535813;p=gcc.git re PR fortran/77612 (ICE on invalid character len in contained procedure) 2016-09-16 Steven G. Kargl PR fortran/77612 * decl.c (char_len_param_value): Check parent namespace for seen_implicit_none. 2016-09-16 Steven G. Kargl PR fortran/77612 * gfortran.dg/pr77612.f90: New test. From-SVN: r240191 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ffc859a4128..5954c73f404 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,11 @@ +2016-09-16 Steven G. Kargl + + PR fortran/77612 + * decl.c (char_len_param_value): Check parent namespace for + seen_implicit_none. + 2016-09-15 Louis Krupp + PR fortran/69963 * parse.c (reject_statement): Clear charlen pointers in implicit character typespecs before those charlen structures are freed. diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index b5242394cef..c83e9d4d791 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -920,9 +920,10 @@ char_len_param_value (gfc_expr **expr, bool *deferred) t = gfc_reduce_init_expr (e); - if (!t && (e->ts.type == BT_UNKNOWN - && e->symtree->n.sym->attr.untyped == 1 - && e->symtree->n.sym->ns->seen_implicit_none == 1)) + if (!t && e->ts.type == BT_UNKNOWN + && e->symtree->n.sym->attr.untyped == 1 + && (e->symtree->n.sym->ns->seen_implicit_none == 1 + || e->symtree->n.sym->ns->parent->seen_implicit_none == 1)) { gfc_free_expr (e); goto syntax; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2cb03482ba2..3c992548d11 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-09-16 Steven G. Kargl + + PR fortran/77612 + * gfortran.dg/pr77612.f90: New test. + 2016-09-16 Senthil Kumar Selvaraj * gcc.dg/torture/pr70421.c: Require int32plus. diff --git a/gcc/testsuite/gfortran.dg/pr77612.f90 b/gcc/testsuite/gfortran.dg/pr77612.f90 new file mode 100644 index 00000000000..7bc5a492c78 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr77612.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } + +program bad_len + + implicit none + +contains + + subroutine sub + character(len = ICE) :: line ! { dg-error "INTEGER expression expected" } + end subroutine + +end program