From: Janus Weil Date: Sun, 15 Dec 2013 09:49:51 +0000 (+0100) Subject: re PR fortran/59493 ([OOP] ICE: Segfault on Class(*) pointer association) X-Git-Tag: releases/gcc-4.9.0~2072 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=013a961bacc2aacc34f27b786a5f191fbfe094c4;p=thirdparty%2Fgcc.git re PR fortran/59493 ([OOP] ICE: Segfault on Class(*) pointer association) 2013-12-15 Janus Weil PR fortran/59493 * class.c (gfc_find_intrinsic_vtab): Handle BT_CLASS. 2013-12-15 Janus Weil PR fortran/59493 * gfortran.dg/unlimited_polymorphic_15.f90: New. From-SVN: r205997 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9de18607db3e..a7d2ff8a8a40 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2013-12-15 Janus Weil + + PR fortran/59493 + * class.c (gfc_find_intrinsic_vtab): Handle BT_CLASS. + 2013-12-14 Janus Weil PR fortran/59502 diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index 52b9760b2717..b65cd892b1d4 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -2424,7 +2424,7 @@ gfc_find_intrinsic_vtab (gfc_typespec *ts) return NULL; /* Sometimes the typespec is passed from a single call. */ - if (ts->type == BT_DERIVED) + if (ts->type == BT_DERIVED || ts->type == BT_CLASS) return gfc_find_derived_vtab (ts->u.derived); /* Find the top-level namespace. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ccb78290915c..7074acab2aef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-12-15 Janus Weil + + PR fortran/59493 + * gfortran.dg/unlimited_polymorphic_15.f90: New. + 2013-12-14 Jan Hubicka PR middle-end/58477 diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_15.f90 b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_15.f90 new file mode 100644 index 000000000000..1dfebdce3d5a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_15.f90 @@ -0,0 +1,17 @@ +! { dg-do compile } +! +! PR 59493: [OOP] ICE: Segfault on Class(*) pointer association +! +! Contributed by Hossein Talebi + + implicit none + + type ty_mytype1 + end type + + class(ty_mytype1), allocatable, target:: cla1 + class(*), pointer :: ptr + + ptr => cla1 + +end