diff options
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr69395.f90 | 1 |
4 files changed, 12 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 818c50f..77a6a8c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-03-16 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/69395 + * decl.c (merge_array_spec): Correct the error condition. + 2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/78741 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 64199a96..1047525 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -871,7 +871,7 @@ merge_array_spec (gfc_array_spec *from, gfc_array_spec *to, bool copy) } } - if (to->rank + to->corank >= GFC_MAX_DIMENSIONS) + if (to->rank + to->corank > GFC_MAX_DIMENSIONS) { gfc_error ("Sum of array rank %d and corank %d at %C exceeds maximum " "allowed dimensions of %d", diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5d353f4..889e110 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-03-16 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/69395 + * gfortran.dg/pr69395.f90: Add test for max dimensions + 2018-03-16 Vladimir Makarov <vmakarov@redhat.com> PR target/84876 diff --git a/gcc/testsuite/gfortran.dg/pr69395.f90 b/gcc/testsuite/gfortran.dg/pr69395.f90 index ea98baa..21229d3 100644 --- a/gcc/testsuite/gfortran.dg/pr69395.f90 +++ b/gcc/testsuite/gfortran.dg/pr69395.f90 @@ -1,5 +1,6 @@ ! { dg-do compile } ! { dg-options "-fcoarray=single" } program p +real, dimension(1,2,1,2,1,2,1,2), codimension[1,2,1,2,1,2,*] :: y real, dimension(1,2,1,2,1,2,1,2), codimension[1,2,1,2,1,2,1,*] :: z ! { dg-error "allowed dimensions" } end |