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

--- Comment #11 from janus at gcc dot gnu.org ---
(In reply to Mikael Morin from comment #10)
> > Do you have a simple idea how to improve the patch in this regard?
> The first one that comes to mind (beyond changing the return type to void)
> is caching the return value(s) in the symbol, one for each procedure.

IMHO it is probably not worth the hassle. I wouldn't like to do this without
having a concrete reason for it (and with a clean testsuite I don't see any).


> Another possibility: change the code to:
> 
>   if (sym->resolved>1)
>     return false;
> 
>   old_resolved = sym->resolved;
>   sym->resolved = 2;
> 
>   /* blah... */
> 
>   sym->resolved = old_resolved;
>   return true;
> }
> 
> 
> This only avoids the duplicate errors.  Multiple resolutions still happens
> when they are successful (which is the common case unfortunately).

Well, the advantage of my original patch is obviously that it not only avoids
the double errors, but it also prevents us from doing double the work in
resolving the symbols, so it might even give a performance improvement for
large codes, in particular with heavy OOP (not sure if it's anywhere close to
being significant, though).

Reply via email to