diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2018-05-10 22:45:38 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2018-05-10 22:45:38 +0000 |
commit | 14ee7de064f757c7677b906010f7e67e702b62c7 (patch) | |
tree | e5914f4160f3bd751f30a1d7357481e8697dd47e /gcc/fortran/array.c | |
parent | 7b24db31a41695cfd4adcee73f5edd73ae001517 (diff) | |
download | gcc-14ee7de064f757c7677b906010f7e67e702b62c7.zip gcc-14ee7de064f757c7677b906010f7e67e702b62c7.tar.gz gcc-14ee7de064f757c7677b906010f7e67e702b62c7.tar.bz2 |
re PR fortran/85521 (ICE in gfc_resolve_character_array_constructor, at fortran/array.c:2049)
2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85521
* array.c (gfc_resolve_character_array_constructor): Substrings
with upper bound smaller than lower bound are zero length strings.
2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85521
* gfortran.dg/pr85521_1.f90: New test.
* gfortran.dg/pr85521_2.f90: New test.
From-SVN: r260139
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r-- | gcc/fortran/array.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 58d611ba..052775f 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -2046,7 +2046,8 @@ got_charlen: else return true; - gcc_assert (current_length != -1); + if (current_length < 0) + current_length = 0; if (found_length == -1) found_length = current_length; |