re PR fortran/91802 (ICE in mio_name_expr_t, at fortran/module.c:2141)

2019-09-28  Steven G. Kargl  <kargl@gcc.ngu.org>

	PR fortran/91802
	* decl.c (attr_decl1): Check if rank+corank > 15.

2019-09-28  Steven G. Kargl  <kargl@gcc.ngu.org>

	PR fortran/91802
	* gfortran.dg/pr91802.f90: New test.

From-SVN: r276254
This commit is contained in:
Steven G. Kargl 2019-09-28 17:10:34 +00:00
parent 036aa59282
commit 4c59710186
4 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2019-09-28 Steven G. Kargl <kargl@gcc.ngu.org>
PR fortran/91802
* decl.c (attr_decl1): Check if rank+corank > 15.
2019-09-28 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91864

View File

@ -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. */

View File

@ -1,3 +1,8 @@
2019-09-28 Steven G. Kargl <kargl@gcc.ngu.org>
PR fortran/91802
* gfortran.dg/pr91802.f90: New test.
2019-09-28 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91864

View File

@ -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