[Bug fortran/50919] [OOP] Don't use vtable for NON_OVERRIDABLE TBP

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Oct 31 12:08:00 GMT 2011


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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-10-31
     Ever Confirmed|0                           |1

--- Comment #1 from janus at gcc dot gnu.org 2011-10-31 12:08:31 UTC ---
(In reply to comment #0)
> Expected:
> a) gfortran call the procedure directly, which allows for inlining and avoids
> the pointer dereference.

Good point. I hadn't thought of that ...


> Test case. The dump shows the following rather than a simple "test ()":

Here is an extended test case involving a type-bound subroutine and a
type-bound function (both of which have to be fixed):


module m

type t
contains
  procedure, nopass, NON_OVERRIDABLE :: testsub
  procedure, nopass, NON_OVERRIDABLE :: testfun
end type t

contains

  subroutine testsub()
    print *, "t's test"
  end subroutine

  integer function testfun()
    testfun = 1
  end function

end module m


  use m
  class(t), allocatable :: x
  allocate(x)
  call x%testsub()
  print *,x%testfun()
end



More information about the Gcc-bugs mailing list