[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2022-09-10 Thread vital.had at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

Sergey Fedorov  changed:

   What|Removed |Added

 CC||vital.had at gmail dot com

--- Comment #17 from Sergey Fedorov  ---
The same failure happens on MacOS PPC with GCC12:

/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_OpenCoarrays/OpenCoarrays/work/OpenCoarrays-2.10.0/src/tests/integration/pde_solvers/coarrayBurgers/main.F90:3:20:

3 |   use, intrinsic :: ieee_arithmetic, only : ieee_is_nan
  |1
Fatal Error: Cannot find an intrinsic module named 'ieee_arithmetic' at (1)
compilation terminated.
Error: command:
   `/opt/local/bin/mpif90-mpich-gcc12
-I/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_OpenCoarrays/OpenCoarrays/work/build/include/OpenCoarrays-2.10.0_GNU-12.2.0
-fcoarray=lib -DGCC_GE_7 -DGCC_GE_8 -DHAVE_MPI -DMPI_WORKING_MODULE
-DPREFIX_NAME=_gfortran_caf_
-I/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_OpenCoarrays/OpenCoarrays/work/build/src/tests/integration/pde_solvers/coarrayBurgers/library
-pipe -Os -m32 -mmacosx-version-min=10.6 -c
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_OpenCoarrays/OpenCoarrays/work/OpenCoarrays-2.10.0/src/tests/integration/pde_solvers/coarrayBurgers/main.F90
-o CMakeFiles/coarray_burgers_pde.dir/main.F90.o`
failed to compile.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2022-05-16 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

Piotr Kubaj  changed:

   What|Removed |Added

 CC||pkubaj at anongoth dot pl

--- Comment #16 from Piotr Kubaj  ---
This issue has been fixed in FreeBSD's main branch on powerpc* in
https://cgit.freebsd.org/src/commit/?id=448c505c33cc334193590f3844406d6a74f26e2a

Similar fix could be done for other affected architectures.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-08-29 Thread andreast at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #15 from Andreas Tobler  ---
Regarding comment #10, Steve is right with his guess, configure doesn't find
the fenv functionalities needed. The reason is pretty simple, for aarch64 and
powerpc, they are not public. A quick trial showed that if they are visible,
then gfortran is 'happy' and nearly all ieee testcases pass. I did not
investigate the failing parts.
The big issue is, how can we make them available to libm. This is an OS issue
and not a gcc issue.
The only thing I'm confused in gcc land, as Steve as well, why is the file
named fpu-glibc and not fpu-fenv?
Regarding the OS issue, it might take a while to (re)solve this.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-08-12 Thread kargl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #14 from kargl at gcc dot gnu.org ---
(In reply to Gerald Pfeifer from comment #12)
> Andreas, is this something you may be able to have a look at?
> (It's about the architectures you used to "play" with on FreeBSD.)

There are other PRs that affect (all archs on) FreeBSD that have been
orphaned.

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

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-08-12 Thread andreast at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #13 from Andreas Tobler  ---
I try to find some spare cycles to look into. But I can only investigate the
aarch64 part. The powerpcs are gone here.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-08-12 Thread gerald at pfeifer dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

Gerald Pfeifer  changed:

   What|Removed |Added

 CC||andreast at gcc dot gnu.org,
   ||gerald at pfeifer dot com
 Ever confirmed|0   |1
   Last reconfirmed||2021-08-12
 Status|UNCONFIRMED |NEW

--- Comment #12 from Gerald Pfeifer  ---
Andreas, is this something you may be able to have a look at?
(It's about the architectures you used to "play" with on FreeBSD.)

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-25 Thread ripero84 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #11 from ripero84 at gmail dot com ---
Thank you very much for the information and your help.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-19 Thread sgk at troutmask dot apl.washington.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #10 from Steve Kargl  ---
On Wed, May 19, 2021 at 09:45:12AM +, ripero84 at gmail dot com wrote:
> --- Comment #9 from ripero84 at gmail dot com ---
> Steve, is this a GCC bug or a FreeBSD bug (or if it is something else, what
> side does this belong to)?

I suppose it is both.  AFAIK, there is no longer an active FreeBSD
maintainer for GCC (if there were, the few non-gfortran PR/patches
I submitted would have been committed).  I no longer send patches
to GCC for gfortran as I know virtually nothing about git.

> Other OSs seem to be able to compile gfortran with these modules for these
> architectures, see, e.g.,
> https://packages.ubuntu.com/focal/arm64/gfortran-10/filelist and
> https://packages.ubuntu.com/focal/ppc64el/gfortran-10/filelist).  And they 
> seem
> to have been able to do so since the introduction of the three Fortran IEEE
> intrinsic modules in GCC 5
> (https://packages.ubuntu.com/bionic/amd64/gfortran-5/filelist and
> https://packages.ubuntu.com/bionic/ppc64el/gfortran-5/filelist). Therefore,
> some kind of solution must exist for this - and probably has been there for
> over half a decade. (Apologies for not being able to provide a better insight
> from the Ubuntu sources.)

ubuntu is glibc.  You (or something) needs to read libgfortran/configure.host,
and add the needed logic for FreeBSD to pick up an appropriate fpu-*.h
file on aarch64.  The first 3 non-comment lines of that file are

# DEFAULTS
fpu_host='fpu-generic'
ieee_support='no'

which is what non-i386/amd64 FreeBSD systems likely use.  It seems
fpu-generic.h provides stubs for a few functions required to build
gfortran.  After gfortran is built, installation does not install
useless ieee*.mod files.  Note, a standard conforming Fortran
compiler is not required to support the ieee modules.

Furhter down in the file, there is a check for fenv compatibilities,

if test "x${have_feenableexcept}" = "xyes"; then
  fpu_host='fpu-glibc'
  ieee_support='yes'
fi

but the name of the file seems too specific to glibc.  If fenv
facilities are available, I would have thought the file would
be named fpu-fenv.h.  My guess is that configure does not find
fenv on aarch64 FreeBSD and/or aarch64 FreeBSD does not support
fenv.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-19 Thread ripero84 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

ripero84 at gmail dot com changed:

   What|Removed |Added

 CC||ripero84 at gmail dot com

--- Comment #9 from ripero84 at gmail dot com ---
Steve, is this a GCC bug or a FreeBSD bug (or if it is something else, what
side does this belong to)?

Other OSs seem to be able to compile gfortran with these modules for these
architectures, see, e.g.,
https://packages.ubuntu.com/focal/arm64/gfortran-10/filelist and
https://packages.ubuntu.com/focal/ppc64el/gfortran-10/filelist).  And they seem
to have been able to do so since the introduction of the three Fortran IEEE
intrinsic modules in GCC 5
(https://packages.ubuntu.com/bionic/amd64/gfortran-5/filelist and
https://packages.ubuntu.com/bionic/ppc64el/gfortran-5/filelist). Therefore,
some kind of solution must exist for this - and probably has been there for
over half a decade. (Apologies for not being able to provide a better insight
from the Ubuntu sources.)

Thank you.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-18 Thread sgk at troutmask dot apl.washington.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #8 from Steve Kargl  ---
On Wed, May 19, 2021 at 01:43:28AM +, yuri at tsoft dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662
> 
> --- Comment #7 from Yuri  ---
> fpu-387.h is in the gcc10 source tree:
> > $ find . -name "fpu-*"
> > ./work/gcc-10.3.0/libgfortran/config/fpu-generic.h
> > ./work/gcc-10.3.0/libgfortran/config/fpu-sysv.h
> > ./work/gcc-10.3.0/libgfortran/config/fpu-glibc.h
> > ./work/gcc-10.3.0/libgfortran/config/fpu-aix.h
> > ./work/gcc-10.3.0/libgfortran/config/fpu-387.h
> 
> fpu-aarch64.h isn't in the gcc10 tree, and not among FreeBSD-installed 
> headers.
> 
> It seems that it is missing in gcc?
> 

Yes, you would need to write the fpu-aarch64.h header.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-18 Thread yuri at tsoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #7 from Yuri  ---
fpu-387.h is in the gcc10 source tree:
> $ find . -name "fpu-*"
> ./work/gcc-10.3.0/libgfortran/config/fpu-generic.h
> ./work/gcc-10.3.0/libgfortran/config/fpu-sysv.h
> ./work/gcc-10.3.0/libgfortran/config/fpu-glibc.h
> ./work/gcc-10.3.0/libgfortran/config/fpu-aix.h
> ./work/gcc-10.3.0/libgfortran/config/fpu-387.h

fpu-aarch64.h isn't in the gcc10 tree, and not among FreeBSD-installed headers.

It seems that it is missing in gcc?

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-18 Thread sgk at troutmask dot apl.washington.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #6 from Steve Kargl  ---
On Wed, May 19, 2021 at 12:56:57AM +, yuri at tsoft dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662
> 
> --- Comment #5 from Yuri  ---
> config.log doesn't contain the IEEE string even on amd64.
> 
> libgfortran/configure.host seems to only enable IEEE modules on i?86 | x86_64
> architectures through this code:
> 
> > case "${host_cpu}" in
> >   i?86 | x86_64)
> > if test "x${have_soft_float}" = "xyes"; then
> >   fpu_host='fpu-generic'
> > else
> >   fpu_host='fpu-387'
> > fi
> > ieee_support='yes'
> > ;;
> > esac
> 
> What does gcc need from OS for IEEE754?
> Shouldn't it just compile with relevant to IEEE754 opcodes?
> 

In 

x86_64-unknown-freebsd14.0/libgfortran/config.log

I see

configure:26522: FPU dependent file will be fpu-387.h
configure:26524: Support for IEEE modules: yes

Looking at libgfortran/configure and libgfortran/configure.host
and looking in libgfortran/config/, it seems you'll need to define
an fpu-aarch64.h

I don't have an aarch64 system nor access to such a system,
so can't help you more.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-18 Thread yuri at tsoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #5 from Yuri  ---
config.log doesn't contain the IEEE string even on amd64.

libgfortran/configure.host seems to only enable IEEE modules on i?86 | x86_64
architectures through this code:

> case "${host_cpu}" in
>   i?86 | x86_64)
> if test "x${have_soft_float}" = "xyes"; then
>   fpu_host='fpu-generic'
> else
>   fpu_host='fpu-387'
> fi
> ieee_support='yes'
> ;;
> esac

What does gcc need from OS for IEEE754?
Shouldn't it just compile with relevant to IEEE754 opcodes?

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-18 Thread sgk at troutmask dot apl.washington.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #4 from Steve Kargl  ---
On Tue, May 18, 2021 at 10:47:30PM +, yuri at tsoft dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662
> 
> --- Comment #3 from Yuri  ---
> On amd64 gcc installs the file finclude/ieee_arithmetic.mod
> and on aarch64 this file isn't installed.
> 
> What is installed is defined by the gcc build process.
> 

Does FreeBSD support IEEE754 on aarch64?  What does config.log
say about IEEE modules?

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-18 Thread yuri at tsoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #3 from Yuri  ---
On amd64 gcc installs the file finclude/ieee_arithmetic.mod and on aarch64 this
file isn't installed.

What is installed is defined by the gcc build process.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-18 Thread yuri at tsoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

--- Comment #2 from Yuri  ---
intrinsic::ieee_arithmetic works fine on amd64/i386 architectures on the same
OS.

What do you think is missing/wrong in the OS that causes it?

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2021-05-18 Thread kargl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
Looks like an OS problem.  Not sure GCC can do anything here.