From: Nicolas Koenig Date: Tue, 21 Mar 2017 14:49:21 +0000 (+0000) Subject: re PR fortran/69498 (ICE on disjunct cases with displaced or incomplete embedded... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8c0f9dab864878286b6fd16e26d62be4742cd7d6;p=gcc.git re PR fortran/69498 (ICE on disjunct cases with displaced or incomplete embedded statement) 2017-03-18 Nicolas Koenig PR fortran/69498 * decl.c (add_hidden_procptr_result): Fixed Refs count of the created "ppr@" symbol. 2017-03-18 Nicolas Koenig PR fortran/69498 * gfortran.dg/unexp_attribute.f90: New test From-SVN: r246322 --- diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 52de1c11312..7d61fbf37af 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -5430,6 +5430,7 @@ add_hidden_procptr_result (gfc_symbol *sym) gfc_get_sym_tree ("ppr@", gfc_current_ns->parent, &stree, false); st2 = gfc_new_symtree (&gfc_current_ns->sym_root, "ppr@"); st2->n.sym = stree->n.sym; + stree->n.sym->refs++; } sym->result = stree->n.sym; diff --git a/gcc/testsuite/gfortran.dg/unexp_attribute.f90 b/gcc/testsuite/gfortran.dg/unexp_attribute.f90 new file mode 100644 index 00000000000..c39b4a9a3b6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/unexp_attribute.f90 @@ -0,0 +1,8 @@ +! { dg-do compile } +! PR fortran/69498 +! This test used to result in an internal compiler error +function f() + interface + external f ! { dg-error "Unexpected attribute declaration statement in INTERFACE" } + end interface +end function