This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

--- Comment #11 from janus at gcc dot gnu.org 2011-08-29 19:28:42 UTC ---
Well, the obvious patch (based on Tobias' debugging) would be:


Index: gcc/fortran/trans-types.c
===================================================================
--- gcc/fortran/trans-types.c   (revision 178253)
+++ gcc/fortran/trans-types.c   (working copy)
@@ -2109,7 +2109,8 @@ gfc_sym_type (gfc_symbol * sym)
     {
       /* We must use pointer types for potentially absent variables.  The
         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);
       else
        {


And indeed it seems to fix the segfault. However, I still don't really see the
connection to r171654.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]