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/47601] [OOP] Internal Error: mio_component_ref(): Component not found
Date: Sat, 28 May 2011 17:57:00 -0000	[thread overview]
Message-ID: <bug-47601-4-BSAczhy6Wq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47601-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #23 from janus at gcc dot gnu.org 2011-05-28 17:47:39 UTC ---
(In reply to comment #22)
> [macbook] f90/bug% gfc
> /opt/gcc/work/gcc/testsuite/gfortran.dg/typebound_proc_12.f90
> f951: internal compiler error: Segmentation fault

Thanks for checking, Dominique. Here is an updated patch:

Index: gcc/fortran/module.c
===================================================================
--- gcc/fortran/module.c    (revision 174380)
+++ gcc/fortran/module.c    (working copy)
@@ -2356,14 +2356,10 @@ mio_component_ref (gfc_component **cp, gfc_symbol
       if (sym->components != NULL && p->u.pointer == NULL)
     {
       /* Symbol already loaded, so search by name.  */
-      for (q = sym->components; q; q = q->next)
-        if (strcmp (q->name, name) == 0)
-          break;
+      q = gfc_find_component (sym, name, true, true);

-      if (q == NULL)
-        gfc_internal_error ("mio_component_ref(): Component not found");
-
-      associate_integer_pointer (p, q);
+      if (q)
+        associate_integer_pointer (p, q);
     }

       /* Make sure this symbol will eventually be loaded.  */
Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c    (revision 174380)
+++ gcc/fortran/symbol.c    (working copy)
@@ -1996,7 +1996,7 @@ gfc_find_component (gfc_symbol *sym, const char *n
 {
   gfc_component *p;

-  if (name == NULL)
+  if (name == NULL || sym == NULL)
     return NULL;

   sym = gfc_use_derived (sym);


  parent reply	other threads:[~2011-05-28 17:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 18:40 [Bug fortran/47601] New: Internal Error (mio_component_ref(): Component not found) with strange behavior townsend at astro dot wisc.edu
2011-02-03 18:45 ` [Bug fortran/47601] " townsend at astro dot wisc.edu
2011-02-03 18:59 ` mikael at gcc dot gnu.org
2011-02-03 19:20 ` townsend at astro dot wisc.edu
2011-02-03 19:31 ` mikael at gcc dot gnu.org
2011-02-03 21:17 ` townsend at astro dot wisc.edu
2011-02-03 21:54 ` mikael at gcc dot gnu.org
2011-02-03 22:13 ` dominiq at lps dot ens.fr
2011-02-03 23:13 ` [Bug fortran/47601] Internal Error: mio_component_ref(): Component not found janus at gcc dot gnu.org
2011-03-29 19:51 ` [Bug fortran/47601] [OOP] " janus at gcc dot gnu.org
2011-04-04 12:56 ` mikael at gcc dot gnu.org
2011-04-04 13:35 ` kristopher.kuhlman at gmail dot com
2011-05-26 18:15 ` townsend at astro dot wisc.edu
2011-05-26 21:43 ` janus at gcc dot gnu.org
2011-05-26 21:47 ` townsend at astro dot wisc.edu
2011-05-27  4:02 ` kristopher.kuhlman at gmail dot com
2011-05-28 12:49 ` burnus at gcc dot gnu.org
2011-05-28 14:19 ` janus at gcc dot gnu.org
2011-05-28 14:43 ` dominiq at lps dot ens.fr
2011-05-28 15:12 ` janus at gcc dot gnu.org
2011-05-28 15:21 ` burnus at gcc dot gnu.org
2011-05-28 15:49 ` janus at gcc dot gnu.org
2011-05-28 16:56 ` dominiq at lps dot ens.fr
2011-05-28 17:57 ` janus at gcc dot gnu.org [this message]
2011-05-28 21:21 ` dominiq at lps dot ens.fr
2011-05-29 13:15 ` janus at gcc dot gnu.org
2011-05-29 20:33 ` janus at gcc dot gnu.org
2011-05-29 21:02 ` janus at gcc dot gnu.org
2011-05-29 21:36 ` townsend at astro dot wisc.edu
2011-06-08 13:13 ` kristopher.kuhlman at gmail dot com
2011-06-08 13:40 ` janus at gcc dot gnu.org
2011-06-08 13:49 ` kristopher.kuhlman at gmail dot com
2011-06-19 21:07 ` janus at gcc dot gnu.org
2011-06-19 21:16 ` janus at gcc dot gnu.org
2011-06-19 21:19 ` townsend at astro dot wisc.edu
2011-06-20  2:32 ` kristopher.kuhlman at gmail dot com

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-47601-4-BSAczhy6Wq@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).