re PR fortran/67616 (ICE on data initialization of type variable in block)
authorSteven G. Kargl <kargl@gcc.gnu.org>
Fri, 2 Oct 2015 00:45:59 +0000 (00:45 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Fri, 2 Oct 2015 00:45:59 +0000 (00:45 +0000)
2015-10-01  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/67616
* primary.c (gfc_match_structure_constructor): Use a possibly
host-associated symtree to prevent ICE.

2015-10-01  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/67616
* gfortran.dg/pr67616.f90: New test.

From-SVN: r228363

gcc/fortran/ChangeLog
gcc/fortran/primary.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr67616.f90 [new file with mode: 0644]

index 2830c912b032e3a5d713076172af73af22592faf..2a306e55f69a1031e61d8048bfd3205bf78f2681 100644 (file)
@@ -1,3 +1,9 @@
+2015-10-01  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/67616
+       * primary.c (gfc_match_structure_constructor): Use a possibly
+       host-associated symtree to prevent ICE.
+
 2015-09-28  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/40054
index c8c65816a3369e9bce85f4d4809e84fc9e725cd1..9f75666becfe8a6963024e2d78e1e7884e565337 100644 (file)
@@ -2697,7 +2697,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
   gfc_expr *e;
   gfc_symtree *symtree;
 
-  gfc_get_sym_tree (sym->name, NULL, &symtree, false);   /* Can't fail */
+  gfc_get_ha_sym_tree (sym->name, &symtree);
 
   e = gfc_get_expr ();
   e->symtree = symtree;
index 92625b32e56c6a6398728869bdc8c1a8dd840f3e..bf9b3e406f2d3e894eb7d9c24e1ecebda896ea1b 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-01  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/67616
+       * gfortran.dg/pr67616.f90: New test.
+
 2015-10-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
 
        PR c++/54430
diff --git a/gcc/testsuite/gfortran.dg/pr67616.f90 b/gcc/testsuite/gfortran.dg/pr67616.f90
new file mode 100644 (file)
index 0000000..3c2107d
--- /dev/null
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! PR fortran/67616
+! Original code contributed by Gerhard Steinmetz 
+program p
+   type t
+   end type
+   type(t) :: y
+   data y /t()/
+   block
+      type(t) :: x
+      data x /t()/      ! Prior to patch, this would ICE.
+   end block
+end