Commit 94ea6939 by Janus Weil

re PR fortran/43990 ([OOP] ICE in output_constructor_regular_field, at varasm.c:4995)

2010-05-17  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/43990
	* trans-expr.c (gfc_conv_structure): Remove unneeded and buggy code.
	This is now handled via 'gfc_class_null_initializer'.


2010-05-17  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/43990
	* gfortran.dg/class_21.f03: New.

From-SVN: r159511
parent f18ea1bf
2010-05-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/43990
* trans-expr.c (gfc_conv_structure): Remove unneeded and buggy code.
This is now handled via 'gfc_class_null_initializer'.
2010-05-17 Janus Weil <janus@gcc.gnu.org>
* class.c (gfc_add_component_ref,gfc_class_null_initializer,
gfc_build_class_symbol,add_proc_component,add_proc_comps,
add_procs_to_declared_vtab1,copy_vtab_proc_comps,
......
......@@ -4337,20 +4337,7 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
if (!c->expr || cm->attr.allocatable)
continue;
if (cm->ts.type == BT_CLASS && !cm->attr.proc_pointer)
{
gfc_component *data;
data = gfc_find_component (cm->ts.u.derived, "$data", true, true);
if (!data->backend_decl)
gfc_get_derived_type (cm->ts.u.derived);
val = gfc_conv_initializer (c->expr, &cm->ts,
TREE_TYPE (data->backend_decl),
data->attr.dimension,
data->attr.pointer);
CONSTRUCTOR_APPEND_ELT (v, data->backend_decl, val);
}
else if (strcmp (cm->name, "$size") == 0)
if (strcmp (cm->name, "$size") == 0)
{
val = TYPE_SIZE_UNIT (gfc_get_derived_type (cm->ts.u.derived));
CONSTRUCTOR_APPEND_ELT (v, cm->backend_decl, val);
......
2010-05-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/43990
* gfortran.dg/class_21.f03: New.
2010-05-17 Jason Merrill <jason@redhat.com>
PR c++/44157
......
! { dg-do compile }
!
! PR 43990: [OOP] ICE in output_constructor_regular_field, at varasm.c:4995
!
! Reported by Hans-Werner Boschmann <boschmann@tp1.physik.uni-siegen.de>
module m
type :: t
logical :: l = .true.
class(t),pointer :: cp => null()
end type
type(t),save :: default_t
end module
! { dg-final { cleanup-modules "m" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment