From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29416 invoked by alias); 11 Aug 2013 19:12:53 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 29360 invoked by uid 48); 11 Aug 2013 19:12:50 -0000 From: "mikael at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/44978] derived types are resolved more than once Date: Sun, 11 Aug 2013 19:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.6.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: mikael at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00605.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44978 Mikael Morin changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #30630|0 |1 is obsolete| | --- Comment #16 from Mikael Morin --- 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; }