This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE on functions with no explicit nor implicit type (PR fortran/21729)
On Sat, May 28, 2005 at 04:32:19PM +0200, Tobias Schl?ter wrote:
> Jakub Jelinek wrote:
> > On Sat, May 28, 2005 at 03:49:09PM +0200, Tobias Schl?ter wrote:
> >>>@@ -4835,6 +4842,39 @@ gfc_resolve (gfc_namespace * ns)
> >>>
> >>> gfc_traverse_ns (ns, resolve_symbol);
> >>>
> >>>+ if (ns->proc_name && ns->proc_name->attr.function)
> >>>+ {
> >>>+ gfc_entry_list *el;
> >>>+ gfc_symbol *sym;
> >>>+
> >>>+ if (ns->entries)
> >>>+ sym = ns->entries->sym;
> >>>+ else
> >>>+ sym = ns->proc_name;
> >>
> >>Why this if? Did you run into a bug when you tried to resolve the function
> >>symbol itself?
> >
> >
> > I just wanted to print Function for functions and ENTRY for their entries.
> > If it just printed Function always it could be slightly simpler.
>
> Hm, looks like I'm misreading the code. To me it looks like you're doing
> nothing for the function symbol, if the function has alternative entries.
This is after resolve_entries has been called, so if the function
has any entries, ns->proc_name is the synthetized entry master
which doesn't need to be checked, ns->entries->sym is the FUNCTION symbol
and ns->entries->next->sym etc. are the ENTRY symbols.
If the function doesn't have any ENTRY, ns->proc_name is the FUNCTION
symbol.
Jakub