2011-12-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/51338
Backport from trunk
* dependency.c (are_identical_variables): Handle case where
end fields of substring references are NULL.
2011-12-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/51338
Backport from trunk
* gfortran.dg/assumed_charlen_substring_1.f90: New test.
From-SVN: r182209
+2011-12-11 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/51338
+ Backport from trunk
+ * dependency.c (are_identical_variables): Handle case where
+ end fields of substring references are NULL.
+
2011-12-08 Toon Moene <toon@moene.org>
PR fortran/51310
break;
case REF_SUBSTRING:
- if (gfc_dep_compare_expr (r1->u.ss.start, r2->u.ss.start) != 0
- || gfc_dep_compare_expr (r1->u.ss.end, r2->u.ss.end) != 0)
+ if (gfc_dep_compare_expr (r1->u.ss.start, r2->u.ss.start) != 0)
return false;
+
+ /* If both are NULL, the end length compares equal, because we
+ are looking at the same variable. This can only happen for
+ assumed- or deferred-length character arguments. */
+
+ if (r1->u.ss.end == NULL && r2->u.ss.end == NULL)
+ break;
+
+ if (gfc_dep_compare_expr (r1->u.ss.end, r2->u.ss.end) != 0)
+ return false;
+
break;
default:
+2011-12-11 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/51338
+ Backport from trunk
+ * gfortran.dg/assumed_charlen_substring_1.f90: New test.
+
2011-12-09 Jakub Jelinek <jakub@redhat.com>
Backport from mainline