Commit 14ee7de0 by Steven G. Kargl

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
parent 7b24db31
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/70870
* data.c (gfc_assign_data_value): Check that a data object does
not also have default initialization.
......
......@@ -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;
......
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.
2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/70870
* gfortran.dg/pr70870_1.f90: New test.
......
! { dg-do compile }
! PR fortran/85521
program p
character(3) :: c = 'abc'
character(3) :: z(1)
z = [ c(:-1) ]
print *, z
end
! { dg-do compile }
! PR fortran/85521
program p
character(3) :: c = 'abc'
character(3) :: z(1)
z = [ c(:-2) ]
print *, z
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment