Reported by Andrew Benson at http://gcc.gnu.org/ml/fortran/2011-06/msg00119.html: module Nodes type :: nodeWrapper end type nodeWrapper type, extends(nodeWrapper) :: treeNode class(nodeWrapper) :: subComponent end type treeNode end module Nodes ICEs with 4.6 and 4.7 trunk, while it is correctly rejected with 4.5.
==15300== Invalid read of size 1 ==15300== at 0x502B83: parse_spec (parse.c:2110) ==15300== by 0x503B42: gfc_parse_file (parse.c:4113) ==15300== by 0x53D3F5: gfc_be_parse_file (f95-lang.c:250) Which is parse_derived's (!) 2109 default: 2110 unexpected_statement (st);
Mine (I'm working on a patch). Apparently we fail to check for the 'class_ok' attribute.
Author: janus Date: Thu Jun 16 11:45:05 2011 New Revision: 175101 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175101 Log: 2011-06-16 Janus Weil <janus@gcc.gnu.org> PR fortran/49417 * module.c (mio_component): Make sure the 'class_ok' attribute is set for use-associated CLASS components. * parse.c (parse_derived): Check for 'class_ok' attribute. * resolve.c (resolve_fl_derived): Ditto. 2011-06-16 Janus Weil <janus@gcc.gnu.org> PR fortran/49417 * gfortran.dg/class_43.f03: New. Added: trunk/gcc/testsuite/gfortran.dg/class_43.f03 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/module.c trunk/gcc/fortran/parse.c trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog
Fixed for the trunk I assume. Janus, if you want this to make into gcc 4.6.1-rc1, please commit on Monday or earlier.
Author: janus Date: Sun Jun 19 21:05:18 2011 New Revision: 175194 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175194 Log: 2011-06-19 Janus Weil <janus@gcc.gnu.org> PR fortran/47601 * module.c (mio_component_ref): Handle components of extended types. * symbol.c (gfc_find_component): Return if sym is NULL. PR fortran/48699 * check.c (gfc_check_move_alloc): If 'TO' argument is polymorphic, make sure the vtab is present. PR fortran/49074 * interface.c (gfc_extend_assign): Propagate the locus from the assignment to the type-bound procedure call. PR fortran/49417 * module.c (mio_component): Make sure the 'class_ok' attribute is set for use-associated CLASS components. * parse.c (parse_derived): Check for 'class_ok' attribute. * resolve.c (resolve_fl_derived): Ditto. 2011-06-19 Janus Weil <janus@gcc.gnu.org> PR fortran/47601 * gfortran.dg/extends_13.f03: New. PR fortran/48699 * gfortran.dg/move_alloc_5.f90: New. PR fortran/49074 * gfortran.dg/typebound_assignment_3.f03: New. PR fortran/49417 * gfortran.dg/class_43.f03: New. Added: branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/class_43.f03 branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/extends_13.f03 branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/move_alloc_5.f90 branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/typebound_assignment_3.f03 Modified: branches/gcc-4_6-branch/gcc/fortran/ChangeLog branches/gcc-4_6-branch/gcc/fortran/check.c branches/gcc-4_6-branch/gcc/fortran/interface.c branches/gcc-4_6-branch/gcc/fortran/module.c branches/gcc-4_6-branch/gcc/fortran/parse.c branches/gcc-4_6-branch/gcc/fortran/resolve.c branches/gcc-4_6-branch/gcc/fortran/symbol.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Fixed on trunk and 4.6. Closing.