re PR fortran/89077 (ICE using * as len specifier for character parameter)

2019-02-04  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/89077
	* gfortran.dg/pr89077.f90: New test.

2019-02-04  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/89077
	* gfortran.dg/pr89077.f90: New test.

From-SVN: r268525
This commit is contained in:
Harald Anlauf 2019-02-04 20:44:22 +00:00 committed by Harald Anlauf
parent 0058a283e1
commit bc1efcb737
4 changed files with 23 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2019-02-04 Harald Anlauf <anlauf@gmx.de>
PR fortran/89077
* decl.c (add_init_expr_to_sym): Copy length of string initializer
to declared symbol.
2019-02-04 Martin Liska <mliska@suse.cz>
PR fortran/89185

View File

@ -1921,7 +1921,7 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
}
else if (init->ts.u.cl && init->ts.u.cl->length)
sym->ts.u.cl->length =
gfc_copy_expr (sym->value->ts.u.cl->length);
gfc_copy_expr (init->ts.u.cl->length);
}
}
/* Update initializer character length according symbol. */

View File

@ -1,3 +1,8 @@
2019-02-04 Harald Anlauf <anlauf@gmx.de>
PR fortran/89077
* gfortran.dg/pr89077.f90: New test.
2019-02-04 Martin Liska <mliska@suse.cz>
PR ipa/88985

View File

@ -0,0 +1,11 @@
! { dg-do run }
!
! PR fortran/89077 - ICE using * as len specifier for character parameter
program test
implicit none
integer :: i
character(*), parameter :: s = 'abcdef'
character(*), parameter :: t = transfer ([(s(i:i), i=1,len(s))], s)
if (len (t) /= len (s) .or. t /= s) stop 1
end