diff options
author | Dominique d'Humieres <dominiq@lps.ens.fr> | 2017-10-01 11:49:48 +0200 |
---|---|---|
committer | Dominique d'Humieres <dominiq@gcc.gnu.org> | 2017-10-01 11:49:48 +0200 |
commit | efa1d7a21633c6e2e66245a11ba4347baf3d1767 (patch) | |
tree | c74716a9553d3b2eb2b6bee4de86477e13516762 /gcc | |
parent | ce22a7f915090e738f52ea020581296092f4b0b1 (diff) | |
download | gcc-efa1d7a21633c6e2e66245a11ba4347baf3d1767.zip gcc-efa1d7a21633c6e2e66245a11ba4347baf3d1767.tar.gz gcc-efa1d7a21633c6e2e66245a11ba4347baf3d1767.tar.bz2 |
re PR fortran/61450 (ICE in gfc_global_used())
2017-10-01 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/61450
* parse.c (gfc_global_used): Replace the gfc_internal_error
with an error.
2017-10-01 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/61450
* gfortran.dg/binding_label_tests_28.f90: New test.
From-SVN: r253328
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/parse.c | 24 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/binding_label_tests_28.f90 | 12 |
4 files changed, 41 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b0c9c80..b5eea87 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2017-10-01 Dominique d'Humieres <dominiq@lps.ens.fr> + + PR fortran/61450 + * parse.c (gfc_global_used): Replace the gfc_internal_error + with an error. + 2017-09-29 Dominique d'Humieres <dominiq@lps.ens.fr> PR fortran/25071 diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index e958e6d..eb0f92e 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -5742,16 +5742,28 @@ gfc_global_used (gfc_gsymbol *sym, locus *where) name = "MODULE"; break; default: - gfc_internal_error ("gfc_global_used(): Bad type"); name = NULL; } - if (sym->binding_label) - gfc_error ("Global binding name %qs at %L is already being used as a %s " - "at %L", sym->binding_label, where, name, &sym->where); + if (name) + { + if (sym->binding_label) + gfc_error ("Global binding name %qs at %L is already being used " + "as a %s at %L", sym->binding_label, where, name, + &sym->where); + else + gfc_error ("Global name %qs at %L is already being used as " + "a %s at %L", sym->name, where, name, &sym->where); + } else - gfc_error ("Global name %qs at %L is already being used as a %s at %L", - sym->name, where, name, &sym->where); + { + if (sym->binding_label) + gfc_error ("Global binding name %qs at %L is already being used " + "at %L", sym->binding_label, where, &sym->where); + else + gfc_error ("Global name %qs at %L is already being used at %L", + sym->name, where, &sym->where); + } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fcf901a..40f5934 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-01 Dominique d'Humieres <dominiq@lps.ens.fr> + + PR fortran/61450 + * gfortran.dg/binding_label_tests_28.f90: New test. + 2017-09-30 Paolo Carlini <paolo.carlini@oracle.com> PR c++/65949 diff --git a/gcc/testsuite/gfortran.dg/binding_label_tests_28.f90 b/gcc/testsuite/gfortran.dg/binding_label_tests_28.f90 new file mode 100644 index 0000000..0066a4a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/binding_label_tests_28.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } +! +! PR fortran/61450 +! Contributed by Francois-Xavier Coudert <fxcoudert@gmail.com> +! +module p + integer i1 ! { dg-error "Global binding name 'foo' at .1. is already being used at .2." } + bind(c,name="foo") :: i1 +end module + +subroutine truc() bind(c,name="foo") ! { dg-error "Global binding name 'foo' at .1. is already being used at .2." } +end |