Double default byte size for REAL,INTEGER, DOUBLE and COMPLEX.
SPARC:77 x86:77
-r8 promotes the default byte size for REAL, INTEGER, DOUBLE, and COMPLEX variables declared without an explicit byte size as follows:
Table 3-17 Default Data Sizes and -r8 (Bytes)
Without -r8 option |
With -r8 option |
||
---|---|---|---|
Data Type |
default |
SPARC |
x86 |
INTEGER |
4 |
8 |
8 |
REAL |
4 |
8 |
8 |
DOUBLE |
8 |
16 |
8 |
This option applies to variables, parameters, constants, and functions.
Also, LOGICAL is treated as INTEGER, COMPLEX as two REALs, and DOUBLE COMPLEX as two DOUBLEs.
-dbl and -r8 can be expressed in terms of the more general -xtypemap= option:
On SPARC:
-dbl same as: -xtypemap=real:64,double:128,integer:64 -r8 same as: -xtypemap=real:64,double:128,integer:mixed
These options promote default DOUBLE PRECISION data to QUAD PRECISION (128 bits). This may be unwanted and may cause performance degradation. -xtypemap=real:64,double:64,integer:64 might be more appropriate than -r8 in these cases.
On x86:
-dbl same as: -xtypemap=real:64,double:64,integer:64 -r8 same as: -xtypemap=real:64,double:64,integer:mixed
For all of the floating point data types, -dbl works the same as -r8; using both -r8 and -dbl produces the same results as using only -dbl.
For INTEGER and LOGICAL data types, -dbl differs from -r8:
-dbl allocates 8 bytes, and does 8-byte arithmetic
-r8 allocates 8 bytes, and does only 4-byte arithmetic ("mixed")
In general, if you compile one subprogram with -r8, then be sure to compile all subprograms of that program with -r8. This also important with programs communicating through unformatted I/O files -- if one program is compiled with -r8, then the other program must be similarly compiled. Be also aware that this option alters the default data size of function names, including calls to library functions, unless the function name is typed explicitly with a data size.
The impact on runtime performance may be great. With -r8, an expression like float = 15.0d0*float is evaluated in quadruple precision due to the declaration of the constant.
If you select both -r8 and -i2, the results are unpredictable.