[Fortran] Disambiguate A(I,...) and A(I+1,...)

MOENE Toon toon.moene@cnrm.meteo.fr
Mon Mar 27 09:53:00 GMT 2006


Roger,

> The middle-end assumes that pointer arithmetic doesn't
> overflow, which I believe is also reasonable in fortran array index
> expressions (perhaps a language lawyer can comment).

Yes, you can assume that - it's what allows us to "promote" the 32-bit index
calculations to 64 bit on 64-bit targets; it doesn't matter if they'd overflow
32-bit calculations, because that wouldn't be possible in a legal Fortran program.

(Strictly speaking, the standard doesn't discuss the size of integers, but
overflowing is not part of the valid computations you can do with them).

Cheers,

Toon Moene (temporarily at Meteo France)



More information about the Fortran mailing list