This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/81447] [7/8] gfortran fails to recognize the exact dynamic type of a polymorphic entity that was allocated in a external procedure
- From: "pault at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 27 Jul 2017 08:36:22 +0000
- Subject: [Bug fortran/81447] [7/8] gfortran fails to recognize the exact dynamic type of a polymorphic entity that was allocated in a external procedure
- Auto-submitted: auto-generated
- References: <bug-81447-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81447
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org
--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> ---
Bother!
I had better take this one, although it will be some weeks before I can turn to
it because my workstation has died and is subject to a warranty claim.
I can see what the problem is from this workaround:
Module m
Type :: t
End Type
class (t), pointer :: ptr
End Module
The module class object forces a production of a vtable in the module
namespace. r241403 introduced the use of the address of the vtable as a unique
distinguishing feature of the dynamic type. In your testcase, Mat, the
subroutine 's' is forced to generate a separate vtable. Note that vtables are
not excluded by the use list.
The fix is obvious - create a vtable for all module derived type declarations
even when there is no OOP in the module.
Thanks for the report.
Paul