re PR fortran/27958 (assignments to and from zero-sized string selections not handled)
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>
Thu, 8 Jun 2006 21:48:05 +0000 (23:48 +0200)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Thu, 8 Jun 2006 21:48:05 +0000 (21:48 +0000)
commit549033f3a2a4c31ca6443dc3208e6dedae8aa943
treeb0ea7c8e8dc9a94d1d9c5409105320893e6ed0d0
parentf6cf0340b9a28d1cdf632d1f4d1becc470d34ba9
re PR fortran/27958 (assignments to and from zero-sized string selections not handled)

PR fortran/27958

* trans-expr.c (gfc_conv_substring): If the substring start is
greater than its end, the length of the substring is zero, and
not negative.
(gfc_trans_string_copy): Don't generate a call to
_gfortran_copy_string when destination length is zero.

* gcc/testsuite/gfortran.dg/substr_2.f: New test.

From-SVN: r114496
gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/substr_2.f [new file with mode: 0644]