[Patch, Fortran, OOP] PR 59493: ICE: Segfault on Class(*) pointer association
Janus Weil
janus@gcc.gnu.org
Sat Dec 14 23:05:00 GMT 2013
Hi all,
here is a rather simple fix for a problem with the pointer assignment
of an unlimited polymorphic variable. The patch regtests cleanly on
x86_64-unknown-linux-gnu.
Firstly, I would like to commit to trunk, of course. Ok?
Secondly, the bug reporter asked me (privately) for the possibility of
backporting the fix to 4.8 (which is the only release supporting
unlimited polymorphism so far). It is important for his code at
http://sourceforge.net/projects/permix/.
Although the bug is not a regression, I would tend to support this
request (due to the simplicity and low risk of the patch). So, is the
patch ok for 4.8 also?
[Btw, I plan to do some more cleanup related to the vtab generation on
trunk soon, but I tried to keep the present patch as simple as
possible, in order to keep it safe for backporting.]
Cheers,
Janus
2013-12-14 Janus Weil <janus@gcc.gnu.org>
PR fortran/59493
* class.c (gfc_find_intrinsic_vtab): Handle BT_CLASS.
2013-12-14 Janus Weil <janus@gcc.gnu.org>
PR fortran/59493
* gfortran.dg/unlimited_polymorphic_15.f90: New.
-------------- next part --------------
Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c (revision 205982)
+++ gcc/fortran/class.c (working copy)
@@ -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. */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unlimited_polymorphic_15.f90
Type: text/x-fortran
Size: 290 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20131214/e996cf6d/attachment.bin>
More information about the Fortran
mailing list