From 6e48e779aba92a8d7e89210c2d98d9b2a65d9a36 Mon Sep 17 00:00:00 2001 From: Louis Krupp Date: Wed, 5 Oct 2016 18:00:30 +0000 Subject: [PATCH] re PR fortran/67524 (ICE on using implicit character instead of implicit none etc.) 2016-10-05 Louis Krupp PR fortran/67524 * gfortran.dg/pr67524.f90: New test. 2016-10-05 Louis Krupp PR fortran/67524 * resolve.c (resolve_symbol): Don't apply default type rules to mixed-entry master created for function entry points. From-SVN: r240797 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/resolve.c | 5 ++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pr67524.f90 | 20 ++++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/pr67524.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e3097249af4..e01c4bfb2ae 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2016-10-05 Louis Krupp + + PR fortran/67524 + * resolve.c (resolve_symbol): Don't apply default type rules to + mixed-entry master created for function entry points. + 2016-09-30 Jerry DeLisle PR fortran/66643 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 7b068f91f2c..ddd9d742466 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -13886,7 +13886,10 @@ resolve_symbol (gfc_symbol *sym) /* The specific case of an external procedure should emit an error in the case that there is no implicit type. */ if (!mp_flag) - gfc_set_default_type (sym, sym->attr.external, NULL); + { + if (!sym->attr.mixed_entry_master) + gfc_set_default_type (sym, sym->attr.external, NULL); + } else { /* Result may be in another namespace. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 54d64ee984f..653dee53d93 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-10-05 Louis Krupp + + PR fortran/67524 + * gfortran.dg/pr67524.f90: New test. + 2016-10-05 Jakub Jelinek PR sanitizer/77823 diff --git a/gcc/testsuite/gfortran.dg/pr67524.f90 b/gcc/testsuite/gfortran.dg/pr67524.f90 new file mode 100644 index 00000000000..6f5440f328f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr67524.f90 @@ -0,0 +1,20 @@ +! { dg-do run } +module m + implicit character(8) (a-z) +contains + function f(x) + integer :: x + integer :: f + real :: e + f = x + return + entry e(x) + e = x + end +end module + +program p + use m + if (f(1) /= 1) call abort + if (e(1) /= 1.0) call abort +end -- 2.30.2