From de06e54d21f8a128289e40f12811b321778f9a8f Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Sun, 3 Mar 2019 20:24:53 +0000 Subject: [PATCH] re PR fortran/77583 (ICE in pp_quoted_string, at pretty-print.c:966) 2019-03-03 Harald Anlauf Steven G. Kargl PR fortran/77583 * symbol.c (check_conflict): Check for valid procedure name passed to error reporting routine. PR fortran/77583 * gfortran.dg/pr77583.f90: New test. Co-Authored-By: Steven G. Kargl From-SVN: r269353 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/symbol.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pr77583.f90 | 10 ++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/pr77583.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 489ae1bc0cb..9f4234900b6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2019-03-03 Harald Anlauf + Steven G. Kargl + + PR fortran/77583 + * symbol.c (check_conflict): Check for valid procedure name + passed to error reporting routine. + 2019-03-03 Thomas Koenig PR fortran/72714 diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index c8a1f842d35..0eb413084d1 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -525,7 +525,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) /* The copying of procedure dummy arguments for module procedures in a submodule occur whilst the current state is COMP_CONTAINS. It is necessary, therefore, to let this through. */ - if (attr->dummy + if (name && attr->dummy && (attr->function || attr->subroutine) && gfc_current_state () == COMP_CONTAINS && !(gfc_new_block && gfc_new_block->abr_modproc_decl)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e7b54ea7882..4e8fd0242cf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-03 Harald Anlauf + + PR fortran/77583 + * gfortran.dg/pr77583.f90: New test. + 2019-03-03 Thomas Koenig PR fortran/72714 diff --git a/gcc/testsuite/gfortran.dg/pr77583.f90 b/gcc/testsuite/gfortran.dg/pr77583.f90 new file mode 100644 index 00000000000..c2ee0744297 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr77583.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! +! PR fortran/77583 - ICE in pp_quoted_string, at pretty-print.c:966 +! Contributed by Gerhard Steinmetz + +pure subroutine sub(s) +contains + pure subroutine s ! { dg-error "conflicts with DUMMY argument" } + end +end -- 2.30.2