http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57094
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-04-30 21:44:37 UTC --- I thought the following would work. While it does so for the test cases, it causes new failures. In principle, not elem_len but "dim[0].sm" is the correct value - assuming, it is set. --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -424,3 +424,2 @@ gfc_conv_descriptor_stride_get (tree desc, tree dim) - tmp = gfc_get_element_type (type); - size = size_in_bytes (tmp); - size = fold_convert (gfc_array_index_type, size); + size = fold_convert (gfc_array_index_type, + gfc_conv_descriptor_elem_len_get (desc)); @@ -442,2 +441,2 @@ gfc_conv_descriptor_stride_set (stmtblock_t *block, tree desc, - tmp = gfc_get_element_type (TREE_TYPE (desc)); - tmp = size_in_bytes (tmp); + tmp = fold_convert (gfc_array_index_type, + gfc_conv_descriptor_elem_len_get (desc));