+2011-05-29 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 is sym is NULL.
+
2011-05-29 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
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;
-
- if (q == NULL)
- gfc_internal_error ("mio_component_ref(): Component not found");
+ q = gfc_find_component (sym, name, true, true);
- associate_integer_pointer (p, q);
+ if (q)
+ associate_integer_pointer (p, q);
}
/* Make sure this symbol will eventually be loaded. */
{
gfc_component *p;
- if (name == NULL)
+ if (name == NULL || sym == NULL)
return NULL;
sym = gfc_use_derived (sym);
+2011-05-29 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47601
+ * gfortran.dg/extends_13.f03: New.
+
2011-05-29 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/49095
--- /dev/null
+! { dg-do compile }
+!
+! PR 47601: [OOP] Internal Error: mio_component_ref(): Component not found
+!
+! Contributed by Rich Townsend <townsend@astro.wisc.edu>
+
+module type_definitions
+ implicit none
+ type :: matching
+ integer :: n = -999
+ end type
+ type, extends(matching) :: ellipse
+ end type
+end module type_definitions
+
+module elliptical_elements
+ implicit none
+contains
+ function line(e) result(a2n)
+ use type_definitions
+ type(ellipse), intent(in) :: e
+ complex, dimension(e%N) :: a2n ! <- change "e%N" to "10"
+ end function line
+end module
+
+ use type_definitions
+ use elliptical_elements
+end
+
+! { dg-final { cleanup-modules "type_definitions elliptical_elements" } }