public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45674]  New: [OOP] Undefined references for extended types
@ 2010-09-14 23:49 dietmar dot ebner at gmail dot com
  2010-09-15 13:57 ` [Bug fortran/45674] " janus at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dietmar dot ebner at gmail dot com @ 2010-09-14 23:49 UTC (permalink / raw)
  To: gcc-bugs

The testcase below leads to the following linker error on current trunk, gcc
4.5.0 and gcc 4.5.1: 
$gfortran fails.f90
/tmp/ccG09ce7.o: In function `__fails_test_MOD_bar':
fails.f90:(.text+0xe): undefined reference to `vtab$b_t.1500'
collect2: ld returned 1 exit status

The patch at the end of the bug report seems to solve the problem for me but
it's mainly a wild guess. The issue seems to be closely related to 44065.

file fails.f90
===================================================================
module fails_mod
  implicit none 
  type :: a_t
     integer :: a
  end type
  type, extends(a_t) :: b_t
     integer :: b
  end type
contains
  subroutine foo(a)
    class(a_t) :: a
  end subroutine foo
end module fails_mod

module fails_test
  implicit none
contains
  subroutine bar
    use fails_mod
    type(b_t) :: b
    call foo(b)
  end subroutine bar
end module fails_test

end


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)
     {


-- 
           Summary: [OOP] Undefined references for extended types
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dietmar dot ebner at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-09-16 13:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).