From: Paul Thomas Date: Tue, 28 Nov 2017 15:13:42 +0000 (+0000) Subject: re PR fortran/83021 (gfortran segfault in polymorphic assignment) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a964d4b12be9d8ed027b5faa3f3c439eff08ef16;p=gcc.git re PR fortran/83021 (gfortran segfault in polymorphic assignment) 2017-11-28 Paul Thomas 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. From-SVN: r255202 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7ba781447f9..91c57e0d43d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2017-11-28 Paul Thomas + + 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. + 2017-11-28 Jakub Jelinek * trans-decl.c (gfc_trans_entry_master_switch): Build SWITCH_EXPR diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 9a814017c36..fe2f43a1e57 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -13502,7 +13502,11 @@ resolve_component (gfc_component *c, gfc_symbol *sym) if (c->attr.artificial) return true; - if (sym->attr.vtype && sym->attr.use_assoc) + /* 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. */