This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44978] derived types are resolved more than once
- From: "mikael at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 11 Aug 2013 19:12:47 +0000
- Subject: [Bug fortran/44978] derived types are resolved more than once
- Auto-submitted: auto-generated
- References: <bug-44978-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44978
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #30630|0 |1
is obsolete| |
--- Comment #16 from Mikael Morin <mikael at gcc dot gnu.org> ---
Created attachment 30633
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30633&action=edit
patch with bool and flags to store the return value
(In reply to Mikael Morin from comment #14)
> OK, let's use more bool; but then the return value shall be consistent
> across multiple calls.
> So I would say use two bits for each function: one telling whether the
> function was already called on the symbol, and one telling the return value.
> There are three functions as far as I know (resolve_symbol,
> resolve_fl_derived and resolve_fl_derived0) which makes six bits.
> Even if you are concerned about wasted memory, that doesn't consume extra
> memory because of fields alignments.
>
The attached patch shows what it looks like.
I also took the opportunity to extend your pr51945 change (hunk below) to the
whole loop.
@@ -12344,7 +12344,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
if (c->initializer && !sym->attr.vtype
&& !gfc_check_assign_symbol (sym, c, c->initializer))
- return false;
+ continue;
}