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/64244] [4.8/4.9/5 Regression] ICE at class.c:236 when using non_overridable
Date: Mon, 15 Dec 2014 15:30:00 -0000	[thread overview]
Message-ID: <bug-64244-4-rDV0262Swe@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64244-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64244

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |janus at gcc dot gnu.org

--- Comment #4 from janus at gcc dot gnu.org ---
(In reply to janus from comment #3)
> 'resolve_typebound_generic_call' should probably communicate to its caller
> that the specific procedure it found is not overridable.

It turns out that resolve_typebound_generic_call actually does update this
information in the gfc_expr, but then resolve_typebound_call needs to pass it
outside, before it transforms the whole thing into an EXEC_CALL.

Here is a draft patch which does this (making the ICE disappear):

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c    (Revision 218748)
+++ gcc/fortran/resolve.c    (Arbeitskopie)
@@ -5667,7 +5667,7 @@ success:
 /* Resolve a call to a type-bound subroutine.  */

 static bool
-resolve_typebound_call (gfc_code* c, const char **name)
+resolve_typebound_call (gfc_code* c, const char **name, bool *overridable)
 {
   gfc_actual_arglist* newactual;
   gfc_symtree* target;
@@ -5691,6 +5691,10 @@ static bool
   if (!resolve_typebound_generic_call (c->expr1, name))
     return false;

+  /* Pass along the NON_OVERRIDABLE attribute of the specific TBP. */
+  if (overridable)
+    *overridable = !c->expr1->value.compcall.tbp->non_overridable;
+
   /* Transform into an ordinary EXEC_CALL for now.  */

   if (!resolve_typebound_static (c->expr1, &target, &newactual))
@@ -5950,7 +5954,7 @@ resolve_typebound_subroutine (gfc_code *code)
       if (c->ts.u.derived == NULL)
     c->ts.u.derived = gfc_find_derived_vtab (declared);

-      if (!resolve_typebound_call (code, &name))
+      if (!resolve_typebound_call (code, &name, NULL))
     return false;

       /* Use the generic name if it is there.  */
@@ -5982,7 +5986,7 @@ resolve_typebound_subroutine (gfc_code *code)
     }

   if (st == NULL)
-    return resolve_typebound_call (code, NULL);
+    return resolve_typebound_call (code, NULL, NULL);

   if (!resolve_ref (code->expr1))
     return false;
@@ -5995,10 +5999,10 @@ resolve_typebound_subroutine (gfc_code *code)
      || (!class_ref && st->n.sym->ts.type != BT_CLASS))
     {
       gfc_free_ref_list (new_ref);
-      return resolve_typebound_call (code, NULL);
+      return resolve_typebound_call (code, NULL, NULL);
     }

-  if (!resolve_typebound_call (code, &name))
+  if (!resolve_typebound_call (code, &name, &overridable))
     {
       gfc_free_ref_list (new_ref);
       return false;


  parent reply	other threads:[~2014-12-15 15:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09 22:06 [Bug fortran/64244] New: internal compiler error " ondrej.certik at gmail dot com
2014-12-09 22:32 ` [Bug fortran/64244] [4.8/4.9/5 Regression] " dominiq at lps dot ens.fr
2014-12-15 13:28 ` [Bug fortran/64244] [4.8/4.9/5 Regression] ICE " janus at gcc dot gnu.org
2014-12-15 13:54 ` janus at gcc dot gnu.org
2014-12-15 15:30 ` janus at gcc dot gnu.org [this message]
2014-12-15 15:56 ` janus at gcc dot gnu.org
2014-12-15 20:14 ` janus at gcc dot gnu.org
2014-12-16  8:16 ` janus at gcc dot gnu.org
2014-12-16  8:23 ` janus at gcc dot gnu.org
2014-12-16 16:41 ` ondrej.certik at gmail dot com
2014-12-16 16:47 ` janus at gcc dot gnu.org
2014-12-16 17:24 ` ondrej.certik at gmail dot com
2014-12-16 20:46 ` janus at gcc dot gnu.org
2014-12-16 23:57 ` ondrej.certik at gmail dot com
2014-12-23 10:52 ` janus at gcc dot gnu.org
2014-12-23 19:07 ` janus at gcc dot gnu.org
2014-12-23 19:37 ` janus at gcc dot gnu.org

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-64244-4-rDV0262Swe@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).