From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14637 invoked by alias); 13 Aug 2013 09:38:28 -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 14604 invoked by uid 48); 13 Aug 2013 09:38:25 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/44978] derived types are resolved more than once Date: Tue, 13 Aug 2013 09:38: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: dominiq at lps dot ens.fr 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: 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/msg00691.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44978 --- Comment #17 from Dominique d'Humieres --- In what follows "Janus' patch" will refer to http://gcc.gnu.org/bugzilla/attachment.cgi?id=30629 and "Mikael's patch" to http://gcc.gnu.org/bugzilla/attachment.cgi?id=30633 Although there are still duplicate errors, both patches regtest cleanly and are a significant improvement. I have seen the following differences between the two patches (I'll attach the full differences): (1) pr43591, Mikael's patch output the additional error pr43591.f90:8.77: procedure(number_flavor_states), nopass, pointer :: number_flavor_states => NULL() 1 Error: Interface 'number_flavor_states' at (1) must be explicit For both patches the error pr43591.f90:15.23: integer, dimension(physical%number_particles_out(), & 1 Error: Expression at (1) must be of INTEGER type, found UNKNOWN is printed twice. (2) pr48095, the error pr48095.f90:7.79: procedure(get_area), pointer, pass(this) :: get_special_area => get_my_area 1 Error: Interface mismatch in procedure pointer assignment at (1): Type mismatch in argument 'this' (CLASS(rectangle)/TYPE(rectangle)) is printed three times with Janus' patch and only twice with Mikael's one. (3) pr55983, with Janus' patch, the last error is pr55983.f90:16.32: class(bcd_t), pointer :: bcx, bcy 1 Error: The pointer component 'bcx' of '__class_solver_mpdata_m_Mpdata_t' at (1) is a type that has not been declared while with Mikael's patch it is pr55983.f90:16.37: class(bcd_t), pointer :: bcx, bcy 1 Error: The pointer component 'bcy' of 'mpdata_t' at (1) is a type that has not been declared For a clean tree it is class(bcd_t), pointer :: bcx, bcy 1 Error: The pointer component 'bcx' of 'mpdata_t' at (1) is a type that has not been declared (4) pr58023, compiling both tests with Janus' patch gives an ICE, while with Mikale's patch the first test gives a second error pr58023.f90:11.34: procedure(mr), pointer :: mr2 1 Error: Procedure pointer component 'mr2' with PASS at (1) must have at least one argument > I also took the opportunity to extend your pr51945 change (hunk below) > to the whole loop. This also fixes pr58023#c0. pr58023#c1 is fixed if I replace the following hunks @@ -12024,7 +12036,8 @@ resolve_fl_derived0 (gfc_symbol *sym) gfc_error ("Component '%s' at %L with coarray component " "shall be a nonpointer, nonallocatable scalar", c->name, &c->loc); - return false; + retval = false; + continue; } /* F2008, C448. */ @@ -12032,7 +12045,8 @@ resolve_fl_derived0 (gfc_symbol *sym) { gfc_error ("Component '%s' at %L has the CONTIGUOUS attribute but " "is not an array pointer", c->name, &c->loc); - return false; + retval = false; + continue; } if (c->attr.proc_pointer && c->ts.interface) with @@ -12031,16 +12035,20 @@ resolve_fl_derived0 (gfc_symbol *sym) { gfc_error ("Component '%s' at %L has the CONTIGUOUS attribute but " "is not an array pointer", c->name, &c->loc); - return false; + retval = false; + continue; } if (c->attr.proc_pointer && c->ts.interface) { gfc_symbol *ifc = c->ts.interface; - if (!sym->attr.vtype - && !check_proc_interface (ifc, &c->loc)) - return false; + if (!sym->attr.vtype && !check_proc_interface (ifc, &c->loc)) + { + c->tb->error = 1; + retval = false; + continue; + } if (ifc->attr.if_source || ifc->attr.intrinsic) {