[Bug fortran/91443] -Wargument-mismatch does not catch mismatch for global procedure

2019-08-17 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91443

Thomas Koenig  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Thomas Koenig  ---
Fixed on trunk.

Next step: PR 91390.

[Bug fortran/91443] -Wargument-mismatch does not catch mismatch for global procedure

2019-08-17 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91443

--- Comment #4 from Thomas Koenig  ---
(In reply to Janne Blomqvist from comment #3)
> I'm seeing a failure in the testcase libgomp.fortran/appendix-a/a.28.5.f90
> which looks like it might(?) be caused by this:
> 
> $ gfortran a.28.5.f90 
> a.28.5.f90:29:20:
> 
>29 |   CALL SUB1(A)
>   |1
> Error: Rank mismatch in argument ‘x’ at (1) (rank-1 and scalar)
> 
> Or is this something else?

Yep, that's PR 91473.

I think I will just commit that one with -std=legacy...

[Bug fortran/91443] -Wargument-mismatch does not catch mismatch for global procedure

2019-08-16 Thread jb at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91443

Janne Blomqvist  changed:

   What|Removed |Added

 CC||jb at gcc dot gnu.org

--- Comment #3 from Janne Blomqvist  ---
I'm seeing a failure in the testcase libgomp.fortran/appendix-a/a.28.5.f90
which looks like it might(?) be caused by this:

$ gfortran a.28.5.f90 
a.28.5.f90:29:20:

   29 |   CALL SUB1(A)
  |1
Error: Rank mismatch in argument ‘x’ at (1) (rank-1 and scalar)

Or is this something else?

[Bug fortran/91443] -Wargument-mismatch does not catch mismatch for global procedure

2019-08-15 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91443

--- Comment #2 from Thomas Koenig  ---
Author: tkoenig
Date: Thu Aug 15 22:52:40 2019
New Revision: 274551

URL: https://gcc.gnu.org/viewcvs?rev=274551=gcc=rev
Log:
2019-08-15  Thomas Koenig  

PR fortran/91443
* frontend-passes.c (check_externals_expr): New function.
(check_externals_code): New function.
(gfc_check_externals): New function.
* gfortran.h (debug): Add prototypes for gfc_symbol * and
gfc_expr *.
(gfc_check_externals): Add prototype.
* interface.c (compare_actual_formal): Do not complain about
alternate returns if the formal argument is optional.
(gfc_procedure_use): Handle cases when an error has been issued
previously.  Break long line.
* parse.c (gfc_parse_file): Call gfc_check_externals for all
external procedures.
* resolve.c (resolve_global_procedure): Remove checking of
argument list.

2019-08-15  Thomas Koenig  

PR fortran/91443
* gfortran.dg/argument_checking_19.f90: New test.
* gfortran.dg/altreturn_10.f90: Change dg-warning to dg-error.
* gfortran.dg/dec_union_11.f90: Add -std=legacy.
* gfortran.dg/hollerith8.f90: Likewise. Remove warning for
Hollerith constant.
* gfortran.dg/integer_exponentiation_2.f90: New subroutine gee_i8;
use it to avoid type mismatches.
* gfortran.dg/pr41011.f: Add -std=legacy.
* gfortran.dg/whole_file_1.f90: Change warnings to errors.
* gfortran.dg/whole_file_2.f90: Likewise.


Added:
trunk/gcc/testsuite/gfortran.dg/argument_checking_19.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/frontend-passes.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/interface.c
trunk/gcc/fortran/parse.c
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/altreturn_10.f90
trunk/gcc/testsuite/gfortran.dg/dec_union_11.f90
trunk/gcc/testsuite/gfortran.dg/hollerith8.f90
trunk/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90
trunk/gcc/testsuite/gfortran.dg/pr41011.f
trunk/gcc/testsuite/gfortran.dg/whole_file_1.f90
trunk/gcc/testsuite/gfortran.dg/whole_file_2.f90

[Bug fortran/91443] -Wargument-mismatch does not catch mismatch for global procedure

2019-08-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91443

Thomas Koenig  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-08-14
   Assignee|unassigned at gcc dot gnu.org  |tkoenig at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Thomas Koenig  ---
Created attachment 46712
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46712=edit
Concept  patch

Here's a concept patch. It still causes a few regressions; I am currently not
sure if these point to problems with the patch or only require a few tweaks to
the testsuite.