* [Bug fortran/45674] [OOP] Undefined references for extended types
2010-09-14 23:49 [Bug fortran/45674] New: [OOP] Undefined references for extended types dietmar dot ebner at gmail dot com
@ 2010-09-15 13:57 ` janus at gcc dot gnu dot org
2010-09-15 14:46 ` janus at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2010-09-15 13:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from janus at gcc dot gnu dot org 2010-09-15 13:57 -------
Confirmed. From a quick glimpse it seems the patch goes in the right direction.
Will have a closer look soon.
--
janus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-09-15 13:57:41
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45674
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/45674] [OOP] Undefined references for extended types
2010-09-14 23:49 [Bug fortran/45674] New: [OOP] Undefined references for extended types dietmar dot ebner at gmail dot com
2010-09-15 13:57 ` [Bug fortran/45674] " janus at gcc dot gnu dot org
@ 2010-09-15 14:46 ` janus at gcc dot gnu dot org
2010-09-15 15:36 ` dietmar dot ebner at gmail dot com
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2010-09-15 14:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from janus at gcc dot gnu dot org 2010-09-15 14:46 -------
(In reply to comment #0)
> Index: fortran/interface.c
> ===================================================================
> --- fortran/interface.c (revision 164288)
> +++ fortran/interface.c (working copy)
> @@ -1428,10 +1428,12 @@
> && actual->ts.u.derived && actual->ts.u.derived->ts.is_iso_c)
> return 1;
>
> - if (formal->ts.type == BT_CLASS)
> + if (formal->ts.type == BT_CLASS) {
> /* Make sure the vtab symbol is present when
> the module variables are generated. */
> gfc_find_derived_vtab (formal->ts.u.derived);
> + gfc_find_derived_vtab (actual->ts.u.derived);
> + }
>
> if (actual->ts.type == BT_PROCEDURE)
> {
>
Actually I think this patch is ok. Are you interested in committing it
yourself? [Note that you'll need an FSF copyright assignment, if you don't
already have one.] Otherwise I can commit it for you.
Side note: One can (should) extend the patch in the following way ...
Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c (revision 164304)
+++ gcc/fortran/interface.c (working copy)
@@ -1428,10 +1428,10 @@ compare_parameter (gfc_symbol *formal, gfc_expr *a
&& actual->ts.u.derived && actual->ts.u.derived->ts.is_iso_c)
return 1;
- if (formal->ts.type == BT_CLASS)
+ if (formal->ts.type == BT_CLASS && actual->ts.type == BT_DERIVED)
/* Make sure the vtab symbol is present when
the module variables are generated. */
- gfc_find_derived_vtab (formal->ts.u.derived);
+ gfc_find_derived_vtab (actual->ts.u.derived);
if (actual->ts.type == BT_PROCEDURE)
{
(I have not regtested this yet.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45674
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/45674] [OOP] Undefined references for extended types
2010-09-14 23:49 [Bug fortran/45674] New: [OOP] Undefined references for extended types dietmar dot ebner at gmail dot com
2010-09-15 13:57 ` [Bug fortran/45674] " janus at gcc dot gnu dot org
2010-09-15 14:46 ` janus at gcc dot gnu dot org
@ 2010-09-15 15:36 ` dietmar dot ebner at gmail dot com
2010-09-16 8:50 ` dominiq at lps dot ens dot fr
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: dietmar dot ebner at gmail dot com @ 2010-09-15 15:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from dietmar dot ebner at gmail dot com 2010-09-15 15:36 -------
(In reply to comment #2)
> Actually I think this patch is ok. Are you interested in committing it
> yourself? [Note that you'll need an FSF copyright assignment, if you don't
> already have one.] Otherwise I can commit it for you.
I don't have the copyright assignment in place so please go ahead and do it.
Thanks for the quick fix!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45674
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/45674] [OOP] Undefined references for extended types
2010-09-14 23:49 [Bug fortran/45674] New: [OOP] Undefined references for extended types dietmar dot ebner at gmail dot com
` (2 preceding siblings ...)
2010-09-15 15:36 ` dietmar dot ebner at gmail dot com
@ 2010-09-16 8:50 ` dominiq at lps dot ens dot fr
2010-09-16 12:11 ` janus at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-09-16 8:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from dominiq at lps dot ens dot fr 2010-09-16 08:50 -------
> (I have not regtested this yet.)
The (second) patch in comment #2 fixes the pr without regression.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45674
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/45674] [OOP] Undefined references for extended types
2010-09-14 23:49 [Bug fortran/45674] New: [OOP] Undefined references for extended types dietmar dot ebner at gmail dot com
` (3 preceding siblings ...)
2010-09-16 8:50 ` dominiq at lps dot ens dot fr
@ 2010-09-16 12:11 ` janus at gcc dot gnu dot org
2010-09-16 13:13 ` janus at gcc dot gnu dot org
2010-09-16 13:14 ` janus at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2010-09-16 12:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from janus at gcc dot gnu dot org 2010-09-16 12:10 -------
(In reply to comment #3)
> Thanks for the quick fix!
Well, it was *your* fix, so *I* should thank *you* :)
Anyway, I think the patch in comment #2 qualifies as obvious, and has no
regressions, as noted by Dominique. Will commit soon.
--
janus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |janus at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2010-09-15 13:57:41 |2010-09-16 12:10:46
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45674
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/45674] [OOP] Undefined references for extended types
2010-09-14 23:49 [Bug fortran/45674] New: [OOP] Undefined references for extended types dietmar dot ebner at gmail dot com
` (4 preceding siblings ...)
2010-09-16 12:11 ` janus at gcc dot gnu dot org
@ 2010-09-16 13:13 ` janus at gcc dot gnu dot org
2010-09-16 13:14 ` janus at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2010-09-16 13:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from janus at gcc dot gnu dot org 2010-09-16 13:13 -------
Subject: Bug 45674
Author: janus
Date: Thu Sep 16 13:12:59 2010
New Revision: 164338
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164338
Log:
2010-09-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/45674
* interface.c (compare_parameter): Create vtab for actual argument,
instead of formal (if needed).
2010-09-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/45674
* gfortran.dg/class_dummy_2.f03: New.
Added:
trunk/gcc/testsuite/gfortran.dg/class_dummy_2.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/interface.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45674
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/45674] [OOP] Undefined references for extended types
2010-09-14 23:49 [Bug fortran/45674] New: [OOP] Undefined references for extended types dietmar dot ebner at gmail dot com
` (5 preceding siblings ...)
2010-09-16 13:13 ` janus at gcc dot gnu dot org
@ 2010-09-16 13:14 ` janus at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2010-09-16 13:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from janus at gcc dot gnu dot org 2010-09-16 13:14 -------
Fixed with r164338. Closing.
Thanks for the report!
--
janus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45674
^ permalink raw reply [flat|nested] 8+ messages in thread