https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78443

--- Comment #2 from janus at gcc dot gnu.org ---
Indeed this behavior is a bug.

Looking at the dump generated with -fdump-tree-original, it seems that all
typebound-procedure calls are generated as they should be:

* The three calls in the main program are reduced to non-polymorphic calls:

    test2 (&class.2, &C.3565);
    test2 (&class.3, &C.3567);
    test1 (&class.4, &C.3571);

* The calls to 'square' in the test procedures are performed polymorphically:

      D.3553 = this->_vptr->square ((struct __class_types_P2_t *) this,
(real(kind=4) *) x);
      D.3555 = this->_vptr->square ((struct __class_types_P1_t *) this,
(real(kind=4) *) x);


So, what goes wrong is probably the assignment of the TBPs in the vtab.

Reply via email to