Commit 30ff79fa by Janus Weil

re PR fortran/50227 ([OOP] ICE-on-valid with allocatable class variable)

2011-09-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/50227
	* trans-types.c (gfc_sym_type): Check for proc_name.

2011-09-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/50227
	* gfortran.dg/class_45a.f03: New.
	* gfortran.dg/class_45b.f03: New.

From-SVN: r178509
parent ad949bcc
2011-09-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/50227
* trans-types.c (gfc_sym_type): Check for proc_name.
2011-08-30 Tobias Burnus <burnus@net-b.de> 2011-08-30 Tobias Burnus <burnus@net-b.de>
PR fortran/45044 PR fortran/45044
......
...@@ -2109,7 +2109,8 @@ gfc_sym_type (gfc_symbol * sym) ...@@ -2109,7 +2109,8 @@ gfc_sym_type (gfc_symbol * sym)
{ {
/* We must use pointer types for potentially absent variables. The /* We must use pointer types for potentially absent variables. The
optimizers assume a reference type argument is never NULL. */ optimizers assume a reference type argument is never NULL. */
if (sym->attr.optional || sym->ns->proc_name->attr.entry_master) if (sym->attr.optional
|| (sym->ns->proc_name && sym->ns->proc_name->attr.entry_master))
type = build_pointer_type (type); type = build_pointer_type (type);
else else
{ {
......
2011-09-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/50227
* gfortran.dg/class_45a.f03: New.
* gfortran.dg/class_45b.f03: New.
2011-09-04 Jakub Jelinek <jakub@redhat.com> 2011-09-04 Jakub Jelinek <jakub@redhat.com>
Ira Rosen <ira.rosen@linaro.org> Ira Rosen <ira.rosen@linaro.org>
......
! { dg-do compile }
!
! PR 50227: [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable
!
! Contributed by Andrew Benson <abenson@caltech.edu>
module G_Nodes
private
type, public :: t0
end type
type, public, extends(t0) :: t1
end type
contains
function basicGet(self)
implicit none
class(t0), pointer :: basicGet
class(t0), intent(in) :: self
select type (self)
type is (t1)
basicGet => self
end select
end function basicGet
end module G_Nodes
! { dg-do run }
! { dg-additional-sources class_45a.f03 }
!
! PR 50227: [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable
!
! Contributed by Andrew Benson <abenson@caltech.edu>
program Test
use G_Nodes
class(t0), allocatable :: c
allocate(t1 :: c)
end program Test
! { dg-final { cleanup-modules "G_Nodes" } }
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