diff options
author | Janus Weil <janus@gcc.gnu.org> | 2014-01-08 16:25:22 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2014-01-08 16:25:22 +0100 |
commit | 76d3d479f3918faea87b69fd416f518371f01f3b (patch) | |
tree | efcfebb98bb2e788e56504062f50016634fbe90c /gcc | |
parent | 06636b3267e8753b7303b68f935a1913d7df8024 (diff) | |
download | gcc-76d3d479f3918faea87b69fd416f518371f01f3b.zip gcc-76d3d479f3918faea87b69fd416f518371f01f3b.tar.gz gcc-76d3d479f3918faea87b69fd416f518371f01f3b.tar.bz2 |
re PR fortran/58182 (ICE with global binding name used as a FUNCTION)
2014-01-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/58182
* resolve.c (gfc_verify_binding_labels): Modify order of checks.
2014-01-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/58182
* gfortran.dg/binding_label_tests_26a.f90: New.
* gfortran.dg/binding_label_tests_26b.f90: New.
From-SVN: r206429
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/binding_label_tests_26a.f90 | 20 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/binding_label_tests_26b.f90 | 14 |
5 files changed, 48 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f35ce55..34b5cd8 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2014-01-08 Janus Weil <janus@gcc.gnu.org> + + PR fortran/58182 + * resolve.c (gfc_verify_binding_labels): Modify order of checks. + 2014-01-06 Janus Weil <janus@gcc.gnu.org> PR fortran/59589 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index e78788b..ad088bb 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -10200,11 +10200,11 @@ gfc_verify_binding_labels (gfc_symbol *sym) && ((gsym->type != GSYM_SUBROUTINE && gsym->type != GSYM_FUNCTION) || (gsym->defined && sym->attr.if_source != IFSRC_IFBODY)) && sym != gsym->ns->proc_name - && (strcmp (gsym->sym_name, sym->name) != 0 - || module != gsym->mod_name + && (module != gsym->mod_name + || strcmp (gsym->sym_name, sym->name) != 0 || (module && strcmp (module, gsym->mod_name) != 0))) { - /* Print an error if the procdure is defined multiple times; we have to + /* Print an error if the procedure is defined multiple times; we have to exclude references to the same procedure via module association or multiple checks for the same procedure. */ gfc_error ("Procedure %s with binding label %s at %L uses the same " diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f9111f9..bb71c72 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-01-08 Janus Weil <janus@gcc.gnu.org> + + PR fortran/58182 + * gfortran.dg/binding_label_tests_26a.f90: New. + * gfortran.dg/binding_label_tests_26b.f90: New. + 2014-01-08 Marek Polacek <polacek@redhat.com> PR sanitizer/59667 diff --git a/gcc/testsuite/gfortran.dg/binding_label_tests_26a.f90 b/gcc/testsuite/gfortran.dg/binding_label_tests_26a.f90 new file mode 100644 index 0000000..32cf07a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/binding_label_tests_26a.f90 @@ -0,0 +1,20 @@ +! { dg-do compile } +! +! PR 58182: [4.9 Regression] ICE with global binding name used as a FUNCTION +! +! Contributed by Andrew Bensons <abensonca@gmail.com> +! +! This file must be compiled BEFORE binding_label_tests_26b.f90, which it +! should be because dejagnu will sort the files. + +module fg +contains + function fffi(f) + interface + function f() bind(c) + end function + end interface + end function +end module + +! { dg-final { keep-modules "" } } diff --git a/gcc/testsuite/gfortran.dg/binding_label_tests_26b.f90 b/gcc/testsuite/gfortran.dg/binding_label_tests_26b.f90 new file mode 100644 index 0000000..ad8426b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/binding_label_tests_26b.f90 @@ -0,0 +1,14 @@ +! { dg-do compile } +! +! PR 58182: [4.9 Regression] ICE with global binding name used as a FUNCTION +! +! Contributed by Andrew Bensons <abensonca@gmail.com> +! +! This file must be compiled AFTER binding_label_tests_26a.f90, which it +! should be because dejagnu will sort the files. + +module f ! { dg-error "uses the same global identifier" } + use fg ! { dg-error "uses the same global identifier" } +end module + +! { dg-final { cleanup-modules "fg f" } } |