PR fortran/27958
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Jun 2006 21:48:05 +0000 (21:48 +0000)
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Jun 2006 21:48:05 +0000 (21:48 +0000)
commit2810b37818755828f26039804fa366562e6d14ac
treeb0ea7c8e8dc9a94d1d9c5409105320893e6ed0d0
parent177522c3ebe63f63aa66feb6f21dd8ca35707c81
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114496 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/substr_2.f [new file with mode: 0644]