aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorMark Eggleston <markeggleston@gcc.gnu.org>2020-06-11 14:33:51 +0100
committerMark Eggleston <markeggleston@gcc.gnu.org>2020-09-27 11:47:08 +0100
commite5a76af3a2f3324efc60b4b2778ffb29d5c377bc (patch)
tree104cd071fef2bd61a93e0dea5ba6272499929d13 /gcc/testsuite/gfortran.dg
parent683e55facfd5c1d348796119424d7b3f9e889ffe (diff)
downloadgcc-e5a76af3a2f3324efc60b4b2778ffb29d5c377bc.zip
gcc-e5a76af3a2f3324efc60b4b2778ffb29d5c377bc.tar.gz
gcc-e5a76af3a2f3324efc60b4b2778ffb29d5c377bc.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 represents a common. The patch was modified to allow global identifiers that represent a common block. 2020-09-27 Steven G. Kargl <kargl@gcc.gnu.org> Mark Eggleston <markeggleston@gcc.gnu.org> gcc/fortran/ 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 known as is not a common block name. 2020-09-27 Mark Eggleston <markeggleston@gcc.gnu.org> gcc/testsuite/ PR fortran/95614 * gfortran.dg/pr95614_1.f90: New test. * gfortran.dg/pr95614_2.f90: New test.
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/pr95614_1.f906
-rw-r--r--gcc/testsuite/gfortran.dg/pr95614_2.f906
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr95614_1.f90 b/gcc/testsuite/gfortran.dg/pr95614_1.f90
new file mode 100644
index 0000000..f835143
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95614_1.f90
@@ -0,0 +1,6 @@
+! { dg-do compile }
+
+module m ! { dg-error ".1." }
+ common m ! { dg-error "cannot appear in a COMMON" }
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr95614_2.f90 b/gcc/testsuite/gfortran.dg/pr95614_2.f90
new file mode 100644
index 0000000..9d69a50
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95614_2.f90
@@ -0,0 +1,6 @@
+! { dg-do compile }
+
+module m ! { dg-error ".1." }
+ common /xc/ m ! { dg-error "cannot appear in a COMMON" }
+end
+