Fortran array indexing on 64-bit targets & snapshot 971023
Toon Moene
toon@moene.indiv.nluug.nl
Sun Oct 26 05:26:00 GMT 1997
> I believe Jim is referring to this:
[ In expand_expr, case ARRAY_REF: ]
[ ... ]
/* Optimize the special-case of a zero lower bound.
We convert the low_bound to sizetype to avoid some problems
with constant folding. (E.g. suppose the lower bound is 1,
and its mode is QI. Without the conversion, (ARRAY
+(INDEX-(unsigned char)1)) becomes ((ARRAY+(-(unsigned
char)1))
+INDEX), which becomes (ARRAY+255+INDEX). Oops!)
But sizetype isn't quite right either (especially if
the lowbound is negative). FIXME */
[ ... ]
The problem is that you cannot be sure that sizetype is signed (see
functions `make_signed_type' and `make_unsigned_type' in
stor-layout.c).
Why it's done this way is beyond me ...
HTH,
Toon.
More information about the Gcc
mailing list