[Bug fortran/102818] ICE in gfc_resolve_formal_arglist, at fortran/resolve.c:282
anlauf at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jul 22 18:47:01 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102818
--- Comment #1 from anlauf at gcc dot gnu.org ---
The proper function name is diagnosed after the following patch:
diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc
index 7a80dfd063b..0d0221fc3c4 100644
--- a/gcc/fortran/symbol.cc
+++ b/gcc/fortran/symbol.cc
@@ -2005,7 +2005,9 @@ gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus
*where)
gfc_error ("Symbol %qs at %L conflicts with symbol from module %qs, "
"use-associated at %L", sym->name, where, sym->module,
&sym->declared_at);
- else if (sym->attr.function && sym->attr.result)
+ else if ((sym->attr.function && sym->attr.result)
+ || (sym->attr.flavor == FL_PROCEDURE
+ && sym->ns->proc_name && sym->ns->proc_name->name))
gfc_error ("Symbol %qs at %L already has basic type of %s",
sym->ns->proc_name->name, where, gfc_basic_typename (type));
else
I do not get an ICE, but valgrind suggests that error recovery is not clean.
More information about the Gcc-bugs
mailing list