public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53329] New: ICE with deferred-length module variables
@ 2012-05-12 10:45 burnus at gcc dot gnu.org
  2012-05-14 16:46 ` [Bug fortran/53329] " burnus at gcc dot gnu.org
  2012-05-14 16:51 ` burnus at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-05-12 10:45 UTC (permalink / raw)
  To: gcc-bugs

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;
     }


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-14 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-12 10:45 [Bug fortran/53329] New: ICE with deferred-length module variables burnus at gcc dot gnu.org
2012-05-14 16:46 ` [Bug fortran/53329] " burnus at gcc dot gnu.org
2012-05-14 16:51 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).