[Bug fortran/44978] derived types are resolved more than once

mikael at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Aug 9 15:03:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44978

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org

--- Comment #8 from Mikael Morin <mikael at gcc dot gnu.org> ---
I'm not convinced by the following:

(In reply to janus from comment #6)
> @@ -11962,6 +11957,10 @@ resolve_fl_derived0 (gfc_symbol *sym)
>    gfc_symbol* super_type;
>    gfc_component *c;
>  
> +  if (sym->resolved>1)
> +    return true;
> +  sym->resolved = 2;
> +
>    if (sym->attr.unlimited_polymorphic)
>      return true;

The first time we hit the function, sym->resolved is set to 2.
Suppose that an error is issued, and the function returns false.
Then, on the next time the function is called with the same symbol argument, no
error is issued (this is the purpose of the patch), but as a side effect the
function will return true, so that the caller will proceed as if the symbol was
well formed.



More information about the Gcc-bugs mailing list