diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-12-11 19:28:57 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-12-11 19:28:57 +0000 |
commit | c7f5b4eddd8b11383074876e45863ae6b92a1357 (patch) | |
tree | 61e92e806f787158d0ff53f923a386853fb4dc40 /gcc | |
parent | a9046e9853024206bec092dd63e21e152cb5cbca (diff) | |
download | gcc-c7f5b4eddd8b11383074876e45863ae6b92a1357.zip gcc-c7f5b4eddd8b11383074876e45863ae6b92a1357.tar.gz gcc-c7f5b4eddd8b11383074876e45863ae6b92a1357.tar.bz2 |
re PR fortran/92897 ([Coarray] ICE in gfc_set_array_spec, at fortran/array.c:864)
2019-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/92897
* array.c (gfc_set_array_spec): Remove invalid assert() triggered
by invalid Fortran code.
2019-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/92897
* gfortran.dg/pr92897.f90: New test.
From-SVN: r279247
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/array.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr92897.f90 | 8 |
4 files changed, 19 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 77675ab..474c0a4 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2019-12-11 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/92897 + * array.c (gfc_set_array_spec): Remove invalid assert() triggered + by invalid Fortran code. + 2019-12-10 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/91643 diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 36223d2..1834d2f 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -859,10 +859,6 @@ gfc_set_array_spec (gfc_symbol *sym, gfc_array_spec *as, locus *error_loc) if (as->corank) { - /* The "sym" has no corank (checked via gfc_add_codimension). Thus - the codimension is simply added. */ - gcc_assert (as->rank == 0 && sym->as->corank == 0); - sym->as->cotype = as->cotype; sym->as->corank = as->corank; /* Check F2018:C822. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 57d2a11..120b1cd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-12-11 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/92897 + * gfortran.dg/pr92897.f90: New test. + 2019-12-11 Jozef Lawrynowicz <jozef.l@mittosystems.com> * lib/gcc-dg.exp: Add dg-prune messages for when exception handling is diff --git a/gcc/testsuite/gfortran.dg/pr92897.f90 b/gcc/testsuite/gfortran.dg/pr92897.f90 new file mode 100644 index 0000000..6e0f983 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr92897.f90 @@ -0,0 +1,8 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } +! Test contributed by Gerhard Steinmetz +type(t) function f() ! { dg-error "has not been declared" } + dimension :: t(1,2,1,2,1,2,1,2) + codimension :: t[1,2,1,2,1,2,1,*] ! { dg-error "rank \\+ corank of" } +end +! { dg-prune-output "which has not been defined" } |