Commit 5e7bb2b9 by Janus Weil

re PR fortran/47601 ([OOP] Internal Error: mio_component_ref(): Component not found)

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  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47601
	* gfortran.dg/extends_13.f03: New.

From-SVN: r174416
parent 155732f5
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
......
......@@ -2356,14 +2356,10 @@ mio_component_ref (gfc_component **cp, gfc_symbol *sym)
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. */
......
......@@ -1996,7 +1996,7 @@ gfc_find_component (gfc_symbol *sym, const char *name,
{
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
......
! { 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" } }
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