https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68534

--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to mwahab from comment #4)
> (In reply to Paul Thomas from comment #3)
> > Author: pault
> Hello
> 
> > Date: Mon Nov 30 13:33:27 2015
> > New Revision: 231072
> > 
> > URL: https://gcc.gnu.org/viewcvs?rev=231072&root=gcc&view=rev
> > Log:
> > 2015-11-30  Paul Thomas  <pa...@gcc.gnu.org>
> > 
> >     PR fortran/68534
> >     * decl.c (gfc_match_formal_arglist): Cope with zero formal args
> >     either in interface declaration or in procedure declaration in
> >     submodule.
> > 
> > 2015-11-30  Paul Thomas  <pa...@gcc.gnu.org>
> > 
> >     PR fortran/68534
> >     * gfortran.dg/submodule_13.f08: New test.
> > 
> 
> This test is failing on aarch64-none-linux-gnu, it looks like the second
> dg-error (on module subroutine bar) doesn't get the output it expected.
> Running from the command line, only the first error message is emitted.
> 
> Is the test correct?

The original patch has a fundamental error. 'sym' appears incorrectly instead
of 'progname', thusly:
Index: gcc/fortran/decl.c
===================================================================
*** gcc/fortran/decl.c  (revision 231253)
--- gcc/fortran/decl.c  (working copy)
*************** gfc_match_formal_arglist (gfc_symbol *pr
*** 4692,4698 ****
  {
    gfc_formal_arglist *head, *tail, *p, *q;
    char name[GFC_MAX_SYMBOL_LEN + 1];
!   gfc_symbol *sym;
    match m;
    gfc_formal_arglist *formal = NULL;

--- 4692,4698 ----
  {
    gfc_formal_arglist *head, *tail, *p, *q;
    char name[GFC_MAX_SYMBOL_LEN + 1];
!   gfc_symbol *sym = NULL;
    match m;
    gfc_formal_arglist *formal = NULL;

*************** ok:
*** 4826,4832 ****

        /* Abbreviated module procedure declaration is not meant to have any
         formal arguments!  */
!       if (!sym->abr_modproc_decl && formal && !head)
        arg_count_mismatch = true;

        for (p = formal, q = head; p && q; p = p->next, q = q->next)
--- 4826,4832 ----

        /* Abbreviated module procedure declaration is not meant to have any
         formal arguments!  */
!       if (formal && !head && !progname->abr_modproc_decl)
        arg_count_mismatch = true;

        for (p = formal, q = head; p && q; p = p->next, q = q->next)

I'll test it properly tonight.

By the way, Steve, the exit is in some ways ugly. However, I ran into ICEs,
when I originally tried the conventional approach, whose origin I could not
figure out. I will have another go at it.

Paul

Reply via email to