> -freal-4-real-8 is not equivalent to -fdefault-real-8 and -fdefault-double-8.
> 
> -freal-4-real-8 interprets any 4-byte real type, whether it is a
> default real type or explicitly declared as 4-byte, as a 8-byte double
> precision type, and that applies to all variables, functions and
> constants.
> 
> -fdefault-real-8 will promote only default real type to double
> precision and only variables and functions. Since constants are
> usually declared explicitly as 4-byte, e.g. 1.01223e0 is an explicitly
> defined 4-byte constant in gfortran, they will not be promoted.

I agree with the above and I think this should go into the manual. One 
thing which can be done with -fdefault-real-8, but not with 
-freal-4-real-8 is to work around some pitfalls of these otions by 
specifying explicit kinds when needed (this probably explains why less 
tests fail with the former option than with the later, see results at the 
end of this mail).

In my opinion, these options, while useful, have several pitfalls:

(1) call to external procedures (especially in libraries),
(2) alignements in EQUIVALENCE and/or COMMON,
(3) generic interfaces,
(4) BOZ,
(5) I/Os,
(6) ...

I wonder if they should not have their own page in the manual with a big 
warning at the beginning telling the user that these options are likely to 
break "legacy" codes.

The raw test results are the following

make -k check-gfortran 
RUNTESTFLAGS="--target_board=unix'{-m32/-finteger-4-integer-8,
-m64/-finteger-4-integer-8,-m32/-freal-4-real-8,-m64/-freal-4-real-8,-m32/-freal-8-real-10,-m64/-freal-8-real-10}'"

                === gfortran Summary for unix/-m32/-finteger-4-integer-8 ===

# of expected passes            37336
# of unexpected failures        896
# of expected failures          39
# of unresolved testcases       1
# of unsupported tests          570

                === gfortran Summary for unix/-m64/-finteger-4-integer-8 ===

# of expected passes            37728
# of unexpected failures        840
# of expected failures          39
# of unsupported tests          409

                === gfortran Summary for unix/-m32/-freal-4-real-8 ===

# of expected passes            37526
# of unexpected failures        702
# of expected failures          39
# of unsupported tests          570

                === gfortran Summary for unix/-m64/-freal-4-real-8 ===

# of expected passes            37857
# of unexpected failures        698
# of expected failures          39
# of unsupported tests          409

                === gfortran Summary for unix/-m32/-freal-8-real-10 ===

# of expected passes            37928
# of unexpected failures        394
# of expected failures          39
# of untested testcases         8
# of unsupported tests          570

                === gfortran Summary for unix/-m64/-freal-8-real-10 ===

# of expected passes            38300
# of unexpected failures        357
# of expected failures          39
# of untested testcases         8
# of unsupported tests          409

                === gfortran Summary ===

# of expected passes            226675
# of unexpected failures        3887
# of expected failures          234
# of unresolved testcases       1
# of untested testcases         16
# of unsupported tests          2937

to be compared with

make -k check-gfortran 
RUNTESTFLAGS="--target_board=unix'{-m32/-fdefault-integer-8,
-m64/-fdefault-integer-8,-m32/-fdefault-real-8,-m64/-fdefault-real-8}'"

                === gfortran Summary for unix/-m32/-fdefault-integer-8 ===

# of expected passes            37794
# of unexpected failures        489
# of expected failures          39
# of unresolved testcases       24
# of unsupported tests          570

                === gfortran Summary for unix/-m64/-fdefault-integer-8 ===

# of expected passes            38111
# of unexpected failures        499
# of expected failures          39
# of unresolved testcases       24
# of unsupported tests          409

                === gfortran Summary for unix/-m32/-fdefault-real-8 ===

# of expected passes            37705
# of unexpected failures        539
# of expected failures          39
# of untested testcases         8
# of unsupported tests          570

                === gfortran Summary for unix/-m64/-fdefault-real-8 ===

# of expected passes            38028
# of unexpected failures        535
# of expected failures          39
# of untested testcases         8
# of unsupported tests          409

                === gfortran Summary ===

# of expected passes            151638
# of unexpected failures        2062
# of expected failures          156
# of unresolved testcases       48
# of untested testcases         16
# of unsupported tests          1958

I did not have the time to look in detail to the results. From a quick 
glance I can tell that there are overlaps between the failures of 
-fdefault-*-8 and -f*-4-*-8. In particular the ICEs with coarray appear 
for both cases (I have open pr51682).

Dominique

Reply via email to