This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug fortran/57871] gfortran -freal-4-real-16 gives wrong result for selected_real_kind(1)


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57871

--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> The reason I sent that bug report is that I had read the manual and
> found that -freal-4-real-16 makes the available real kinds 8, 10, 16.
> The Fortran standard says selected_real_kind(1) must give the kind with
> the smallest available decimal precision that has precison at least 1. 
> In the circumstances that is kind 8. The manual refers to promotion of
> REAL(KIND=M) entities. Selected_real_kind is an integer entity not a
> real one.

AFAIU this is based on the expectation that the conversion options act as a
"pre-processor", i.e., take place before the compilation really starts. The
results show that expectation is not true and that the options act as a
"post-processor", i.e., the code is compiled as if the option was not provided,
then the conversion takes place.

selected_real_kind is probably the only function that can show the difference.

IMO this should be documented and the PR closed as WONTFIX.

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