gcc/fortran/ChangeLog:
PR fortran/85130
* expr.c (find_substring_ref): Handle given substring start and
end indices as signed integers, not unsigned.
gcc/testsuite/ChangeLog:
PR fortran/85130
* gfortran.dg/substr_6.f90: Revert commit r8-7574, adding again
test that was erroneously considered as illegal.
*newp = gfc_copy_expr (p);
free ((*newp)->value.character.string);
- end = (gfc_charlen_t) mpz_get_ui (p->ref->u.ss.end->value.integer);
- start = (gfc_charlen_t) mpz_get_ui (p->ref->u.ss.start->value.integer);
+ end = (gfc_charlen_t) mpz_get_si (p->ref->u.ss.end->value.integer);
+ start = (gfc_charlen_t) mpz_get_si (p->ref->u.ss.start->value.integer);
if (end >= start)
length = end - start + 1;
else
CHARACTER*5 c(1)
CHARACTER(1), parameter :: c1(5) = (/ "1", "2", "3", ACHAR(0), "5" /)
+c = c0(1)(-5:-8)
+if (c(1) /= " ") STOP 1
c = (/ c0(1)(1:5) /)
do i=1,5
if (c(1)(i:i) /= c1(i)) STOP 2