[Bug fortran/47601] [OOP] Internal Error: mio_component_ref(): Component not found
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat May 28 12:49:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47601
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #16 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-05-28 12:32:11 UTC ---
(In reply to comment #13)
> type :: matching
> integer :: N = -999
> end type
> type, extends(matching) :: ellipse
> end type
> type(ellipse), intent(in) :: e
> complex, dimension(e%N) :: a2n
Thus, when loading the expression, one needs to resolve e%N. One thus calls
module.c's mio_component_ref which does (on reading the .mod):
if (sym->components != NULL && p->u.pointer == NULL)
{
/* Symbol already loaded, so search by name. */
for (q = sym->components; q; q = q->next)
if (strcmp (q->name, name) == 0)
break;
The comparison by name fails for extended types:
(gdb) p sym->components->name
$11 = 0x2aaaacec33b0 "matching"
(gdb) p sym->components->next
$12 = (struct gfc_component *) 0x0
Thus: Not found. However, one has:
(gdb) p sym->attr.extension
$13 = 1
(gdb) p sym->components->ts.u.derived->name
$14 = 0x2aaaacec33b0 "matching"
(gdb) p sym->components->ts.u.derived->components->name
$15 = 0x2aaaacde3fa8 "n"
Janus, you know type extension better than me. Does one now needs to do:
if (!p && sym->attr.extension)
{
p = search (sym->components->ts.u.derived)
if (!p && sym->components->ts.u.derived->attr.extension)
p = search (sym->components->ts.u.derived->...)
or is this the wrong method?
More information about the Gcc-bugs
mailing list