The attached patch has been built and regression tested on x86_64-*-freebsd. No regression occurred.
The patch removes a conditional within an assert() that triggers when a BLOCK construct is encountered. OK to commit? 2015-09-25 Steven G. Kargl <ka...@gcc.gnu.org> PR fortran/67616 * primary.c (gfc_match_structure_constructor): Remove a condition in an assert() that is not valid within a BLOCK-END BLOCK construct. 2015-09-25 Steven G. Kargl <ka...@gcc.gnu.org> PR fortran/67616 * gfortran.dg/pr67616.f90: New test. -- Steve
Index: fortran/primary.c =================================================================== --- fortran/primary.c (revision 228061) +++ fortran/primary.c (working copy) @@ -2703,8 +2703,7 @@ gfc_match_structure_constructor (gfc_sym e->symtree = symtree; e->expr_type = EXPR_FUNCTION; - gcc_assert (sym->attr.flavor == FL_DERIVED - && symtree->n.sym->attr.flavor == FL_PROCEDURE); + gcc_assert (sym->attr.flavor == FL_DERIVED); e->value.function.esym = sym; e->symtree->n.sym->attr.generic = 1; 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