https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98948
--- Comment #2 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Wed, Feb 03, 2021 at 07:00:10AM +0000, kargl at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98948 > > kargl at gcc dot gnu.org changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > Priority|P3 |P4 > CC| |kargl at gcc dot gnu.org > > --- Comment #1 from kargl at gcc dot gnu.org --- > Confirmed, although the original code uses an extension, REAL*4. > > This is a better testcase. > Patch tested on original code. Patch has not been regression tested. diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 3b988d1be22..a6ee94216a5 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -299,6 +299,13 @@ gfc_set_default_type (gfc_symbol *sym, int error_flag, gfc_namespace *ns) if (ts->type == BT_UNKNOWN) { + /* For 'procedure(real), pointer :: ptr => abs' and 'implicit none' + the symbol 'abs' has an unknown type at this point and neither + sym->attr.intrinsic nor sym->attr.external are set. So just + skip this symbol and hope life is good. */ + if (sym->attr.function || sym->attr.subroutine) + return true; + if (error_flag && !sym->attr.untyped) { const char *guessed = lookup_symbol_fuzzy (sym->name, sym);
