Commit Graph

1949 Commits

Author SHA1 Message Date
GCC Administrator fc82978278 Daily bump. 2022-01-18 00:16:54 +00:00
Francois-Xavier Coudert d573a303be Fortran: remove new files introduced by mistake
These two files were introduced by mistake in
86e3b476d5

gcc/testsuite/ChangeLog:

	* gfortran.dg/ieee/signaling_3.f90: Remove file.

libgfortran/ChangeLog:

	* ieee/issignaling_fallback.h: Remove file.
2022-01-17 12:15:27 +01:00
Thomas Koenig 025a707d28 Allow for multiple defaults in endianness and r16 in GFORTRAN_CONVERT_UNIT.
With this patch, it is possible to specify multiple defaults inthe
GFORTRAN_CONVERT_UNIT environment variable so that, for example, R16_IEEE
and BIG_ENDIAN can be specified together.

libgfortran/ChangeLog:

	* runtime/environ.c: Allow for multiple default values so that
	separate default specifications for IBM long double format and
	endianness are possible.
2022-01-17 07:29:35 +01:00
GCC Administrator 1e942d7c05 Daily bump. 2022-01-17 00:16:24 +00:00
Francois-Xavier Coudert 86e3b476d5 Fortran: xfail signaling NaN testcases on x87
The ABI for x87 and x86-32 is not suitable for passing around
signaling NaNs in the way IEEE expects. See for example discussion
in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484

gcc/testsuite/ChangeLog:

	* gfortran.dg/ieee/signaling_1.f90: xfail on x87.
	* gfortran.dg/ieee/signaling_2.f90: xfail on x87.
2022-01-17 00:02:51 +01:00
Francois-Xavier Coudert 90045c5df5 Fortran: allow IEEE_VALUE to correctly return signaling NaNs
I moved the library implementation of IEEE_VALUE in libgfortran from
Fortran to C code, which gives us access to GCC's built-ins for NaN generation
(both quiet and signalling). It will be perform better than the current
Fortran implementation.

libgfortran/ChangeLog:

	PR fortran/82207
	* mk-kinds-h.sh: Add values for TINY.
	* ieee/ieee_arithmetic.F90: Call C helper functions for
	IEEE_VALUE.
	* ieee/ieee_helper.c: New functions ieee_value_helper_N for each
	floating-point type.

gcc/testsuite/ChangeLog:

	PR fortran/82207
	* gfortran.dg/ieee/ieee_10.f90: Do not create signaling NaNs.
	* gfortran.dg/ieee/signaling_2.f90: New test.
	* gfortran.dg/ieee/signaling_2_c.c: New file.
2022-01-16 22:57:45 +01:00
GCC Administrator 617db51d7e Daily bump. 2022-01-15 00:16:27 +00:00
Jakub Jelinek ac6a118120 libgfortran: Partly revert my r12-6498 change to fix Solaris build [PR104006]
In r12-6498 I've added $(version_dep) to BUILT_SOURCES, previously version_dep
on Linux used to be a file in $(srcdir), but with my changes it is a generated
file in the object directory (preprocessed version of the $(srcdir) file)
and I thought generated files belong to BUILT_SOURCES so that they are
cleaned up etc.
For Linux that is fine, but it broke parallel builds on Solaris.
BUILT_SOURCES is a special variable for automake where automake ensures
that for make all, make check and make install all those $(BUILT_SOURCES)
are generated before actually starting building in parallel the various
object files.  That way we can avoid hacks like:
$(patsubst %.F90,%.lo,$(notdir $(filter %.F90,$(prereq_SRC)))): kinds.inc c99_protos.inc
$(patsubst %.c,%.lo,$(notdir $(filter %.c,$(prereq_SRC)))): kinds.h
$(patsubst %.f90,%.lo,selected_real_kind.f90): selected_real_kind.inc
$(patsubst %.f90,%.lo,selected_int_kind.f90): selected_int_kind.inc
$(patsubst %.F90,%.lo,ieee_exceptions.F90): fpu-target.inc
$(patsubst %.F90,%.lo,ieee_arithmetic.F90): fpu-target.inc ieee_exceptions.lo
$(patsubst %.c,%.lo,fpu.c): fpu-target.h
which makes those dependencies explicit but hides it from automake, so that it
doesn't throw away its rules for those object files.
On Solaris, $(version_dep) contains gfortran.ver and gfortran.ver-sun.
gfortran.ver is like on Linux, it can be in $(BUILT_SOURCES), but unfortunately
gfortran.ver-sun depends on all the object files being compiled already,
so if gfortran.ver-sun appears in $(BUILT_SOURCES), the BUILT_SOURCES function
of ensuring the generated files are generated before building object files
is gone, almost everything is built before all-am is entered and there
are no explicit dependencies that e.g. *.F90 files depend on
kinds.inc etc.

So, this change reverts that mistake and instead adds $(version_dep) to
what is removed during make clean (clean-local in particular).

2022-01-14  Jakub Jelinek  <jakub@redhat.com>

	PR libfortran/104006
	* Makefile.am (BUILT_SOURCES): Don't include $(version_dep).
	(clean-local): Remove $(version_dep).
	* Makefile.in: Regenerated.
2022-01-14 12:11:00 +01:00
GCC Administrator ad3f0d0806 Daily bump. 2022-01-14 00:16:30 +00:00
Jakub Jelinek 70ba28304b libgfortran: Fix Solaris version file creation [PR104006]
I forgot to change the gfortran.map-sun goal to gfortran.ver-sun
when changing other spots for the preprocessed version file.

2022-01-13  Jakub Jelinek  <jakub@redhat.com>

	PR libfortran/104006
	* Makefile.am (gfortran.map-sun): Rename target to ...
	(gfortran.ver-sun): ... this.
	* Makefile.in: Regenerated.
2022-01-13 17:50:28 +01:00
GCC Administrator 02a8a01bf3 Daily bump. 2022-01-13 00:16:21 +00:00
Jakub Jelinek 7c3b9c1736 libgfortran: Fix build on non-glibc targets
When the __GLIBC_PREREQ macro isn't defined, the
  #if ... && defined __GLIBC_PREREQ && __GLIBC_PREREQ (2, 32)
directive has invalid syntax - the __GLIBC_PREREQ in there evaluates
to 0 and is followed by (2, 32).

2022-01-12  Jakub Jelinek  <jakub@redhat.com>

	* libgfortran.h (POWER_IEEE128): Use __GLIBC_PREREQ in a separate
	#if directive inside of #if ... && defined __GLIBC_PREREQ.
2022-01-12 09:43:18 +01:00
GCC Administrator 01a254e3e5 Daily bump. 2022-01-12 00:16:39 +00:00
Jakub Jelinek a01be2f309 power-ieee128: Fix up byte-swapping for IBM extended real(kind=16)
Here is a patch to fix up the ppc64be vs. ppc64le byteswapping
of IBM extended real(kind=16) and complex(kind=16).
Similarly to the BT_COMPLEX case it halves size and doubles nelems
for the bswap_array calls.  Of course for r16_ibm and r16_ieee conversions
one needs to make sure it is only done when the on file data is in that
format and not in IEEE quad.

2022-01-11  Jakub Jelinek  <jakub@redhat.com>

	* io/transfer.c (unformatted_read, unformatted_write): When
	byteswapping IBM extended real(kind=16), handle it as byteswapping
	two real(kind=8) values.
2022-01-11 23:49:53 +01:00
Thomas Koenig a574503ff9 Handle R16 conversion for POWER in the environment variables.
This patch handles the environment variables for the REAL(KIND=16)
variables like for the little/big-endian routines, so users without
who have no access to the source or are unwilling to recompile
can use this.

Syntax is, for example

GFORTRAN_CONVERT_UNIT="r16_ieee:10;little_endian:10" ./a.out

libgfortran/ChangeLog:

	* runtime/environ.c (R16_IEEE): New macro.
	(R16_IBM): New macro.
	(next_token): Handle IBM R16 conversion cases.
	(push_token): Likewise.
	(mark_single): Likewise.
	(do_parse): Likewise, initialize endian.
2022-01-11 23:49:53 +01:00
Thomas Koenig 9840285d87 Implement CONVERT specifier for OPEN.
This patch, based on Jakub's work, implements the CONVERT
specifier for the power-ieee128 brach.  It allows specifying
the conversion as r16_ieee,big_endian and the other way around,
based on a table.  Setting the conversion via environment
variable and via program option does not yet work.

gcc/ChangeLog:

	* flag-types.h (enum gfc_convert): Add flags for
	conversion.

gcc/fortran/ChangeLog:

	* libgfortran.h (unit_convert): Add flags.

libgfortran/ChangeLog:

	* Makefile.in: Regenerate.
	* io/file_pos.c (unformatted_backspace): Mask off
	R16 parts for convert.
	* io/inquire.c (inquire_via_unit): Add cases for
	R16 parts.
	* io/open.c (st_open): Add cases for R16 conversion.
	* io/transfer.c (unformatted_read): Adjust for R16 conversions.
	(unformatted_write): Likewise.
	(us_read): Mask of R16 bits.
	(data_transfer_init): Likewiese.
	(write_us_marker): Likewise.
2022-01-11 23:49:52 +01:00
Jakub Jelinek e79f6e61d5 libgfortran: Make sure glibc < 2.32 built powerpc64le-linux libgfortran doesn't use __*ieee128 APIs
I've just tried to build libgfortran on an old glibc system
(gcc112.fsffrance.org) and unfortunately we still have work to do:

[jakub@gcc2-power8 obj38]$ LD_PRELOAD=/home/jakub/gcc/obj38/powerpc64le-unknown-linux-gnu/libgfortran/.libs/libgfortran.so.5.0.0 /bin/true
[jakub@gcc2-power8 obj38]$ LD_BIND_NOW=1 LD_PRELOAD=/home/jakub/gcc/obj38/powerpc64le-unknown-linux-gnu/libgfortran/.libs/libgfortran.so.5.0.0 /bin/true
/bin/true: symbol lookup error: /home/jakub/gcc/obj38/powerpc64le-unknown-linux-gnu/libgfortran/.libs/libgfortran.so.5.0.0: undefined symbol: __atan2ieee128

While we do use some libquadmath APIs:
readelf -Wr /home/jakub/gcc/obj38/powerpc64le-unknown-linux-gnu/libgfortran/.libs/libgfortran.so.5.0.0 | grep QUADMATH
0000000000251268  000005e400000026 R_PPC64_ADDR64         0000000000000000 quadmath_snprintf@QUADMATH_1.0 + 0
0000000000251270  0000030600000026 R_PPC64_ADDR64         0000000000000000 strtoflt128@QUADMATH_1.0 + 0
00000000002502e0  0000011600000015 R_PPC64_JMP_SLOT       0000000000000000 ynq@QUADMATH_1.0 + 0
0000000000250390  0000016000000015 R_PPC64_JMP_SLOT       0000000000000000 sqrtq@QUADMATH_1.0 + 0
0000000000250508  000001fa00000015 R_PPC64_JMP_SLOT       0000000000000000 fmaq@QUADMATH_1.0 + 0
0000000000250530  0000021200000015 R_PPC64_JMP_SLOT       0000000000000000 fabsq@QUADMATH_1.0 + 0
0000000000250760  0000030600000015 R_PPC64_JMP_SLOT       0000000000000000 strtoflt128@QUADMATH_1.0 + 0
0000000000250990  000003df00000015 R_PPC64_JMP_SLOT       0000000000000000 cosq@QUADMATH_1.0 + 0
00000000002509f0  0000040a00000015 R_PPC64_JMP_SLOT       0000000000000000 expq@QUADMATH_1.0 + 0
0000000000250a88  0000045100000015 R_PPC64_JMP_SLOT       0000000000000000 erfcq@QUADMATH_1.0 + 0
0000000000250a98  0000045e00000015 R_PPC64_JMP_SLOT       0000000000000000 jnq@QUADMATH_1.0 + 0
0000000000250ac8  0000047e00000015 R_PPC64_JMP_SLOT       0000000000000000 sinq@QUADMATH_1.0 + 0
0000000000250e38  000005db00000015 R_PPC64_JMP_SLOT       0000000000000000 fmodq@QUADMATH_1.0 + 0
0000000000250e48  000005e000000015 R_PPC64_JMP_SLOT       0000000000000000 tanq@QUADMATH_1.0 + 0
0000000000250e58  000005e400000015 R_PPC64_JMP_SLOT       0000000000000000 quadmath_snprintf@QUADMATH_1.0 + 0
0000000000250f20  0000062900000015 R_PPC64_JMP_SLOT       0000000000000000 copysignq@QUADMATH_1.0 + 0
we don't do it consistently:
readelf -Wr /home/jakub/gcc/obj38/powerpc64le-unknown-linux-gnu/libgfortran/.libs/libgfortran.so.5.0.0 | grep ieee128
0000000000250310  0000012800000015 R_PPC64_JMP_SLOT       0000000000000000 __atan2ieee128 + 0
0000000000250340  0000014200000015 R_PPC64_JMP_SLOT       0000000000000000 __clogieee128 + 0
0000000000250438  000001a300000015 R_PPC64_JMP_SLOT       0000000000000000 __acoshieee128 + 0
00000000002504b8  000001cc00000015 R_PPC64_JMP_SLOT       0000000000000000 __csinieee128 + 0
0000000000250500  000001f300000015 R_PPC64_JMP_SLOT       0000000000000000 __sinhieee128 + 0
0000000000250570  0000022a00000015 R_PPC64_JMP_SLOT       0000000000000000 __asinieee128 + 0
0000000000250580  0000022d00000015 R_PPC64_JMP_SLOT       0000000000000000 __roundieee128 + 0
00000000002505a0  0000023e00000015 R_PPC64_JMP_SLOT       0000000000000000 __logieee128 + 0
00000000002505c8  0000024900000015 R_PPC64_JMP_SLOT       0000000000000000 __tanieee128 + 0
0000000000250630  0000027500000015 R_PPC64_JMP_SLOT       0000000000000000 __ccosieee128 + 0
0000000000250670  0000028a00000015 R_PPC64_JMP_SLOT       0000000000000000 __log10ieee128 + 0
00000000002506c8  000002bd00000015 R_PPC64_JMP_SLOT       0000000000000000 __cexpieee128 + 0
00000000002506d8  000002c800000015 R_PPC64_JMP_SLOT       0000000000000000 __coshieee128 + 0
00000000002509b0  000003ef00000015 R_PPC64_JMP_SLOT       0000000000000000 __truncieee128 + 0
0000000000250af8  000004a600000015 R_PPC64_JMP_SLOT       0000000000000000 __expieee128 + 0
0000000000250b50  000004c600000015 R_PPC64_JMP_SLOT       0000000000000000 __fmodieee128 + 0
0000000000250bb0  000004e700000015 R_PPC64_JMP_SLOT       0000000000000000 __tanhieee128 + 0
0000000000250c38  0000051300000015 R_PPC64_JMP_SLOT       0000000000000000 __acosieee128 + 0
0000000000250ce0  0000055400000015 R_PPC64_JMP_SLOT       0000000000000000 __sinieee128 + 0
0000000000250d60  0000057e00000015 R_PPC64_JMP_SLOT       0000000000000000 __atanieee128 + 0
0000000000250dd8  000005b100000015 R_PPC64_JMP_SLOT       0000000000000000 __sqrtieee128 + 0
0000000000250e98  0000060200000015 R_PPC64_JMP_SLOT       0000000000000000 __cosieee128 + 0
0000000000250eb0  0000060a00000015 R_PPC64_JMP_SLOT       0000000000000000 __atanhieee128 + 0
0000000000250ef0  0000062000000015 R_PPC64_JMP_SLOT       0000000000000000 __asinhieee128 + 0
0000000000250fd8  0000067f00000015 R_PPC64_JMP_SLOT       0000000000000000 __csqrtieee128 + 0
0000000000251038  000006ad00000015 R_PPC64_JMP_SLOT       0000000000000000 __cabsieee128 + 0
All these should for POWER_IEEE128 use atan2q@QUADMATH_1.0 etc.

It seems all these come from f951 compiled sources.
For user code, I think the agreement was if you want to use successfully
-mabi=ieeelongdouble, you need glibc 2.32 or later, which is why the Fortran
FE doesn't conditionalize on whether glibc 2.32 is available or not and just
emits __WHATEVERieee128 entrypoints.
But for Fortran compiled sources in libgfortran, we need to use
__WHATEVERieee128 only if glibc 2.32 or later and WHATEVERq (from
libquadmath) otherwise.

The following patch implements that, adds -fbuilding-libgfortran option
similar to e.g. -fbuilding-libgcc used when building libgcc and if
that option is set and the TARGET_GLIBC_{MAJOR,MINOR} macros indicate
no glibc or glibc older than 2.32, it will use the libquadmath APIs
rather than glibc 2.32 APIs.

2022-01-07  Jakub Jelinek  <jakub@redhat.com>

gcc/fortran/
	* trans-types.c (gfc_init_kinds): When setting abi_kind to 17, if not
	targetting glibc 2.32 or later and -fbuilding-libgfortran, set
	gfc_real16_is_float128 and c_float128 in gfc_real_kinds.
	(gfc_build_real_type): Don't set c_long_double if c_float128 is
	already set.
	* trans-intrinsic.c (builtin_decl_for_precision): Don't use
	long_double_built_in if gfc_real16_is_float128 and
	long_double_type_node == gfc_float128_type_node.
	* lang.opt (fbuilding-libgfortran): New undocumented option.
libgfortran/
	* Makefile.am (AM_FCFLAGS): Add -fbuilding-libgfortran after
	-fallow-leading-underscore.
	* Makefile.in: Regenerated.
2022-01-11 23:49:52 +01:00
Jakub Jelinek 4d0e778fe3 libgfortran: Avoid using libquadmath APIs on powerpc64le on glibc 2.32+
On a glibc 2.32+ build, we still use some libquadmath APIs
when we shouldn't:
readelf -Wr /home/jakub/gcc/obj/powerpc64le-unknown-linux-gnu/libgfortran/.libs/libgfortran.so.5 | grep QUADMATH
00000000002502c8  0000002600000015 R_PPC64_JMP_SLOT       0000000000000000 fmaq@QUADMATH_1.0 + 0
00000000002505f8  0000006700000015 R_PPC64_JMP_SLOT       0000000000000000 tanq@QUADMATH_1.0 + 0
0000000000250930  0000009b00000015 R_PPC64_JMP_SLOT       0000000000000000 fabsq@QUADMATH_1.0 + 0
0000000000250940  0000009d00000015 R_PPC64_JMP_SLOT       0000000000000000 sinq@QUADMATH_1.0 + 0
0000000000250c98  000000cf00000015 R_PPC64_JMP_SLOT       0000000000000000 copysignq@QUADMATH_1.0 + 0
0000000000251038  0000010700000015 R_PPC64_JMP_SLOT       0000000000000000 cosq@QUADMATH_1.0 + 0
0000000000251068  0000010a00000015 R_PPC64_JMP_SLOT       0000000000000000 fmodq@QUADMATH_1.0 + 0
These should use __fmaieee128, __tanieee128 etc. instead.

2022-01-07  Jakub Jelinek  <jakub@redhat.com>

	* libgfortran.h (__copysignieee128, __fmaieee128, __fmodieee128):
	Declare.
	* intrinsics/trigd.c (COPYSIGN, FMOD, FABS, FMA, SIN, COS, TAN): If
	POWER_IEEE128 is defined, define these for kind 17 include.
	* intrinsics/trigd_lib.inc (COPYSIGN, FMOD, FABS, FMA, SIN, COS, TAN):
	Don't define if COPYSIGN is already defined.
2022-01-11 23:49:52 +01:00
Jakub Jelinek 5db042b2b8 fortran, libgfortran: Add remaining missing *_r17 symbols
Following patch adds remaining missing *_r17 entrypoints, so that
we have 91 *_r16 and 91 *_r17 entrypoints (and 24 *_c16 and 24 *_c17).

This fixes:
FAIL: gfortran.dg/dec_math.f90   -O0  execution test
FAIL: gfortran.dg/dec_math.f90   -O1  execution test
FAIL: gfortran.dg/dec_math.f90   -O2  execution test
FAIL: gfortran.dg/dec_math.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/dec_math.f90   -O3 -g  execution test
FAIL: gfortran.dg/dec_math.f90   -Os  execution test
FAIL: gfortran.dg/ieee/dec_math_1.f90   -O0  execution test
FAIL: gfortran.dg/ieee/dec_math_1.f90   -O1  execution test
FAIL: gfortran.dg/ieee/dec_math_1.f90   -O2  execution test
FAIL: gfortran.dg/ieee/dec_math_1.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/ieee/dec_math_1.f90   -O3 -g  execution test
FAIL: gfortran.dg/ieee/dec_math_1.f90   -Os  execution test

2022-01-04  Jakub Jelinek  <jakub@redhat.com>

gcc/fortran/
	* trans-intrinsic.c (gfc_get_intrinsic_lib_fndecl): Use
	gfc_type_abi_kind.
libgfortran/
	* libgfortran.h (GFC_REAL_17_INFINITY, GFC_REAL_17_QUIET_NAN): Define.
	(__erfcieee128): Declare.
	* intrinsics/trigd.c (_gfortran_sind_r17, _gfortran_cosd_r17,
	_gfortran_tand_r17): Define for HAVE_GFC_REAL_17.
	* intrinsics/random.c (random_r17, arandom_r17, rnumber_17): Define.
	* intrinsics/erfc_scaled.c (ERFC_SCALED): Define.
	(erfc_scaled_r16): Use ERFC_SCALED macro.
	(erfc_scaled_r17): Define.
2022-01-11 23:49:50 +01:00
Jakub Jelinek 06a74228ce fortran, libgfortran: Assorted -mabi=ieeelongdouble I/O fixes
Another patch, this fixes:
FAIL: gfortran.dg/intrinsic_spread_2.f90   -O0  execution test
FAIL: gfortran.dg/intrinsic_spread_2.f90   -O1  execution test
FAIL: gfortran.dg/intrinsic_spread_2.f90   -O2  execution test
FAIL: gfortran.dg/intrinsic_spread_2.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/intrinsic_spread_2.f90   -O3 -g  execution test
FAIL: gfortran.dg/intrinsic_spread_2.f90   -Os  execution test
FAIL: gfortran.dg/intrinsic_unpack_2.f90   -O0  execution test
FAIL: gfortran.dg/intrinsic_unpack_2.f90   -O1  execution test
FAIL: gfortran.dg/intrinsic_unpack_2.f90   -O2  execution test
FAIL: gfortran.dg/intrinsic_unpack_2.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/intrinsic_unpack_2.f90   -O3 -g  execution test
FAIL: gfortran.dg/intrinsic_unpack_2.f90   -Os  execution test
FAIL: gfortran.dg/large_real_kind_form_io_1.f90   -O0  execution test
FAIL: gfortran.dg/large_real_kind_form_io_1.f90   -O1  execution test
FAIL: gfortran.dg/large_real_kind_form_io_1.f90   -O2  execution test
FAIL: gfortran.dg/large_real_kind_form_io_1.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/large_real_kind_form_io_1.f90   -O3 -g  execution test
FAIL: gfortran.dg/large_real_kind_form_io_1.f90   -Os  execution test
FAIL: gfortran.dg/quad_2.f90   -O0  execution test
FAIL: gfortran.dg/quad_2.f90   -O1  execution test
FAIL: gfortran.dg/quad_2.f90   -O2  execution test
FAIL: gfortran.dg/quad_2.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/quad_2.f90   -O3 -g  execution test
FAIL: gfortran.dg/quad_2.f90   -Os  execution test

2022-01-04  Jakub Jelinek  <jakub@redhat.com>

gcc/fortran/
	* trans-io.c (transfer_array_desc): Pass abi kind instead of kind
	to libgfortran.
libgfortran/
	* io/read.c (convert_real): Add missing break; for the
	HAVE_GFC_REAL_17 case.
2022-01-11 23:49:49 +01:00
Jakub Jelinek 6d70817236 libgfortran: -mabi=ieeelongdouble I/O fix
The following patch fixes:
FAIL: gfortran.dg/fmt_en.f90   -O0  output pattern test
FAIL: gfortran.dg/fmt_en.f90   -O1  output pattern test
FAIL: gfortran.dg/fmt_en.f90   -O2  output pattern test
FAIL: gfortran.dg/fmt_en.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  output pattern test
FAIL: gfortran.dg/fmt_en.f90   -O3 -g  output pattern test
FAIL: gfortran.dg/fmt_en.f90   -Os  output pattern test
FAIL: gfortran.dg/fmt_en_rd.f90   -O0  output pattern test
FAIL: gfortran.dg/fmt_en_rd.f90   -O1  output pattern test
FAIL: gfortran.dg/fmt_en_rd.f90   -O2  output pattern test
FAIL: gfortran.dg/fmt_en_rd.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  output pattern test
FAIL: gfortran.dg/fmt_en_rd.f90   -O3 -g  output pattern test
FAIL: gfortran.dg/fmt_en_rd.f90   -Os  output pattern test
FAIL: gfortran.dg/fmt_en_rn.f90   -O0  output pattern test
FAIL: gfortran.dg/fmt_en_rn.f90   -O1  output pattern test
FAIL: gfortran.dg/fmt_en_rn.f90   -O2  output pattern test
FAIL: gfortran.dg/fmt_en_rn.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  output pattern test
FAIL: gfortran.dg/fmt_en_rn.f90   -O3 -g  output pattern test
FAIL: gfortran.dg/fmt_en_rn.f90   -Os  output pattern test
FAIL: gfortran.dg/fmt_en_ru.f90   -O0  output pattern test
FAIL: gfortran.dg/fmt_en_ru.f90   -O1  output pattern test
FAIL: gfortran.dg/fmt_en_ru.f90   -O2  output pattern test
FAIL: gfortran.dg/fmt_en_ru.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  output pattern test
FAIL: gfortran.dg/fmt_en_ru.f90   -O3 -g  output pattern test
FAIL: gfortran.dg/fmt_en_ru.f90   -Os  output pattern test
FAIL: gfortran.dg/fmt_en_rz.f90   -O0  output pattern test
FAIL: gfortran.dg/fmt_en_rz.f90   -O1  output pattern test
FAIL: gfortran.dg/fmt_en_rz.f90   -O2  output pattern test
FAIL: gfortran.dg/fmt_en_rz.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  output pattern test
FAIL: gfortran.dg/fmt_en_rz.f90   -O3 -g  output pattern test
FAIL: gfortran.dg/fmt_en_rz.f90   -Os  output pattern test
FAIL: gfortran.dg/fmt_g0_7.f08   -O0  execution test
FAIL: gfortran.dg/fmt_g0_7.f08   -O1  execution test
FAIL: gfortran.dg/fmt_g0_7.f08   -O2  execution test
FAIL: gfortran.dg/fmt_g0_7.f08   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/fmt_g0_7.f08   -O3 -g  execution test
FAIL: gfortran.dg/fmt_g0_7.f08   -Os  execution test
FAIL: gfortran.dg/fmt_pf.f90   -O0  output pattern test
FAIL: gfortran.dg/fmt_pf.f90   -O1  output pattern test
FAIL: gfortran.dg/fmt_pf.f90   -O2  output pattern test
FAIL: gfortran.dg/fmt_pf.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  output pattern test
FAIL: gfortran.dg/fmt_pf.f90   -O3 -g  output pattern test
FAIL: gfortran.dg/fmt_pf.f90   -Os  output pattern test
FAIL: gfortran.dg/large_real_kind_1.f90   -O0  execution test
FAIL: gfortran.dg/large_real_kind_1.f90   -O1  execution test
FAIL: gfortran.dg/large_real_kind_1.f90   -O2  execution test
FAIL: gfortran.dg/large_real_kind_1.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/large_real_kind_1.f90   -O3 -g  execution test
FAIL: gfortran.dg/large_real_kind_1.f90   -Os  execution test

2022-01-04  Jakub Jelinek  <jakub@redhat.com>

	* io/write_float.def (CALCULATE_EXP): If HAVE_GFC_REAL_17, also use
	CALCULATE_EXP(17).
	(determine_en_precision): Use 17 instead of 16 as first EN_PREC
	argument for kind 17.
	(get_float_string): Use 17 instead of 16 as first FORMAT_FLOAT
	argument for kind 17.
2022-01-11 23:49:49 +01:00
Jakub Jelinek 07c60b8e33 fortran, libgfortran: -mabi=ieeelongdouble I/O
The following patch adds the compiler and library side of -mabi=ieeelongdouble
I/O support.

2022-01-04  Jakub Jelinek  <jakub@redhat.com>

gcc/fortran/
	* trans-io.c (transfer_namelist_element): Use gfc_type_abi_kind,
	formatting fixes.
	(transfer_expr): Use gfc_type_abi_kind, use *REAL128* APIs even
	for abi_kind == 17.
libgfortran/
	* libgfortran.h (__acoshieee128, __acosieee128, __asinhieee128,
	__asinieee128, __atan2ieee128, __atanhieee128, __atanieee128,
	__coshieee128, __cosieee128, __erfieee128, __expieee128,
	__fabsieee128, __jnieee128, __log10ieee128, __logieee128,
	__powieee128, __sinhieee128, __sinieee128, __sqrtieee128,
	__tanhieee128, __tanieee128, __ynieee128): Formatting fixes.
	(__strtoieee128, __snprintfieee128): Declare.
	* io/io.h (default_width_for_float, default_precision_for_float):
	Handle kind == 17.
	* io/size_from_kind.c (size_from_real_kind, size_from_complex_kind):
	Likewise.
	* io/read.c (set_integer, si_max, convert_real, convert_infnan,
	read_f): Likewise.
	* io/write.c (extract_uint, size_from_kind, set_fnode_default):
	Likewise.
	* io/write_float.def (DTOA2Q, FDTOA2Q): Define for HAVE_GFC_REAL_17.
	(determine_en_precision, get_float_string): Handle kind == 17.
	* io/transfer128.c: Use also for HAVE_GFC_REAL_17, but don't drag in
	libquadmath if POWER_IEEE128.
	* Makefile.am (comma, PREPROCESS): New variables.
	(gfortran.ver): New goal.
	(version_arg, version_dep): Use gfortran.ver instead of
	$(srcdir)/gfortran.map.
	(gfortran.map-sun): Depend on and use gfortran.ver instead of
	$(srcdir)/gfortran.map.
	(BUILT_SOURCES): Add $(version_dep).
	* Makefile.in: Regenerated.
	* gfortran.map (GFORTRAN_8): Don't export
	_gfortran_transfer_complex128, _gfortran_transfer_complex128_write,
	_gfortran_transfer_real128 and _gfortran_transfer_real128_write if
	HAVE_GFC_REAL_17 is defined.
	(GFORTRAN_12): Export those here instead.
2022-01-11 23:49:48 +01:00
Thomas Koenig a8fea8cd86 Make sure the Fortran specifics have real(kind=16).
This brings the library to compile with all specific functions.
It also corrects the patsubst patterns so the right files
get the flags.

It was necessary to manually add -D__powerpc64__ because apparently
this is not set for Fortran.

libgfortran/ChangeLog:

	* Makefile.am: Correct files for compilation flags. Add
	-D__powerpc64__ for Fortran sources.  Get kinds.inc from
	grep of kinds.h and kinds-override.h.
	* Makefile.in: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Add -mno-gnu-attribute to compile flags.
	* generated/_abs_c17.F90: Regenerate.
	* generated/_abs_r17.F90: Regenerate.
	* generated/_acos_r17.F90: Regenerate.
	* generated/_acosh_r17.F90: Regenerate.
	* generated/_aimag_c17.F90: Regenerate.
	* generated/_aint_r17.F90: Regenerate.
	* generated/_anint_r17.F90: Regenerate.
	* generated/_asin_r17.F90: Regenerate.
	* generated/_asinh_r17.F90: Regenerate.
	* generated/_atan2_r17.F90: Regenerate.
	* generated/_atan_r17.F90: Regenerate.
	* generated/_atanh_r17.F90: Regenerate.
	* generated/_conjg_c17.F90: Regenerate.
	* generated/_cos_c17.F90: Regenerate.
	* generated/_cos_r17.F90: Regenerate.
	* generated/_cosh_r17.F90: Regenerate.
	* generated/_dim_r17.F90: Regenerate.
	* generated/_exp_c17.F90: Regenerate.
	* generated/_exp_r17.F90: Regenerate.
	* generated/_log10_r17.F90: Regenerate.
	* generated/_log_c17.F90: Regenerate.
	* generated/_log_r17.F90: Regenerate.
	* generated/_mod_r17.F90: Regenerate.
	* generated/_sign_r17.F90: Regenerate.
	* generated/_sin_c17.F90: Regenerate.
	* generated/_sin_r17.F90: Regenerate.
	* generated/_sinh_r17.F90: Regenerate.
	* generated/_sqrt_c17.F90: Regenerate.
	* generated/_sqrt_r17.F90: Regenerate.
	* generated/_tan_r17.F90: Regenerate.
	* generated/_tanh_r17.F90: Regenerate.
	* kinds-override.h: Adjust to trunk.
	Change condition to single line so it can be grepped.
	* m4/specific.m4: Make sure that real=kind16 is used
	for _r17.F90 and _c17.F90 files.
	* m4/specific2.m4: Likewise.
2022-01-11 23:49:31 +01:00
Jakub Jelinek 23d11a0adc libgfortran: Small progress on the library side
The following patch quiets
../../../libgfortran/generated/in_pack_r17.c:35:1: warning: no previous prototype for ‘internal_pack_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/in_pack_c17.c:35:1: warning: no previous prototype for ‘internal_pack_c17’ [-Wmissing-prototypes]
../../../libgfortran/generated/in_unpack_r17.c:33:1: warning: no previous prototype for ‘internal_unpack_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/in_unpack_c17.c:33:1: warning: no previous prototype for ‘internal_unpack_c17’ [-Wmissing-prototypes]
../../../libgfortran/generated/pack_r17.c:73:1: warning: no previous prototype for ‘pack_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/pack_c17.c:73:1: warning: no previous prototype for ‘pack_c17’ [-Wmissing-prototypes]
../../../libgfortran/generated/unpack_r17.c:34:1: warning: no previous prototype for ‘unpack0_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/unpack_r17.c:178:1: warning: no previous prototype for ‘unpack1_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/unpack_c17.c:34:1: warning: no previous prototype for ‘unpack0_c17’ [-Wmissing-prototypes]
../../../libgfortran/generated/unpack_c17.c:178:1: warning: no previous prototype for ‘unpack1_c17’ [-Wmissing-prototypes]
../../../libgfortran/generated/spread_r17.c:34:1: warning: no previous prototype for ‘spread_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/spread_r17.c:230:1: warning: no previous prototype for ‘spread_scalar_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/spread_c17.c:34:1: warning: no previous prototype for ‘spread_c17’ [-Wmissing-prototypes]
../../../libgfortran/generated/spread_c17.c:230:1: warning: no previous prototype for ‘spread_scalar_c17’ [-Wmissing-prototypes]
../../../libgfortran/generated/cshift0_r17.c:33:1: warning: no previous prototype for ‘cshift0_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/cshift0_c17.c:33:1: warning: no previous prototype for ‘cshift0_c17’ [-Wmissing-prototypes]
../../../libgfortran/generated/cshift1_4_r17.c:32:1: warning: no previous prototype for ‘cshift1_4_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/cshift1_4_c17.c:32:1: warning: no previous prototype for ‘cshift1_4_c17’ [-Wmissing-prototypes]
../../../libgfortran/generated/cshift1_8_r17.c:32:1: warning: no previous prototype for ‘cshift1_8_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/cshift1_8_c17.c:32:1: warning: no previous prototype for ‘cshift1_8_c17’ [-Wmissing-prototypes]
../../../libgfortran/generated/cshift1_16_r17.c:32:1: warning: no previous prototype for ‘cshift1_16_r17’ [-Wmissing-prototypes]
../../../libgfortran/generated/cshift1_16_c17.c:32:1: warning: no previous prototype for ‘cshift1_16_c17’ [-Wmissing-prototypes]
warnings during libgfortran build and exports the new entrypoints.
Note, not all of them, clearly e.g. there are fewer *_r17* entrypoints than
*_r16* entrypoints, so more work is needed.

2021-12-31  Jakub Jelinek  <jakub@redhat.com>

	* libgfortran.h (internal_pack_r17, internal_pack_c17,
	internal_unpack_r17, internal_unpack_c17, pack_r17, pack_c17,
	unpack0_r17, unpack0_c17, unpack1_r17, unpack1_c17, spread_r17,
	spread_c17, spread_scalar_r17, spread_scalar_c17, cshift0_r17,
	cshift0_c17, cshift1_4_r17, cshift1_8_r17, cshift1_16_r17,
	cshift1_4_c17, cshift1_8_c17, cshift1_16_c17): Declare.
	* gfortran.map (GFORTRAN_12): Export *_r17 and *_c17.
2022-01-11 23:41:02 +01:00
Thomas Koenig 6f4977fc8e Generate config.h macros for IEEE128 math functions.
libgfortran/ChangeLog:

	* acinclude.m4 (LIBGFOR_CHECK_MATH_IEEE128): New macro.
	* configure.ac: Use it.
	* config.h.in: Regenerate.
	* configure: Regenerate.
2022-01-11 23:40:34 +01:00
Thomas Koenig 8e1339272f Fix pattern substition for _r17 and _c17.
libgfortran/ChangeLog:

	* Makefile.am: Fix pattern substitution for _r17 and _c17.
	* Makefile.in: Regenerate.
2022-01-11 23:40:09 +01:00
Thomas Koenig 49ad4d2c30 Prepare library for REAL(KIND=17).
This prepares the library side for REAL(KIND=17).  It is
not yet tested, but at least compiles cleanly on POWER 9
and x86_64.

2021-10-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* Makefile.am: Add _r17 and _c17 files.  Build them
	with -mabi=ieeelongdouble on POWER.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: New flag HAVE_REAL_17.
	* kinds-override.h: (HAVE_GFC_REAL_17): New macro.
	(HAVE_GFC_COMPLEX_17): New macro.
	(GFC_REAL_17_HUGE): New macro.
	(GFC_REAL_17_LITERAL_SUFFIX): New macro.
	(GFC_REAL_17_LITERAL): New macro.
	(GFC_REAL_17_DIGITS): New macro.
	(GFC_REAL_17_RADIX): New macro.
	* libgfortran.h	(POWER_IEEE128): New macro.
	(gfc_array_r17): Typedef.
	(GFC_DTYPE_REAL_17): New macro.
	(GFC_DTYPE_COMPLEX_17): New macro.
	(__acoshieee128): Prototype.
	(__acosieee128): Prototype.
	(__asinhieee128): Prototype.
	(__asinieee128): Prototype.
	(__atan2ieee128): Prototype.
	(__atanhieee128): Prototype.
	(__atanieee128): Prototype.
	(__coshieee128): Prototype.
	(__cosieee128): Prototype.
	(__erfieee128): Prototype.
	(__expieee128): Prototype.
	(__fabsieee128): Prototype.
	(__jnieee128): Prototype.
	(__log10ieee128): Prototype.
	(__logieee128): Prototype.
	(__powieee128): Prototype.
	(__sinhieee128): Prototype.
	(__sinieee128): Prototype.
	(__sqrtieee128): Prototype.
	(__tanhieee128): Prototype.
	(__tanieee128): Prototype.
	(__ynieee128): Prototype.
	* m4/mtype.m4: Make a bit more readable. Add KIND=17.
	* generated/_abs_c17.F90: New file.
	* generated/_abs_r17.F90: New file.
	* generated/_acos_r17.F90: New file.
	* generated/_acosh_r17.F90: New file.
	* generated/_aimag_c17.F90: New file.
	* generated/_aint_r17.F90: New file.
	* generated/_anint_r17.F90: New file.
	* generated/_asin_r17.F90: New file.
	* generated/_asinh_r17.F90: New file.
	* generated/_atan2_r17.F90: New file.
	* generated/_atan_r17.F90: New file.
	* generated/_atanh_r17.F90: New file.
	* generated/_conjg_c17.F90: New file.
	* generated/_cos_c17.F90: New file.
	* generated/_cos_r17.F90: New file.
	* generated/_cosh_r17.F90: New file.
	* generated/_dim_r17.F90: New file.
	* generated/_exp_c17.F90: New file.
	* generated/_exp_r17.F90: New file.
	* generated/_log10_r17.F90: New file.
	* generated/_log_c17.F90: New file.
	* generated/_log_r17.F90: New file.
	* generated/_mod_r17.F90: New file.
	* generated/_sign_r17.F90: New file.
	* generated/_sin_c17.F90: New file.
	* generated/_sin_r17.F90: New file.
	* generated/_sinh_r17.F90: New file.
	* generated/_sqrt_c17.F90: New file.
	* generated/_sqrt_r17.F90: New file.
	* generated/_tan_r17.F90: New file.
	* generated/_tanh_r17.F90: New file.
	* generated/bessel_r17.c: New file.
	* generated/cshift0_c17.c: New file.
	* generated/cshift0_r17.c: New file.
	* generated/cshift1_16_c17.c: New file.
	* generated/cshift1_16_r17.c: New file.
	* generated/cshift1_4_c17.c: New file.
	* generated/cshift1_4_r17.c: New file.
	* generated/cshift1_8_c17.c: New file.
	* generated/cshift1_8_r17.c: New file.
	* generated/findloc0_c17.c: New file.
	* generated/findloc0_r17.c: New file.
	* generated/findloc1_c17.c: New file.
	* generated/findloc1_r17.c: New file.
	* generated/in_pack_c17.c: New file.
	* generated/in_pack_r17.c: New file.
	* generated/in_unpack_c17.c: New file.
	* generated/in_unpack_r17.c: New file.
	* generated/matmul_c17.c: New file.
	* generated/matmul_r17.c: New file.
	* generated/matmulavx128_c17.c: New file.
	* generated/matmulavx128_r17.c: New file.
	* generated/maxloc0_16_r17.c: New file.
	* generated/maxloc0_4_r17.c: New file.
	* generated/maxloc0_8_r17.c: New file.
	* generated/maxloc1_16_r17.c: New file.
	* generated/maxloc1_4_r17.c: New file.
	* generated/maxloc1_8_r17.c: New file.
	* generated/maxval_r17.c: New file.
	* generated/minloc0_16_r17.c: New file.
	* generated/minloc0_4_r17.c: New file.
	* generated/minloc0_8_r17.c: New file.
	* generated/minloc1_16_r17.c: New file.
	* generated/minloc1_4_r17.c: New file.
	* generated/minloc1_8_r17.c: New file.
	* generated/minval_r17.c: New file.
	* generated/norm2_r17.c: New file.
	* generated/pack_c17.c: New file.
	* generated/pack_r17.c: New file.
	* generated/pow_c17_i16.c: New file.
	* generated/pow_c17_i4.c: New file.
	* generated/pow_c17_i8.c: New file.
	* generated/pow_r17_i16.c: New file.
	* generated/pow_r17_i4.c: New file.
	* generated/pow_r17_i8.c: New file.
	* generated/product_c17.c: New file.
	* generated/product_r17.c: New file.
	* generated/reshape_c17.c: New file.
	* generated/reshape_r17.c: New file.
	* generated/spread_c17.c: New file.
	* generated/spread_r17.c: New file.
	* generated/sum_c17.c: New file.
	* generated/sum_r17.c: New file.
	* generated/unpack_c17.c: New file.
	* generated/unpack_r17.c: New file.
2022-01-11 23:39:54 +01:00
GCC Administrator d9450aa0e8 Daily bump. 2022-01-11 00:16:36 +00:00
Francois-Xavier Coudert 492954263e Fortran: Allow IEEE_CLASS to identify signaling NaNs
We use the issignaling macro, present in some libc's (notably glibc),
when it is available. Compile all IEEE-related files in the library
(both C and Fortran sources) with -fsignaling-nans to ensure maximum
compatibility.

libgfortran/ChangeLog:

	PR fortran/82207
	* Makefile.am: Pass -fsignaling-nans for IEEE files.
	* Makefile.in: Regenerate.
	* ieee/ieee_helper.c: Use issignaling macro to recognized
	signaling NaNs.

gcc/testsuite/ChangeLog:

	PR fortran/82207
	* gfortran.dg/ieee/signaling_1.f90: New test.
	* gfortran.dg/ieee/signaling_1_c.c: New file.
2022-01-10 12:28:46 +01:00
Jakub Jelinek 7adcbafe45 Update copyright years. 2022-01-03 10:42:10 +01:00
Jakub Jelinek 6123f29a18 Rotate ChangeLog files - step 2 - remove 2021 entries from ChangeLog files.
Can't be committed together with the previous one due to the ChangeLog vs.
other files restrictions.
2022-01-03 10:23:34 +01:00
Jakub Jelinek d04ae83244 Rotate ChangeLog files - part 1 - add ChangeLog-2021.
2022-01-03  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
gcc/ada/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
gcc/cp/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
gcc/d/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
gcc/fortran/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
gcc/testsuite/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
libgfortran/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
libstdc++-v3/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
2022-01-03 10:18:16 +01:00
GCC Administrator f17d2677bc Daily bump. 2022-01-01 00:16:17 +00:00
Iain Sandoe e3cbb8c66c libgfortran: Fix bootstrap on targets without static_assert macro.
Although we build the library with GCC which is known to support
_Static_assert this might be done on a system without the macro
mapping static_assert to the compiler keyword.

The use of static_assert introduced with r12-6126-g3430132f3e82
causes bootstrap to fail on such targets, fixed by using the keyword
directly.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

libgfortran/ChangeLog:

	* runtime/string.c (gfc_itoa): Use _Static_assert directly
	instead of via the static_assert macro.
2021-12-31 13:16:16 +00:00
GCC Administrator be475aa0aa Daily bump. 2021-12-30 00:16:43 +00:00
Francois-Xavier Coudert ade9130f50 Fortran: keep values of IEEE_CLASS_TYPE in sync
Fortran 2018 added some synonyms to the existing values, namely
IEEE_NEGATIVE_SUBNORMAL (which is the same as IEEE_NEGATIVE_DENORMAL)
and IEEE_POSITIVE_SUBNORMAL (same as IEEE_POSITIVE_DENORMAL). When they
were added to the C side, they were not kept in sync with the Fortran
part of the library. Thew new values are not used (yet), so it is
currently harmless, but better fix it.

libgfortran/ChangeLog:

	* ieee/ieee_helper.c: Fix enum values.
2021-12-29 21:37:28 +01:00
GCC Administrator d1e111daee Daily bump. 2021-12-28 00:16:37 +00:00
Francois-Xavier Coudert 3430132f3e Fortran: fix use of static_assert() to conform to C11
libgfortran/ChangeLog:

	PR libfortran/98076
	* runtime/string.c (gfc_itoa): Use two args for static_assert().
2021-12-27 21:32:08 +01:00
GCC Administrator ad6091d1b8 Daily bump. 2021-12-27 00:16:20 +00:00
Francois-Xavier Coudert 9525c26bf1 Fortran: speed up decimal output of integers
libgfortran/ChangeLog:

	PR libfortran/98076
	* runtime/string.c (itoa64, itoa64_pad19): New helper functions.
	(gfc_itoa): On targets with 128-bit integers, call fast
	64-bit functions to avoid many slow divisions.

gcc/testsuite/ChangeLog:

	PR libfortran/98076
	* gfortran.dg/pr98076.f90: New test.
2021-12-26 12:00:00 +01:00
GCC Administrator 10ae9946dc Daily bump. 2021-12-26 00:16:17 +00:00
Francois-Xavier Coudert 4ae906e46c Fortran: simplify library code for integer-to-decimal conversion
libgfortran/ChangeLog:

	PR libfortran/81986
	PR libfortran/99191

	* libgfortran.h: Remove gfc_xtoa(), adjust gfc_itoa() and
	GFC_ITOA_BUF_SIZE.
	* io/write.c (write_decimal): conversion parameter is always
	gfc_itoa(), so remove it. Protect from overflow.
	(xtoa): Move gfc_xtoa and update its name.
	(xtoa_big): Renamed from ztoa_big for consistency.
	(write_z): Adjust to new function names.
	(write_i, write_integer): Remove last arg of write_decimal.
	* runtime/backtrace.c (error_callback): Comment on the use of
	gfc_itoa().
	* runtime/error.c (gfc_xtoa): Move to io/write.c.
	* runtime/string.c (gfc_itoa): Take an unsigned argument,
	remove the handling of negative values.
2021-12-25 15:07:12 +01:00
GCC Administrator 9f9bc0bf0d Daily bump. 2021-12-23 00:16:29 +00:00
Francois-Xavier Coudert 228173565e Fortran: allow __float128 on targets where long double is not REAL(KIND=10)
The logic for detection of REAL(KIND=16) in kinds-override.h made
assumptions:

    -- if real(kind=10) exists, i.e. if HAVE_GFC_REAL_10 is defined,
       then it is necessarily the "long double" type
    -- if real(kind=16) exists, then:
       * if HAVE_GFC_REAL_10, real(kind=16) is "__float128"
       * otherwise, real(kind=16) is "long double"

This may not always be true. Take the aarch64-apple-darwin port,
it has double == long double == binary64, and __float128 == binary128.

We already have more fine-grained logic in the mk-kinds-h.sh script,
where we actually check the Fortran kind corresponding to C’s long
double. So let's use it, and emit the GFC_REAL_16_IS_FLOAT128 /
GFC_REAL_16_IS_LONG_DOUBLE macros there.

libgfortran/ChangeLog:

	* kinds-override.h: Move GFC_REAL_16_IS_* macros...
	* mk-kinds-h.sh: ... here.
2021-12-22 12:46:07 +01:00
GCC Administrator 29309f6e29 Daily bump. 2021-12-20 00:16:21 +00:00
Francois-Xavier Coudert 220b9bdfe8 Fortran: add support for IEEE intrinsics on aarch64 non-glibc targets
This enables IEEE support on the upcoming aarch64-apple-darwin target,
and has been tested for some time in an external port.

libgfortran/ChangeLog:

	* configure.host: Add aarch64-apple-darwin support.
	* config/fpu-aarch64.h: New file.
2021-12-20 00:49:10 +01:00
GCC Administrator ca8c0408be Daily bump. 2021-12-19 00:16:17 +00:00
François-Xavier Coudert 21423a1dfa Fortran: Cast arguments of <ctype.h> functions to unsigned char
Functions from <ctype.h> should only be called on values that can be
represented by unsigned char. On targets where char is a signed type,
some of libgfortran calls have undefined behaviour.

The solution is to cast the argument to unsigned char type. I’ve defined
macros in libgfortran.h to do so, to retain legibility of the library
code.

PR libfortran/95177

libgfortran/ChangeLog

	* libgfortran.h: include ctype.h, provide safe macros.
	* io/format.c: use safe macros.
	* io/list_read.c: use safe macros.
	* io/read.c: use safe macros.
	* io/write.c: use safe macros.
	* runtime/environ.c: use safe macros.
2021-12-18 09:21:16 +01:00
GCC Administrator 774269aa4b Daily bump. 2021-12-17 00:16:20 +00:00
Francois-Xavier Coudert c14f38d429 Fix FLUSH IOSTAT value
PR libfortran/101255

libgfortran/ChangeLog:

	* io/file_pos.c: Fix error code.

gcc/testsuite/ChangeLog:

	* gfortran.dg/iostat_5.f90: New file.
2021-12-16 17:46:28 +01:00