[Bug fortran/77746] [7/8 Regression] [F03] Wrong subroutine called, clash of specific procedure name and binding-name

2019-03-16 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77746

Thomas Koenig  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Thomas Koenig  ---
Fixed on all open branches, closing.

... and for this one, too.

[Bug fortran/77746] [7/8 Regression] [F03] Wrong subroutine called, clash of specific procedure name and binding-name

2019-03-16 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77746

--- Comment #8 from Thomas Koenig  ---
Author: tkoenig
Date: Sat Mar 16 13:24:40 2019
New Revision: 269723

URL: https://gcc.gnu.org/viewcvs?rev=269723=gcc=rev
Log:
2019-03-16  Thomas Koenig  

PR fortran/66695
PR fortran/77746
PR fortran/79485
Backport from trunk
* gfortran.h (gfc_symbol): Add bind_c component.
(gfc_get_gsymbol): Add argument bind_c.
* decl.c (add_global_entry): Add bind_c argument to
gfc_get_symbol.
* parse.c (parse_block_data): Likewise.
(parse_module): Likewise.
(add_global_procedure): Likewise.
(add_global_program): Likewise.
* resolve.c (resolve_common_blocks): Likewise.
(resolve_global_procedure): Likewise.
(gfc_verify_binding_labels): Likewise.
* symbol.c (gfc_get_gsymbol): Add argument bind_c. Set bind_c
in gsym.
* trans-decl.c (gfc_get_module_backend_decl): Add bind_c argument
to gfc_get_symbol.
(gfc_get_extern_function_decl): If the sym has a binding label
and it cannot be found in the global symbol tabel, it is the wrong
one and vice versa.

2019-03-16 Thomas Koenig  

PR fortran/66695
PR fortran/77746
PR fortran/79485
Backport from trunk
* gfortran.dg/binding_label_tests_30.f90: New test.
* gfortran.dg/binding_label_tests_31.f90: New test.
* gfortran.dg/binding_label_tests_32.f90: New test.
* gfortran.dg/binding_label_tests_33.f90: New test.


Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/binding_label_tests_30.f90
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/binding_label_tests_31.f90
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/binding_label_tests_32.f90
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/binding_label_tests_33.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/decl.c
branches/gcc-7-branch/gcc/fortran/gfortran.h
branches/gcc-7-branch/gcc/fortran/parse.c
branches/gcc-7-branch/gcc/fortran/resolve.c
branches/gcc-7-branch/gcc/fortran/symbol.c
branches/gcc-7-branch/gcc/fortran/trans-decl.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/77746] [7/8 Regression] [F03] Wrong subroutine called, clash of specific procedure name and binding-name

2019-03-16 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77746

--- Comment #7 from Thomas Koenig  ---
Author: tkoenig
Date: Sat Mar 16 13:16:11 2019
New Revision: 269722

URL: https://gcc.gnu.org/viewcvs?rev=269722=gcc=rev
Log:
2019-03-16  Thomas Koenig  

PR fortran/66695
PR fortran/77746
PR fortran/79485
Backport from trunk
* gfortran.h (gfc_symbol): Add bind_c component.
(gfc_get_gsymbol): Add argument bind_c.
* decl.c (add_global_entry): Add bind_c argument to
gfc_get_symbol.
* parse.c (parse_block_data): Likewise.
(parse_module): Likewise.
(add_global_procedure): Likewise.
(add_global_program): Likewise.
* resolve.c (resolve_common_blocks): Likewise.
(resolve_global_procedure): Likewise.
(gfc_verify_binding_labels): Likewise.
* symbol.c (gfc_get_gsymbol): Add argument bind_c. Set bind_c
in gsym.
* trans-decl.c (gfc_get_module_backend_decl): Add bind_c argument
to gfc_get_symbol.
(gfc_get_extern_function_decl): If the sym has a binding label
and it cannot be found in the global symbol tabel, it is the wrong
one and vice versa.

2019-03-16 Thomas Koenig  

PR fortran/66695
PR fortran/77746
PR fortran/79485
Backport from trunk
* gfortran.dg/binding_label_tests_30.f90: New test.
* gfortran.dg/binding_label_tests_31.f90: New test.
* gfortran.dg/binding_label_tests_32.f90: New test.
* gfortran.dg/binding_label_tests_33.f90: New test.


Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/binding_label_tests_30.f90
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/binding_label_tests_31.f90
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/binding_label_tests_32.f90
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/binding_label_tests_33.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/decl.c
branches/gcc-8-branch/gcc/fortran/gfortran.h
branches/gcc-8-branch/gcc/fortran/parse.c
branches/gcc-8-branch/gcc/fortran/resolve.c
branches/gcc-8-branch/gcc/fortran/symbol.c
branches/gcc-8-branch/gcc/fortran/trans-decl.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog