All, The attached patch fixes an ICE that occurs in gfc_simplify_tranfer. The code that causes the problem is if (!gfc_is_constant_expr (source) || (gfc_init_expr_flag && !gfc_is_constant_expr (mold)) || !gfc_is_constant_expr (size)) return NULL; in particular gfc_is_constant_expr (mold) leads to segfault. Removing the 2nd line allows the testcase to compile, but leads to several regressions. I went down the rabbit with gdb-8.0.1 to see why this was dying a horrible death, and came away with a large headache. After conferring with F95 and F2018, I concluded (and I coudl be wrong) that mold simply needs to available as a scalar or an array and it's actual value was not needed. So, I decided to use gfc_reduce_expr (mold) to see if this would fix up some rogue pointer, and well it worked. So, OK to commit? 2018-02-26 Steven G. Kargl PF fortran/51434 * simplify.c (gfc_simplify_transfer): Reduce mold. 2018-02-26 Steven G. Kargl PF fortran/51434 * gfortran.dg/pr51434.f90: New test. -- Steve