This is an archive of the discontinued LLVM Phabricator instance.

[Flang] Include logical default with default-integer-8
ClosedPublic

Authored by kiranchandramohan on Jul 14 2023, 2:42 AM.

Details

Summary

Other compilers include the logical default also with the
default-integer-8 setting. This patch does the same for
flang.

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 14 2023, 2:42 AM
Herald added a subscriber: sunshaoce. · View Herald Transcript
kiranchandramohan requested review of this revision.Jul 14 2023, 2:42 AM

We have a request for supporting from an internal team that relies on this feature. They pointed to the following relevant documentation of other compilers. I don't remember whether we have discussed this or whether this was left out while adding the options.

  • Gfortran: -fdefault-integer-8 Set the default integer and logical types to an 8 byte wide type.

https://gcc.gnu.org/onlinedocs/gfortran/Fortran-Dialect-Options.html

  • The nvfortran documentation has i8 modifying logicals.

https://docs.nvidia.com/hpc-sdk/compilers/hpc-compilers-ref-guide/#itwo-ifour-ieight

  • Classic Flang option : -fdefault-integer-8 Treat INTEGER and LOGICAL as INTEGER*8 and LOGICAL*8

https://github.com/flang-compiler/flang#compiler-options

  • The integer-size option of Intel also seem to behave the same for logicals.

https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2023-1/integer-size.html#GUID-50219EB9-30[…]B34-21BE0F82DCA8

awarzynski accepted this revision.Jul 15 2023, 7:18 AM

LGTM, thanks!

This revision is now accepted and ready to land.Jul 15 2023, 7:18 AM
sscalpone accepted this revision.Jul 16 2023, 7:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2023, 4:06 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript