more on fortran array indexing
Richard Henderson
rth@cygnus.com
Thu Oct 2 13:04:00 GMT 1997
Last night I examined the differences in the output of the
friendlier FASTER_ARRAY_REFS, and the patched expr.c ARRAY_REF.
They output, respectively,
addr = ((n*64)/8 * (j-1)) + (i*8) + base - 8
and
addr = (i-1)*8 + ((j-1) * (n*64)) / 8 + base
IMO, it is obviously the FLOOR_DIV 8 that is causing the problem.
Question: Why in the world are arrays indexed as bits? There
seems to me to be very little use for such a thing, and a front
end that would need it could build it out of simpler constructs, no?
Or perhaps add a flag to TYPE to indicate whether the array is
indexed via bytes or bits to get rid of this lossage where it isn't
needed. Note that even in the FASTER_ARRAY_REFS case, there is
still the divide in the asm output -- we were able to reduce it
out of the loop, but not eliminate it.
Comments?
r~
More information about the Gcc
mailing list