This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/81758] New: [OOP] Broken vtab
- From: "liakhdi at ornl dot gov" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 07 Aug 2017 20:56:46 +0000
- Subject: [Bug fortran/81758] New: [OOP] Broken vtab
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81758
Bug ID: 81758
Summary: [OOP] Broken vtab
Product: gcc
Version: 7.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: liakhdi at ornl dot gov
Target Milestone: ---
It seems like something is seriously wrong with GFORTRAN 7.x virtual table
constructor. I observe an incorrect association of type-bound procedures to
their calling names. For example, in
procedure, public:: method_name=>ProcedureName
I observe method_name to be associated with another (unrelated) type-bound
procedure from a completely different type (pretty much all of them are
associated with wrong procedures). If you clone my GFC (Generic Fortran
Containers) code from
https://github.com/DmitryLyakh/GFC.git
or
https://gitlab.com/DmitryLyakh/GFC.git
then in file gfc_vector.F90 lines 740-742 you will see that a pointer "cep" is
associated and is trying to invoke one of its type-bound procedures
"get_value()". However the debugger shows that get_value() in _vptr is
currently associated with another type-bound procedure from a completely
different type vector_t, specifically its type-bound procedure
VectorLowerBound(), which does not make any sense. Other type-bound procedures
in "cep" also associated with wrong procedures. As a consequence, the call
crashes with invalid memory reference. This is only observed with GCC 7.
To build my code, just type make and run the binary.