https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68227
--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- The ICE occurs at gcc_assert (INTEGER_CST_P (size)); I don't follow the logic of gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock, tree elem_type) { tree tmpvar; tree type; tree tmp; if (INTEGER_CST_P (size)) tmp = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type, size, gfc_index_one_node); else tmp = NULL_TREE; type = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp); type = build_array_type (elem_type, type); if (gfc_can_put_var_on_stack (bytesize)) { gcc_assert (INTEGER_CST_P (size)); tmpvar = gfc_create_var (type, "temp"); *pdata = NULL_TREE; } else ... >From the first 'if' block, I understand that INTEGER_CST_P (size) can be NULL, why the first branch in the second if block can be taken in this case? May be related to pr55086.