re PR fortran/46344 ([OOP] ICE with allocatable CLASS components)

2010-11-08  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/46344
	* trans-types.c (gfc_copy_dt_decls_ifequal): Handle CLASS components.

2010-11-08  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/46344
	* gfortran.dg/class_28.f03: New.

From-SVN: r166430
This commit is contained in:
Janus Weil 2010-11-08 10:03:50 +01:00
parent 06f0c25f25
commit 78a1d1490c
4 changed files with 45 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2010-11-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/46344
* trans-types.c (gfc_copy_dt_decls_ifequal): Handle CLASS components.
2010-11-06 Janus Weil <janus@gcc.gnu.org>
PR fortran/46330

View file

@ -1936,10 +1936,12 @@ gfc_copy_dt_decls_ifequal (gfc_symbol *from, gfc_symbol *to,
for (; to_cm; to_cm = to_cm->next, from_cm = from_cm->next)
{
to_cm->backend_decl = from_cm->backend_decl;
if ((!from_cm->attr.pointer || from_gsym)
&& from_cm->ts.type == BT_DERIVED)
if (from_cm->ts.type == BT_DERIVED
&& (!from_cm->attr.pointer || from_gsym))
gfc_get_derived_type (to_cm->ts.u.derived);
else if (from_cm->ts.type == BT_CLASS
&& (!CLASS_DATA (from_cm)->attr.class_pointer || from_gsym))
gfc_get_derived_type (to_cm->ts.u.derived);
else if (from_cm->ts.type == BT_CHARACTER)
to_cm->ts.u.cl->backend_decl = from_cm->ts.u.cl->backend_decl;
}

View file

@ -1,3 +1,8 @@
2010-11-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/46344
* gfortran.dg/class_28.f03: New.
2010-11-08 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/45352

View file

@ -0,0 +1,30 @@
! { dg-do compile }
!
! PR 46344: [4.6 Regression] [OOP] ICE with allocatable CLASS components
!
! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
module m
type t1
end type
type t2
class(t1), allocatable :: cc
end type
class(t2), allocatable :: sm
end module m
program p
use m
implicit none
type(t2), allocatable :: x(:)
allocate(x(1))
end program p
! { dg-final { cleanup-modules "m" } }