From: Steven G. Kargl Date: Sat, 28 Sep 2019 17:10:34 +0000 (+0000) Subject: re PR fortran/91802 (ICE in mio_name_expr_t, at fortran/module.c:2141) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c59710186081ed4b2d34ccda1190d43454543db;p=gcc.git re PR fortran/91802 (ICE in mio_name_expr_t, at fortran/module.c:2141) 2019-09-28 Steven G. Kargl PR fortran/91802 * decl.c (attr_decl1): Check if rank+corank > 15. 2019-09-28 Steven G. Kargl PR fortran/91802 * gfortran.dg/pr91802.f90: New test. From-SVN: r276254 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d5a17dadf47..3d40c9a24d4 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2019-09-28 Steven G. Kargl + + PR fortran/91802 + * decl.c (attr_decl1): Check if rank+corank > 15. + 2019-09-28 Steven G. Kargl PR fortran/91864 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 278882d9855..31b2336a7b0 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -8468,6 +8468,15 @@ attr_decl1 (void) goto cleanup; } + /* Check F2018:C822. */ + if (sym->attr.dimension && sym->attr.codimension + && sym->as && sym->as->rank + sym->as->corank > 15) + { + gfc_error ("rank + corank of %qs exceeds 15 at %C", sym->name); + m = MATCH_ERROR; + goto cleanup; + } + if (sym->attr.cray_pointee && sym->as != NULL) { /* Fix the array spec. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8d8ba5d4d05..5592df3e745 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-09-28 Steven G. Kargl + + PR fortran/91802 + * gfortran.dg/pr91802.f90: New test. + 2019-09-28 Steven G. Kargl PR fortran/91864 diff --git a/gcc/testsuite/gfortran.dg/pr91802.f90 b/gcc/testsuite/gfortran.dg/pr91802.f90 new file mode 100644 index 00000000000..277d61aae82 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr91802.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } +! Code contributed by Gerhard Steinmetz +! PR fortran/91802 +module m + real :: x + dimension :: x(1,2,1,2,1,2,1,2) + codimension :: x[1,2,1,2,1,2,1,*] ! { dg-error "exceeds 15" } +end