From: Steven G. Kargl Date: Fri, 16 Mar 2018 19:20:15 +0000 (+0000) Subject: re PR fortran/69395 (ICE on declaring array with more than 7 dimensions+codimensions) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=299ab1b2a13bc34d8dd205a4762e81e627b8ba1f;p=gcc.git re PR fortran/69395 (ICE on declaring array with more than 7 dimensions+codimensions) 2018-03-16 Steven G. Kargl PR fortran/69395 * decl.c (merge_array_spec): Correct the error condition. 2018-03-16 Steven G. Kargl PR fortran/69395 * gfortran.dg/pr69395.f90: Add test for max dimensions From-SVN: r258607 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 818c50f9a19..77a6a8ca7e1 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-03-16 Steven G. Kargl + + PR fortran/69395 + * decl.c (merge_array_spec): Correct the error condition. + 2018-03-15 Steven G. Kargl PR fortran/78741 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 64199a96094..104752586b4 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 5d353f4e41f..889e1102101 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-03-16 Steven G. Kargl + + PR fortran/69395 + * gfortran.dg/pr69395.f90: Add test for max dimensions + 2018-03-16 Vladimir Makarov PR target/84876 diff --git a/gcc/testsuite/gfortran.dg/pr69395.f90 b/gcc/testsuite/gfortran.dg/pr69395.f90 index ea98baacb29..21229d39464 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