diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2020-11-26 17:26:43 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2020-11-26 17:26:43 +0000 |
commit | c87cce5a339bae3b73f34dbc20409de07caf68da (patch) | |
tree | b0860f9106d20a08a5f010ce75a826ba77389399 /libgfortran/io/transfer.c | |
parent | 218cedd5a36ae1cdd08c5ff997027d44ef4b6542 (diff) | |
download | gcc-c87cce5a339bae3b73f34dbc20409de07caf68da.zip gcc-c87cce5a339bae3b73f34dbc20409de07caf68da.tar.gz gcc-c87cce5a339bae3b73f34dbc20409de07caf68da.tar.bz2 |
libgfortran: Correct FP feature macro checks
The *_HAS_* floating-point feature macros are defined as 0/1 rather than
#undef/#define settings by gcc/c-family/c-cppbuiltin.c. Consequently we
choose to use infinity and NaN features even with non-IEEE-754 targets
such as `vax-netbsdelf' that lack them, causing build warnings and
failures like:
In file included from .../libgfortran/generated/maxval_r4.c:26:
.../libgfortran/generated/maxval_r4.c: In function 'maxval_r4':
.../libgfortran/libgfortran.h:292:30: warning: target format does not support infinity
292 | # define GFC_REAL_4_INFINITY __builtin_inff ()
| ^~~~~~~~~~~~~~
.../libgfortran/generated/maxval_r4.c:149:19:
note: in expansion of macro 'GFC_REAL_4_INFINITY'
149 | result = -GFC_REAL_4_INFINITY;
| ^~~~~~~~~~~~~~~~~~~
.../libgfortran/generated/maxval_r4.c: In function 'mmaxval_r4':
.../libgfortran/libgfortran.h:292:30: warning: target format does not support infinity
292 | # define GFC_REAL_4_INFINITY __builtin_inff ()
| ^~~~~~~~~~~~~~
.../libgfortran/generated/maxval_r4.c:363:19:
note: in expansion of macro 'GFC_REAL_4_INFINITY'
363 | result = -GFC_REAL_4_INFINITY;
| ^~~~~~~~~~~~~~~~~~~
{standard input}: Assembler messages:
{standard input}:204: Fatal error: Can't relocate expression
make[3]: *** [Makefile:3358: maxval_r4.lo] Error 1
Correct the checks then for __FLT_HAS_INFINITY__, __DBL_HAS_INFINITY__,
__LDBL_HAS_INFINITY__, __FLT_HAS_QUIET_NAN__, __DBL_HAS_QUIET_NAN__, and
__LDBL_HAS_QUIET_NAN__ to match semantics and remove build issues coming
from the misinterpretation of these macros.
libgfortran/
* libgfortran.h: Use #if rather than #ifdef with
__FLT_HAS_INFINITY__, __DBL_HAS_INFINITY__,
__LDBL_HAS_INFINITY__, __FLT_HAS_QUIET_NAN__,
__DBL_HAS_QUIET_NAN__, and __LDBL_HAS_QUIET_NAN__.
Diffstat (limited to 'libgfortran/io/transfer.c')
0 files changed, 0 insertions, 0 deletions