diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2017-10-18 20:32:34 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2017-10-18 20:32:34 +0000 |
commit | b04bebdb1dee362255b99e91cc48798291448dc6 (patch) | |
tree | 8964893780b6f124c767119ce4249576f645afd0 /gcc/fortran/resolve.c | |
parent | fe94440235cfaa57ee1c18abfde29c20fa3ff863 (diff) | |
download | gcc-b04bebdb1dee362255b99e91cc48798291448dc6.zip gcc-b04bebdb1dee362255b99e91cc48798291448dc6.tar.gz gcc-b04bebdb1dee362255b99e91cc48798291448dc6.tar.bz2 |
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
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 5e4988e..178854b 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -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) |