From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48211 invoked by alias); 3 Dec 2015 11:31:42 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 48193 invoked by uid 89); 3 Dec 2015 11:31:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-oi0-f46.google.com Received: from mail-oi0-f46.google.com (HELO mail-oi0-f46.google.com) (209.85.218.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 03 Dec 2015 11:31:40 +0000 Received: by oies6 with SMTP id s6so47382726oie.1; Thu, 03 Dec 2015 03:31:38 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.202.229.132 with SMTP id c126mr6865854oih.112.1449142298472; Thu, 03 Dec 2015 03:31:38 -0800 (PST) Received: by 10.202.83.141 with HTTP; Thu, 3 Dec 2015 03:31:38 -0800 (PST) In-Reply-To: <20151203064341.GA62254@troutmask.apl.washington.edu> References: <20151128161940.GA97246@troutmask.apl.washington.edu> <20151203060233.GA62024@troutmask.apl.washington.edu> <20151203062630.GA62157@troutmask.apl.washington.edu> <20151203064341.GA62254@troutmask.apl.washington.edu> Date: Thu, 03 Dec 2015 11:31:00 -0000 Message-ID: Subject: Re: [Patch, fortran] PR68534 - No error on mismatch in number of arguments between submodule and module interface From: Paul Richard Thomas To: Steve Kargl Cc: "fortran@gcc.gnu.org" , gcc-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00035.txt.bz2 Dear Steve, I'll take a look at this this afternoon. Thanks for bringing it to my attention. Cheers Paul On 3 December 2015 at 07:43, Steve Kargl wrote: > On Wed, Dec 02, 2015 at 10:26:30PM -0800, Steve Kargl wrote: >> On Wed, Dec 02, 2015 at 10:02:33PM -0800, Steve Kargl wrote: >> > Paul, >> > >> > I'm stumped. Something is broken on i386-*-freebsd. :-( >> > >> > Running /mnt/kargl/gcc/gcc/testsuite/gfortran.dg/dg.exp ... >> > FAIL: gfortran.dg/submodule_10.f08 -O (internal compiler error) >> > FAIL: gfortran.dg/submodule_10.f08 -O (test for excess errors) >> > FAIL: gfortran.dg/submodule_11.f08 -O0 (internal compiler error) >> > FAIL: gfortran.dg/submodule_11.f08 -O0 (test for excess errors) >> > FAIL: gfortran.dg/submodule_11.f08 -O1 (internal compiler error) >> > FAIL: gfortran.dg/submodule_11.f08 -O1 (test for excess errors) >> > FAIL: gfortran.dg/submodule_11.f08 -O2 (internal compiler error) >> > FAIL: gfortran.dg/submodule_11.f08 -O2 (test for excess errors) >> > FAIL: gfortran.dg/submodule_11.f08 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (internal compiler error) >> > FAIL: gfortran.dg/submodule_11.f08 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) >> > FAIL: gfortran.dg/submodule_11.f08 -O3 -g (internal compiler error) >> > FAIL: gfortran.dg/submodule_11.f08 -O3 -g (test for excess errors) >> > FAIL: gfortran.dg/submodule_11.f08 -Os (internal compiler error) >> > FAIL: gfortran.dg/submodule_11.f08 -Os (test for excess errors) >> >> Well, if I change the order of the conditionals decl.c:4831, I >> can get rid of the above FAILs. >> >> Index: decl.c >> =================================================================== >> --- decl.c (revision 231219) >> +++ decl.c (working copy) >> @@ -4826,7 +4826,7 @@ ok: >> >> /* Abbreviated module procedure declaration is not meant to have any >> formal arguments! */ >> - if (!sym->abr_modproc_decl && formal && !head) >> + if (formal && !head && sym && !sym->abr_modproc_decl) >> arg_count_mismatch = true; >> >> for (p = formal, q = head; p && q; p = p->next, q = q->next) >> >> -- >> steve >> >> > FAIL: gfortran.dg/submodule_13.f08 -O (internal compiler error) >> > FAIL: gfortran.dg/submodule_13.f08 -O (test for errors, line 29) >> > FAIL: gfortran.dg/submodule_13.f08 -O (test for excess errors) > > These ICEs persist at line 4831. In looking at the code, I'm > now somewhat unsure what it should be doing. In particular, > there are 2 gfc_error_now() calls in the below: > > > for (p = formal, q = head; p && q; p = p->next, q = q->next) > { > if ((p->next != NULL && q->next == NULL) > || (p->next == NULL && q->next != NULL)) > arg_count_mismatch = true; > else if ((p->sym == NULL && q->sym == NULL) > || strcmp (p->sym->name, q->sym->name) == 0) > continue; > else > gfc_error_now ("Mismatch in MODULE PROCEDURE formal " > "argument names (%s/%s) at %C", > p->sym->name, q->sym->name); > } > > if (arg_count_mismatch) > gfc_error_now ("Mismatch in number of MODULE PROCEDURE " > "formal arguments at %C"); > } > > return MATCH_YES; > > cleanup: > gfc_free_formal_arglist (head); > return m; > > But, we return MATCH_YES? I would expect setting m = MATCH_ERROR > and jumping to cleanup. That's ugly. > > -- > Steve -- Outside of a dog, a book is a man's best friend. Inside of a dog it's too dark to read. Groucho Marx