[Patch, Fortran, OOP] PR 44541: wrong code for polymorphic variable with INTENT(OUT)/Alloc w/ MOLD

Janus Weil janus@gcc.gnu.org
Wed Sep 1 22:14:00 GMT 2010


> With the patch in http://gcc.gnu.org/ml/fortran/2010-09/msg00036/pr44541_v2.diff
> the test in pr44465 (comments #0 and #2) segfault:

Too bad, your message came just a minute too late :(

The failure is fixed by using the correct check for the ALLOCATABLE attribute:

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 163744)
+++ gcc/fortran/resolve.c       (working copy)
@@ -12165,7 +12165,7 @@ resolve_symbol (gfc_symbol *sym)

   if (sym->ts.type == BT_CLASS && sym->ns == gfc_current_ns
       && sym->attr.dummy && sym->attr.intent == INTENT_OUT
-      && !sym->attr.pointer && !sym->attr.allocatable)
+      && !CLASS_DATA (sym)->attr.pointer && !CLASS_DATA
(sym)->attr.allocatable)
     {
       apply_default_init (sym);
       gfc_set_sym_referenced (sym);


I'll commit as obvious tomorrow.

Cheers,
Janus



More information about the Fortran mailing list