2017-11-08 Steven G. Kargl <kargl@kgcc.gnu.org>
PR Fortran/82841
* simplify.c(gfc_simplify_transfer): Do not dereference a NULL pointer.
Unwrap a short line.
2017-11-08 Steven G. Kargl <kargl@kgcc.gnu.org>
PR Fortran/82841
* gfortran.dg/transfer_simplify_11.f90: new test.
From-SVN: r254555
+2017-11-08 Steven G. Kargl <kargl@kgcc.gnu.org>
+
+ PR Fortran/82841
+ * simplify.c(gfc_simplify_transfer): Do not dereference a NULL pointer.
+ Unwrap a short line.
+
2017-11-08 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/82884
return NULL;
/* Calculate the size of the source. */
- if (source->expr_type == EXPR_ARRAY
- && !gfc_array_size (source, &tmp))
+ if (source->expr_type == EXPR_ARRAY && !gfc_array_size (source, &tmp))
gfc_internal_error ("Failure getting length of a constant array.");
/* Create an empty new expression with the appropriate characteristics. */
&source->where);
result->ts = mold->ts;
- mold_element = mold->expr_type == EXPR_ARRAY
+ mold_element = (mold->expr_type == EXPR_ARRAY && mold->value.constructor)
? gfc_constructor_first (mold->value.constructor)->expr
: mold;
+2017-11-08 Steven G. Kargl <kargl@kgcc.gnu.org>
+
+ PR Fortran/82841
+ * gfortran.dg/transfer_simplify_11.f90: New test.
+
2017-11-08 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/82884
--- /dev/null
+! { dg-do run }
+! PR Fortran/82841
+!
+ integer, parameter :: N = 2
+ character(len=1) :: chr(N)
+ chr = transfer(repeat("x",ncopies=N),[character(len=1) ::], N)
+ if (chr(1) /= 'x' .and. chr(2) /= 'x') call abort
+end