Dear All,

This regression was caused by the patch for PR81447. The chunk that
has been modified came about because use association of derived types
in block data, in the presence of a vtable, was trying to add vtable
procedures, which is not allowed. The original patch did not
explicitly target block data and this is fixed here. I decided that a
testcase was not necessary but this could be done if desired.

Bootstrapped and regtested on FC23/x86_64 - OK for both branches?

I will commit tomorrow morning if there are no complaints.

Best regards

Paul

2017-11-26  Paul Thomas  <pa...@gcc.gnu.org>

    PR fortran/83021
    * resolve.c (resolve_component): Only escape for use assciated
    vtypes if the current namespace has no proc_name and is most
    particularly block data.
Index: gcc/fortran/resolve.c
===================================================================
*** gcc/fortran/resolve.c       (revision 255093)
--- gcc/fortran/resolve.c       (working copy)
*************** resolve_component (gfc_component *c, gfc
*** 13502,13508 ****
    if (c->attr.artificial)
      return true;
  
!   if (sym->attr.vtype && sym->attr.use_assoc)
      return true;
  
    /* F2008, C442.  */
--- 13502,13512 ----
    if (c->attr.artificial)
      return true;
  
!   /* Do not allow vtype components to be resolved in nameless namespaces
!      such as block data because the procedure pointers will cause ICEs
!      and vtables are not needed in these contexts.  */
!   if (sym->attr.vtype && sym->attr.use_assoc
!       && sym->ns->proc_name == NULL)
      return true;
  
    /* F2008, C442.  */

Reply via email to