2018-04-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85520
* decl.c (gfc_match_char_spec): Check for negative length and set to 0.
2018-04-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85520
* gfortran.dg/pr85520.f90: New test.
From-SVN: r259623
+2018-04-24 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/85520
+ * decl.c (gfc_match_char_spec): Check for negative length and set to 0.
+
2018-04-14 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/81773
e = gfc_copy_expr (len);
gfc_reduce_init_expr (e);
if (e->expr_type == EXPR_CONSTANT)
- gfc_replace_expr (len, e);
+ {
+ gfc_replace_expr (len, e);
+ if (mpz_cmp_si (len->value.integer, 0) < 0)
+ mpz_set_ui (len->value.integer, 0);
+ }
else
gfc_free_expr (e);
cl->length = len;
+2018-04-24 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/85520
+ * gfortran.dg/pr85520.f90: New test.
+
2018-04-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/85512
--- /dev/null
+! { dg-do run }
+! PR fortran/85520
+! Original code from Gerhard Steinmetz <gscfq at t-online dot de>
+program p
+ character(-huge(1)) :: c = ' '
+ if (len(c) /= 0) stop 1
+end