This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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;
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]