re PR fortran/79795 (Fortran ICE in resolve_symbol starting with r163221)

2017-10-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/79795
	* resolve.c (resovle_symbol): Change gcc_assert to
	sensible error message.

2017-10-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/79795
	* gfortran.dg/assumed_size_2.f90: New test.

From-SVN: r253868
This commit is contained in:
Thomas Koenig 2017-10-18 20:32:34 +00:00
parent fe94440235
commit b04bebdb1d
4 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2017-10-18 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/79795
* resolve.c (resovle_symbol): Change gcc_assert to
sensible error message.
2017-10-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82550

View File

@ -14403,7 +14403,23 @@ resolve_symbol (gfc_symbol *sym)
if (as)
{
gcc_assert (as->type != AS_IMPLIED_SHAPE);
/* If AS_IMPLIED_SHAPE makes it to here, it must be a bad
specification expression. */
if (as->type == AS_IMPLIED_SHAPE)
{
int i;
for (i=0; i<as->rank; i++)
{
if (as->lower[i] != NULL && as->upper[i] == NULL)
{
gfc_error ("Bad specification for assumed size array at %L",
&as->lower[i]->where);
return;
}
}
gcc_unreachable();
}
if (((as->type == AS_ASSUMED_SIZE && !as->cp_was_assumed)
|| as->type == AS_ASSUMED_SHAPE)
&& !sym->attr.dummy && !sym->attr.select_type_temporary)

View File

@ -1,3 +1,8 @@
2017-10-18 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/79795
* gfortran.dg/assumed_size_2.f90: New test.
2017-10-18 Uros Bizjak <ubizjak@gmail.com>
Jakub Jelinek <jakub@redhat.com>

View File

@ -0,0 +1,4 @@
! { dg-do compile }
subroutine foo(a)
dimension a(*,*) ! { dg-error "Bad specification for assumed size array" }
end