This problem is when array indexes are given that have non-integer expressions or otherwise bad arrays, not just related to reshape. There are several test cases presented in the PR. Most of these are fixed by adding a check for any non-integer in match_array_element_spec. The patch-let in gfc_simplify_reshape avoids passing a NULL shape further into simplification. I will add an additional test case for the original posted problem in the PR. Two existing tests get exercised, changing the error message. Finding the problems earlier in the matchers I think is the right way to go. I am curious if the old checks ever get triggered (I will look into that a little later. Regression tested on x86-64-linux. OK for trunk? 2016-04-02 Jerry DeLisle PR fortran/68566 * array.c (match_array_element_spec): Add check for non-integer dimension given. * simplify.c (gfc_simplify_reshape): If source shape is NULL return.