+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,
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);
--- /dev/null
+! { 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" } }