This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52552] [OOP] ICE when trying to allocate non-allocatable object giving a dynamic type
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 Mar 2012 11:24:23 +0000
- Subject: [Bug fortran/52552] [OOP] ICE when trying to allocate non-allocatable object giving a dynamic type
- Auto-submitted: auto-generated
- References: <bug-52552-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52552
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-03-12 11:24:23 UTC ---
More details: For gfc_match_allocate (match.c), one has:
3538 if (!gfc_type_compatible (&tail->expr->ts, &ts))
and then in gfc_type_compatible:
(gdb) p ts1->type
$6 = BT_CLASS
(gdb) p ts2->type
$7 = BT_DERIVED
(gdb) p ts1->u.derived->components
$10 = (gfc_component *) 0x16da1f0
(gdb) p ts1->u.derived->components->ts.u.derived
$12 = (gfc_symbol *) 0x0
Which is used for:
4848 if (is_class1 && is_derived2)
4849 return gfc_type_is_extension_of(ts1->u.derived->components->ts.u.derived,
4850 ts2->u.derived);
Due to the lacking ALLOCATE,
tail->expr->ts.u.derived->attr.is_class == 1
Thus, one should check it. The question is only where: In gfc_match_allocate or
in gfc_type_compatible?