This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/53329] New: ICE with deferred-length module variables
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 12 May 2012 10:35:54 +0000
- Subject: [Bug fortran/53329] New: ICE with deferred-length module variables
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53329
Bug #: 53329
Summary: ICE with deferred-length module variables
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
Blocks: 45170
The following code gives an ICE:
module m
character(len=:), allocatable :: str
end module m
Untested fix:
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1103,2 +1103,10 @@ gfc_create_string_length (gfc_symbol * sym)
sym->ts.u.cl->backend_decl = length;
+
+ if (sym->attr.save
+ || (ns->parent && ns->parent->proc_name->attr.flavor == FL_MODULE))
+ TREE_STATIC (length) = 1;
+
+ if (ns->parent && ns->parent->proc_name->attr.flavor == FL_MODULE
+ && (sym->attr.access != ACCESS_PRIVATE || sym->attr.public_used))
+ TREE_PUBLIC (length) = 1;
}