diff options
author | Mark Eggleston <markeggleston@gcc.gnu.org> | 2020-06-11 14:33:51 +0100 |
---|---|---|
committer | Mark Eggleston <markeggleston@gcc.gnu.org> | 2020-10-14 11:08:09 +0100 |
commit | 4d2a56a0f7135469587feacef44cf00e08f71d09 (patch) | |
tree | 263a94b0f2e2c30cacd701b05cbd7e11bf9ebf69 /gcc/fortran/decl.c | |
parent | c7b6a7587f215e913cec9ed523bf32bb0405fd3f (diff) | |
download | gcc-4d2a56a0f7135469587feacef44cf00e08f71d09.zip gcc-4d2a56a0f7135469587feacef44cf00e08f71d09.tar.gz gcc-4d2a56a0f7135469587feacef44cf00e08f71d09.tar.bz2 |
Fortran : ICE in build_field PR95614
Local identifiers can not be the same as a module name. Original
patch by Steve Kargl resulted in name clashes between common block
names and local identifiers. A local identifier can be the same as
a global identier if that identifier is not a module or a program.
The original patch was modified to reject global identifiers that
represent a module or a program.
2020-10-14 Steven G. Kargl <kargl@gcc.gnu.org>
Mark Eggleston <markeggleston@gcc.gnu.org>
gcc/fortran/ChangeLog:
PR fortran/95614
* decl.c (gfc_get_common): Use gfc_match_common_name instead
of match_common_name.
* decl.c (gfc_bind_idents): Use gfc_match_common_name instead
of match_common_name.
* match.c : Rename match_common_name to gfc_match_common_name.
* match.c (gfc_match_common): Use gfc_match_common_name instead
of match_common_name.
* match.h : Rename match_common_name to gfc_match_common_name.
* resolve.c (resolve_common_vars): Check each symbol in a
common block has a global symbol. If there is a global symbol
issue an error if the symbol type is a module or a program.
2020-10-14 Mark Eggleston <markeggleston@gcc.gnu.org>
gcc/testsuite/ChangeLog:
PR fortran/95614
* gfortran.dg/pr95614_1.f90: New test.
* gfortran.dg/pr95614_2.f90: New test.
* gfortran.dg/pr95614_3.f90: New test.
* gfortran.dg/pr95614_4.f90: New test.
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index bddf69c..6df3206 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -6007,7 +6007,7 @@ get_bind_c_idents (void) found_id = MATCH_YES; gfc_get_ha_symbol (name, &tmp_sym); } - else if (match_common_name (name) == MATCH_YES) + else if (gfc_match_common_name (name) == MATCH_YES) { found_id = MATCH_YES; com_block = gfc_get_common (name, 0); @@ -6052,7 +6052,7 @@ get_bind_c_idents (void) found_id = MATCH_YES; gfc_get_ha_symbol (name, &tmp_sym); } - else if (match_common_name (name) == MATCH_YES) + else if (gfc_match_common_name (name) == MATCH_YES) { found_id = MATCH_YES; com_block = gfc_get_common (name, 0); |