*** f-valprint.c Mon Oct 21 17:47:36 2002 --- /tmp/gdb-5.2/gdb/f-valprint.c Mon Oct 21 16:14:33 2002 *************** f77_create_arrayprint_offset_tbl (struct *** 234,239 **** --- 234,241 ---- int eltlen; int ndimen = 1; int upper, lower, retcode; + int i, j; + int t; tmp_type = type; *************** f77_create_arrayprint_offset_tbl (struct *** 256,270 **** ndimen++; } /* Now we multiply eltlen by all the offsets, so that later we can print out array elements correctly. Up till now we know an offset to apply to get the item but we also have to know how much to add to get to the next item */ ndimen--; eltlen = TYPE_LENGTH (tmp_type); F77_DIM_OFFSET (ndimen) = eltlen; ! while (--ndimen > 0) { eltlen *= F77_DIM_SIZE (ndimen + 1); F77_DIM_OFFSET (ndimen) = eltlen; --- 258,285 ---- ndimen++; } + /* Now we multiply eltlen by all the offsets, so that later we can print out array elements correctly. Up till now we know an offset to apply to get the item but we also have to know how much to add to get to the next item */ ndimen--; + + /** + intel compiler, reckon this to be wrong way round.. so here's a quick in-place swap. + */ + + for (i = 1, j = ndimen; i < j; i++,j--) { + t = F77_DIM_SIZE(i); + F77_DIM_SIZE(i) = F77_DIM_SIZE(j); + F77_DIM_SIZE(j) = t; + } + eltlen = TYPE_LENGTH (tmp_type); F77_DIM_OFFSET (ndimen) = eltlen; ! ! while (--ndimen > 0) { eltlen *= F77_DIM_SIZE (ndimen + 1); F77_DIM_OFFSET (ndimen) = eltlen;