This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 29 Aug 2011 19:28:42 +0000
- Subject: [Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable
- Auto-submitted: auto-generated
- References: <bug-50227-4@http.gcc.gnu.org/bugzilla/>
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.