public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/55887] [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization
Date: Sat, 26 Jan 2013 21:21:00 -0000	[thread overview]
Message-ID: <bug-55887-4-v0w6HkXTBK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55887-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #3 from janus at gcc dot gnu.org 2013-01-26 21:21:38 UTC ---
This patch fixes the ICE in comment 0:


Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c    (revision 195486)
+++ gcc/fortran/trans-decl.c    (working copy)
@@ -1484,6 +1484,12 @@ gfc_get_symbol_decl (gfc_symbol * sym)
       && (gfc_option.coarray != GFC_FCOARRAY_LIB
       || !sym->attr.codimension || sym->attr.allocatable))
     {
+      bool pointer;
+      if (sym->ts.type == BT_CLASS)
+    pointer = CLASS_DATA (sym)->attr.class_pointer
+          || CLASS_DATA (sym)->attr.allocatable;
+      else
+    pointer = sym->attr.pointer || sym->attr.allocatable;
       /* Add static initializer. For procedures, it is only needed if
      SAVE is specified otherwise they need to be reinitialized
      every time the procedure is entered. The TREE_STATIC is
@@ -1493,8 +1499,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
                           sym->attr.dimension
                           || (sym->attr.codimension
                               && sym->attr.allocatable),
-                          sym->attr.pointer
-                          || sym->attr.allocatable,
+                          pointer,
                           sym->attr.proc_pointer);
     }


  parent reply	other threads:[~2013-01-26 21:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-06 14:53 [Bug fortran/55887] New: " burnus at gcc dot gnu.org
2013-01-24 19:16 ` [Bug fortran/55887] " tilo@tilo-schwarz.de
2013-01-26 21:10 ` janus at gcc dot gnu.org
2013-01-26 21:21 ` janus at gcc dot gnu.org [this message]
2013-07-31 13:09 ` [Bug fortran/55887] [OOP][F08] " janus at gcc dot gnu.org
2013-07-31 13:10 ` janus at gcc dot gnu.org
2013-08-09  8:34 ` janus at gcc dot gnu.org
2014-03-15 11:12 ` dominiq at lps dot ens.fr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55887-4-v0w6HkXTBK@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).