Bug 255890 - lang/gcc10: intrinsic::ieee_arithmetic fails on aarch, powerpc architectures due to lack of support in gcc
Summary: lang/gcc10: intrinsic::ieee_arithmetic fails on aarch, powerpc architectures ...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Gerald Pfeifer
URL: https://gcc.gnu.org/bugzilla/show_bug...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-15 02:31 UTC by Yuri Victorovich
Modified: 2021-05-23 18:14 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (gerald)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2021-05-15 02:31:01 UTC
This Fortran code:
> program p
>   use, intrinsic :: ieee_arithmetic, only: IEEE_IS_NAN
>   write(*,*) ieee_is_nan(5.0)
> end

fails on these architectures:
> Fatal Error: Cannot find an intrinsic module named 'ieee_arithmetic'

Testcases: science/siesta, science/dftbplus
Comment 1 Yuri Victorovich freebsd_committer 2021-05-18 22:49:03 UTC
On architectures in question the file finclude/ieee_arithmetic.mod isn't installed.
Comment 2 Yuri Victorovich freebsd_committer 2021-05-19 03:54:05 UTC
As it turned out GCC doesn't yet support IEEE754 on aarch64 and powerpc. On aarch64 the fpu-aarch64.h file is missing in their tree. Same problem with powerpc.

Please feel free to close this bug or to keep it open, because the problem is still present. Certain ports need to be left with limited architectures.
Comment 3 Steve Kargl freebsd_committer 2021-05-23 18:14:38 UTC
(In reply to Yuri Victorovich from comment #2)
>
> As it turned out GCC doesn't yet support IEEE754 on aarch64 and powerpc.
>

This is incorrect FUD.

gfortran supports IEEE modules on these architectures on any system using glibc.

> On aarch64 the fpu-aarch64.h file is missing in their tree.
> Same problem with powerpc.

This is a woeful interpretation of what was written in the GCC bug report.
If fenv.h is supported by FreeBSD on these architectures, then someone
with access to aarch64-*-freebsd (and powerpc) needs to adjust the file
libgforan/configure.host to look for fenv capabilities.

> Please feel free to close this bug or to keep it open, because the problem
> is still present. Certain ports need to be left with limited architectures.

Note, the Fortran standard does not require a conforming Fortran processor
to provide the IEEE modules.  Until someone from FreeBSD land looks into
providing the support gfortran of aarch64 and powerpc is fully standard
conforming.

BTW, a trivially stupid patch to test is

diff --git a/libgfortran/configure.host b/libgfortran/configure.host
index e9d92c9d34d..0fece4b98b6 100644
--- a/libgfortran/configure.host
+++ b/libgfortran/configure.host
@@ -75,3 +75,7 @@ case "${target}" in
 
 esac
 
+# kludge to test if aarch64-*-freebsd works
+fpu_host='fpu-glibc'
+ieee_support='yes'
+