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.