PR fortran/99206 - ICE in add_init_expr_to_sym, at fortran/decl.c:1980
authorHarald Anlauf <anlauf@gmx.de>
Tue, 23 Feb 2021 18:09:14 +0000 (19:09 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Tue, 23 Feb 2021 18:09:14 +0000 (19:09 +0100)
commita6c7e0fcffc857e67dffdd7609be663cc3aac7d2
tree3f7b4f10ac452623e400273b8099feece02d5e6f
parent47145e6916f58e1cd4f562c06fa7289da49f690c
PR fortran/99206 - ICE in add_init_expr_to_sym, at fortran/decl.c:1980

Make sure that the string length is properly set during simplification
even when the resulting array is zero-sized.

gcc/fortran/ChangeLog:

PR fortran/99206
* simplify.c (gfc_simplify_reshape): Set string length for
character arguments.

gcc/testsuite/ChangeLog:

PR fortran/99206
* gfortran.dg/reshape_zerosize_4.f90: New test.
gcc/fortran/simplify.c
gcc/testsuite/gfortran.dg/reshape_zerosize_4.f90 [new file with mode: 0644]