This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fortran array indexing on 64-bit targets & snapshot 971023


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]