re PR fortran/69498 (ICE on disjunct cases with displaced or incomplete embedded...
authorNicolas Koenig <koenigni@gcc.gnu.org>
Tue, 21 Mar 2017 14:49:21 +0000 (14:49 +0000)
committerNicolas Koenig <koenigni@gcc.gnu.org>
Tue, 21 Mar 2017 14:49:21 +0000 (14:49 +0000)
2017-03-18  Nicolas Koenig  <koenigni@student.ethz.ch>

                PR fortran/69498
                * decl.c (add_hidden_procptr_result): Fixed Refs count of the created "ppr@" symbol.

2017-03-18  Nicolas Koenig  <koenigni@student.ethz.ch>

                PR fortran/69498
                * gfortran.dg/unexp_attribute.f90: New test

From-SVN: r246322

gcc/fortran/decl.c
gcc/testsuite/gfortran.dg/unexp_attribute.f90 [new file with mode: 0644]

index 52de1c113124fcbbd80979feed91919b0a9b2c97..7d61fbf37af6f8a4aea555351c44a3347008caf1 100644 (file)
@@ -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 (file)
index 0000000..c39b4a9
--- /dev/null
@@ -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