On 9/3/21 3:14 AM, Tobias Burnus wrote:

If I read https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html correctly, we should use _Float128 for the following errors

"The _Float128 type is supported on all systems where __float128 is supported or where long double has the IEEE binary128 format."

Applies to:

For
typecodes-array-float128.f90
FAIL: gfortran.dg/c-interop/typecodes-array-float128.f90   -O0  (test for excess errors)
Excess errors:
/gcc/testsuite/gfortran.dg/c-interop/typecodes-array-float128-c.c:35:32: error: '__float128' undeclared (first use in this function); did you mean '_Float128'?
typecodes-sanity.f90
FAIL: gfortran.dg/c-interop/typecodes-sanity.f90   -O0  (test for excess errors)
Excess errors:
/gcc/testsuite/gfortran.dg/c-interop/typecodes-sanity-c.c:41:13: error: '__float128' undeclared here (not in a function); did you mean '_Float128'?
typecodes-scalar-float128.f90
FAIL: gfortran.dg/c-interop/typecodes-scalar-float128.f90   -O0  (test for excess errors)
Excess errors:
/gcc/testsuite/gfortran.dg/c-interop/typecodes-scalar-float128-c.c:34:32: error: '__float128' undeclared (first use in this function); did you mean '_Float128'?

Just so I'm clear on this, the situation with ARM/AArch64 is that it provides _Float128 but not __float128?

The GNU Fortran manual explicitly defines C_FLOAT128 as corresponding to __float128, not _Float128 or some other 128-bit floating-point type.

https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gfortran/ISO_005fC_005fBINDING.html#ISO_005fC_005fBINDING

So the situation with ARM/AArch64 is that it provides _Float128 but not __float128?

I guess we could change the documentation and all the references in the implementation as well as the test cases to tie this kind to _Float128 instead. I think that is backward-compatible with all existing uses?

* * *
PR100914.f90
FAIL: gfortran.dg/PR100914.f90   -O0  (test for excess errors)
Excess errors:
/gcc/testsuite/gfortran.dg/PR100914.c:8:10: fatal error: quadmath.h: No such file or directory

Does ARM/Aarch64 provide _Float128 support without also providing libquadmath.h? I'm trying to understand why it got that particular error. :-S


  * * *

On a normal x86-64 system, I get XPASS for:

gfortran.dg/PR100914.f90

gfortran.dg/c-interop/typecodes-array-float128.f90

The ! { dg-do run { xfail { { x86_64*-*-* i?86*-*-* } && longdouble128 } } }
does not help as it just checks whether 'sizeof(long double)==16',
which seemingly passes also on x86-64 with 80bit long double.

I don't understand this, either. I've been testing on an i686-pc-linux-gnu build with both -m32 and -m64. The tests PASS on -m32 and XFAIL on -m64. The XFAIL is there because with -m64, sizeof (long double) == 16 and it can't be disambiguated from the true 128-bit floating point type __float128 which also has size 16, and the other patch I committed makes it choose the standard type over the GNU extension type. With -m32, the 80-bit long double type has size 12 instead so there is no conflict.

-Sandra

Reply via email to