Message ID | 20151001000315.GA73614@troutmask.apl.washington.edu |
---|---|
State | New |
Headers | show |
Le 01/10/2015 02:03, Steve Kargl a écrit : > The attached patch was built and tested on x86_64-*-freebsd. > OK to commit? > > The patch prevents an ICE in a BLOCK construct that uses > a DATA statement and default initialization. The problem > was that the derived typed was declared in the host and > was not in the BLOCK's symtree. The fix looks for the > derived type through host associate. > > Just remembered Mikael pre-approved patch. > Yes, OK again. :-)
Index: fortran/primary.c =================================================================== --- fortran/primary.c (revision 228306) +++ fortran/primary.c (working copy) @@ -2697,7 +2697,7 @@ gfc_match_structure_constructor (gfc_sym 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: testsuite/gfortran.dg/pr67616.f90 =================================================================== --- testsuite/gfortran.dg/pr67616.f90 (revision 0) +++ testsuite/gfortran.dg/pr67616.f90 (working copy) @@ -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