revap types, step 1

Toon Moene toon@moene.indiv.nluug.nl
Thu Aug 26 22:05:00 GMT 2004


Richard Henderson wrote:

> On Thu, Aug 26, 2004 at 11:06:04AM -0700, Steve Kargl wrote:

>>Incidently, the behavior of the -r8 option is outside the scope
>>of the Fortran standard.  It typically means that all REAL variables
>>are promoted to DOUBLE PRECISION.  It does not necessarily
>>include the promotion of all DOUBLE PRECISION variables to 
>>a QUAD precision. 
> 
> Really?  In which case maybe we don't have to do anything.
> With no special options, GCC does not currently support a
> target that doesn't have both a 1 word and a 2 word float.
> 
> I can certainly change the patch such that DOUBLE PRECISION
> doesn't adjust based on -r8.  I'm not a Fortran user though,
> so someone will have to tell me what's most useful.

What Steve wrote is the most useful, and is what a lot of compilers will 
do if you just specify -i8 -r8 (i.e., they'll map INTEGER to a 64 bit 
integer, REAL to a 64 bit floating point number and DOUBLE PRECISION 
also to a 64 bit floating point number.

However, (donning my J3 committee hat), this mapping is not conforming 
(i.e., it'll change a conforming program to a non-conforming one).

The reason most *programs* get away with this is that they were 
developed on systems where, by default, INTEGER meant 64 bit integer and 
REAL meant 64 bit floating point number *and therefore* there was no 
need to use DOUBLE PRECISION (think: Cray).  Cray compilers, in the 
converse, even had an option to "downgrade" DOUBLE PRECISION to 64 bits, 
for those programs that *had* DOUBLE PRECISION but actually only assumed 
64 bit floating point numbers.

Hope this helps,

-- 
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/



More information about the Fortran mailing list