This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Fortran array indexing on 64-bit targets & snapshot 971023
- To: law at cygnus dot com
- Subject: Re: Fortran array indexing on 64-bit targets & snapshot 971023
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Sun, 26 Oct 97 14:22:50 +0100
- Cc: egcs at cygnus dot com
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <11138.877705479@hurl.cygnus.com>
> 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.