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/54917] [4.7/4.8 Regression] [OOP] TRANSFER on polymorphic variable causes ICE
Date: Sat, 13 Oct 2012 21:52:00 -0000	[thread overview]
Message-ID: <bug-54917-4-sc0Ig3zlhz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-54917-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #8 from janus at gcc dot gnu.org 2012-10-13 21:52:39 UTC ---
The following fixes the ICE(s) on comment 5 ...


Index: gcc/fortran/target-memory.c
===================================================================
--- gcc/fortran/target-memory.c    (revision 192392)
+++ gcc/fortran/target-memory.c    (working copy)
@@ -121,6 +121,7 @@ gfc_target_expr_size (gfc_expr *e)
     case BT_HOLLERITH:
       return e->representation.length;
     case BT_DERIVED:
+    case BT_CLASS:
       {
     /* Determine type size without clobbering the typespec for ISO C
        binding types.  */
@@ -572,6 +573,9 @@ gfc_target_interpret_expr (unsigned char *buffer,
         gfc_interpret_character (buffer, buffer_size, result);
       break;

+    case BT_CLASS:
+      result->ts = result->ts.u.derived->components->ts;
+      /* Fall through.  */
     case BT_DERIVED:
       result->representation.length = 
         gfc_interpret_derived (buffer, buffer_size, result);


... which is then rejected with:

  copy = transfer(1,arg)
  1
Error: Variable must not be polymorphic in intrinsic assignment at (1) - check
that there is a matching specific subroutine for '=' operator


Intrinsic assignment to polymorphic variables is an F08 feature, which is not
yet implemented in gfortran, cf. PR 43366.


  parent reply	other threads:[~2012-10-13 21:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 19:22 [Bug fortran/54917] New: transfer on polymorphic variable causes ICE (gfc_target_expr_size) quantheory at gmail dot com
2012-10-12 21:31 ` [Bug fortran/54917] [OOP] TRANSFER on polymorphic variable causes ICE janus at gcc dot gnu.org
2012-10-12 21:56 ` [Bug fortran/54917] [4.7/4.8 Regression] " dominiq at lps dot ens.fr
2012-10-12 22:06 ` dominiq at lps dot ens.fr
2012-10-13 10:01 ` janus at gcc dot gnu.org
2012-10-13 10:05 ` janus at gcc dot gnu.org
2012-10-13 10:12 ` dominiq at lps dot ens.fr
2012-10-13 13:08 ` janus at gcc dot gnu.org
2012-10-13 21:52 ` janus at gcc dot gnu.org [this message]
2012-10-14 11:15 ` janus at gcc dot gnu.org
2012-10-14 12:01 ` janus at gcc dot gnu.org
2012-10-14 12:02 ` janus at gcc dot gnu.org
2012-10-14 15:55 ` janus at gcc dot gnu.org
2012-10-14 15:56 ` janus at gcc dot gnu.org
2012-10-14 16:31 ` janus at gcc dot gnu.org
2012-10-14 22:56 ` janus at gcc dot gnu.org
2012-11-06 10:16 ` janus at gcc dot gnu.org
2012-11-06 22:45 ` janus at gcc dot gnu.org
2012-11-06 22:52 ` 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-54917-4-sc0Ig3zlhz@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).