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/48699] [4.6/4.7 Regression] [OOP] MOVE_ALLOC inside SELECT TYPE
Date: Sat, 21 May 2011 20:57:00 -0000 [thread overview]
Message-ID: <bug-48699-4-s2T2qmQ9RA@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-48699-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48699
--- Comment #11 from janus at gcc dot gnu.org 2011-05-21 20:09:07 UTC ---
(In reply to comment #9)
> program testmv1
>
> type bar
> end type
>
> type, extends(bar) :: bar2
> end type
>
> class(bar), allocatable :: sm
> type(bar2), allocatable :: sm2
>
> allocate(sm2)
> call move_alloc(sm2,sm)
>
> end program
>
>
> /tmp/ccSfRlZ5.o:(.data+0x38): undefined reference to `__copy_testmv1_Bar2.1582'
The problem here simply is that the vtab is constructed too late (only at
translation stage), so that the __copy routine is never generated. The
following obvious patch fixes it:
Index: gcc/fortran/check.c
===================================================================
--- gcc/fortran/check.c (Revision 174000)
+++ gcc/fortran/check.c (Arbeitskopie)
@@ -2588,6 +2588,10 @@ gfc_check_move_alloc (gfc_expr *from, gfc_expr *to
return FAILURE;
}
+ /* Make sure the vtab is present. */
+ if (to->ts.type == BT_CLASS)
+ gfc_find_derived_vtab (from->ts.u.derived);
+
return SUCCESS;
}
next prev parent reply other threads:[~2011-05-21 20:33 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-20 12:07 [Bug fortran/48699] New: [OOP] MOVE_ALLOC of polymorphic variables sfilippone at uniroma2 dot it
2011-04-20 12:07 ` [Bug fortran/48699] " sfilippone at uniroma2 dot it
2011-04-20 13:09 ` burnus at gcc dot gnu.org
2011-04-20 13:21 ` sfilippone at uniroma2 dot it
2011-05-15 12:00 ` janus at gcc dot gnu.org
2011-05-15 12:16 ` janus at gcc dot gnu.org
2011-05-20 20:34 ` [Bug fortran/48699] [OOP] MOVE_ALLOC inside SELECT TYPE janus at gcc dot gnu.org
2011-05-20 21:47 ` janus at gcc dot gnu.org
2011-05-21 19:35 ` janus at gcc dot gnu.org
2011-05-21 19:51 ` janus at gcc dot gnu.org
2011-05-21 20:02 ` [Bug fortran/48699] [4.6/4.7 Regression] " janus at gcc dot gnu.org
2011-05-21 20:57 ` janus at gcc dot gnu.org [this message]
2011-05-22 0:12 ` dominiq at lps dot ens.fr
2011-05-29 22:20 ` janus at gcc dot gnu.org
2011-05-30 5:34 ` dominiq at lps dot ens.fr
2011-05-30 9:13 ` sfilippone at uniroma2 dot it
2011-05-30 9:29 ` burnus at gcc dot gnu.org
2011-05-30 10:48 ` burnus at gcc dot gnu.org
2011-06-12 12:41 ` rguenth at gcc dot gnu.org
2011-06-17 20:03 ` janus at gcc dot gnu.org
2011-06-19 21:07 ` janus at gcc dot gnu.org
2011-06-19 21:20 ` janus at gcc dot gnu.org
2011-11-26 15:18 ` burnus at gcc dot gnu.org
2011-12-03 11:34 ` burnus at gcc dot gnu.org
2011-12-03 12:01 ` sfilippone at uniroma2 dot it
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-48699-4-s2T2qmQ9RA@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).