Commit graph

2061 commits

Author SHA1 Message Date
H.J. Lu
9c7797a8c2
GCC: Check if AR works with --plugin and rc
AR from older binutils doesn't work with --plugin and rc:

[hjl@gnu-cfl-2 bin]$ touch foo.c
[hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
[hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
./ar: no operation specified
[hjl@gnu-cfl-2 bin]$ ./ar --version
GNU ar (Linux/GNU Binutils) 2.29.51.0.1.20180112
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
[hjl@gnu-cfl-2 bin]$

Check if AR works with --plugin and rc before passing --plugin to AR and
RANLIB.

ChangeLog:

	* configure: Regenerated.
	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Check if AR works with
	--plugin and rc before enabling --plugin.

config/ChangeLog:

	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with
	--plugin and rc before enabling --plugin.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libiberty/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:37 +02:00
H.J. Lu
126f707efb
Sync with binutils: GCC: Pass --plugin to AR and RANLIB
Sync with binutils for building binutils with LTO:

50ad1254d50 GCC: Pass --plugin to AR and RANLIB

Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
build.

ChangeLog:

	* Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@
	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
	* configure.ac: Include config/gcc-plugin.m4.
	AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION.
	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and
	RANLIB if possible.
	* Makefile.in: Regenerated.
	* configure: Likewise.

config/ChangeLog:

	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.

libiberty/ChangeLog:

	* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
	(configure_deps): Depend on ../config/gcc-plugin.m4.
	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
	RANLIB_PLUGIN_OPTION.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

zlib/ChangeLog:

	* configure: Regenerated.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:36 +02:00
GCC Administrator
0ce6353046 Daily bump. 2023-07-22 00:17:44 +00:00
Andrew Pinski
f32518726e libfortran: Fix build for targets that don't have 10byte or 16 byte floating point
So the problem here is EXPAND_INTER_MACRO_16 expands to nothing if 16 byte FP does not
exist but we still add a comma after it and that causes a build failure.
The same is true for EXPAND_INTER_MACRO_10 too.

Committed as obvious after a bootstrap and test on x86_64-linux-gnu and aarch64-linux-gnu.

libgfortran/ChangeLog:

	PR libfortran/110759
	* ieee/ieee_arithmetic.F90
	(COMP_INTERFACE): Remove the comma after EXPAND_INTER_MACRO_16
	and EXPAND_INTER_MACRO_10.
	(EXPAND_INTER_MACRO_16): Add comma here if 16 byte fp exist.
	(EXPAND_INTER_MACRO_10): Likewise.
2023-07-21 05:30:28 +00:00
GCC Administrator
e2bf82d510 Daily bump. 2023-07-21 00:17:07 +00:00
Francois-Xavier Coudert
dca2874897 Fortran: add IEEE_QUIET_* and IEEE_SIGNALING_* comparisons
Those operations were added to Fortran 2018, and correspond to
well-defined IEEE comparison operations, with defined signaling
semantics for NaNs. All are implemented in terms of GCC expressions and
built-ins, with no library support needed.

gcc/fortran/

	* f95-lang.cc (gfc_init_builtin_functions): Add __builtin_iseqsig.
	* trans-intrinsic.cc (conv_intrinsic_ieee_comparison): New
	function.
	(gfc_conv_ieee_arithmetic_function): Handle IEEE comparisons.

gcc/testsuite/

	* gfortran.dg/ieee/comparisons_1.f90: New test.
	* gfortran.dg/ieee/comparisons_2.f90: New test.
	* gfortran.dg/ieee/comparisons_3.F90: New test.

libgfortran/
	* ieee/ieee_arithmetic.F90: Add IEEE_QUIET_* and
	IEEE_SIGNALING_* functions.
2023-07-20 10:54:54 +02:00
GCC Administrator
35e50a0eaa Daily bump. 2023-06-12 00:16:56 +00:00
Francois-Xavier Coudert
ecc96eb5d2 libgfortran: remove support for --enable-intermodule
libgfortran/

	PR libfortran/109373
	* configure.ac: Remove support for --enable-intermodule
	* Makefile.am: Remove onestep path.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
2023-06-11 15:34:07 +02:00
GCC Administrator
09ae30358b Daily bump. 2023-06-11 00:17:37 +00:00
Francois-Xavier Coudert
17bccd1d2c Fortran: add Fortran 2018 IEEE_{MIN,MAX} functions
libgfortran/

	* ieee/ieee_arithmetic.F90: Add IEEE_MIN_NUM, IEEE_MAX_NUM,
	IEEE_MIN_NUM_MAG, and IEEE_MAX_NUM_MAG functions.

gcc/fortran/

	* f95-lang.cc (gfc_init_builtin_functions): Add fmax() and
	fmin() built-ins, and their variants.
	* mathbuiltins.def: Add FMAX and FMIN built-ins.
	* trans-intrinsic.cc (conv_intrinsic_ieee_minmax): New function.
	(gfc_conv_ieee_arithmetic_function): Handle IEEE_MIN_NUM and
	IEEE_MAX_NUM functions.

gcc/testsuite/
	* gfortran.dg/ieee/minmax_1.f90: New test.
2023-06-10 17:39:29 +02:00
GCC Administrator
20ca33db81 Daily bump. 2023-05-13 00:17:14 +00:00
Jerry DeLisle
cf3b032b8f Fortran: Initialize last_char for internal units.
PR fortran/109662

libgfortran/ChangeLog:

	* io/unit.c (set_internal_unit): Set the internal unit
	last_char to zero so that previous EOF characters do not
	influence the next read.
2023-05-12 13:40:41 -07:00
GCC Administrator
212905a47d Daily bump. 2023-05-09 00:16:43 +00:00
Bernhard Reutner-Fischer
c93bde224c fortran: Fix coding style around free()
Fix coding-style errors introduced in ca2f64d5d0

gcc/fortran/ChangeLog:

	* resolve.cc (resolve_select_type): Fix coding style.

libgfortran/ChangeLog:

	* caf/single.c (_gfortran_caf_register): Fix coding style.
	* io/async.c (update_pdt, async_io): Likewise.
	* io/format.c (free_format_data): Likewise.
	* io/transfer.c (st_read_done_worker, st_write_done_worker): Likewise.
	* io/unix.c (mem_close): Likewise.
2023-05-08 10:46:47 +02:00
Bernhard Reutner-Fischer
ca2f64d5d0 fortran: Remove conditionals around free()
gcc/fortran/ChangeLog:

	* resolve.cc (resolve_select_type): Call free() unconditionally.

libgfortran/ChangeLog:

	* caf/single.c (_gfortran_caf_register): Call free() unconditionally.
	* io/async.c (update_pdt, async_io): Likewise.
	* io/format.c (free_format_data): Likewise.
	* io/transfer.c (st_read_done_worker, st_write_done_worker): Likewise.
	* io/unix.c (mem_close): Likewise.
2023-05-08 07:55:48 +02:00
Jerry DeLisle
d46b3db4bd Fortran: Reject semicolon after namelist name.
PR fortran/109662

libgfortran/ChangeLog:

	* io/list_read.c: Add check for a semicolon after a namelist
	name in read input. Issue a runtime error message.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr109662-a.f90: New test.
2023-05-07 19:02:42 -07:00
GCC Administrator
2c8fa77120 Daily bump. 2023-05-07 00:16:40 +00:00
Jerry DeLisle
96d6991962 Fortran: Namelist read with invalid input accepted.
PR fortran/109662

libgfortran/ChangeLog:

	* io/list_read.c: Add a check for a comma after a namelist
	name in read input. Issue a runtime error message.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr109662.f90: New test.
2023-05-06 07:23:11 -07:00
GCC Administrator
6f9e2f144e Daily bump. 2023-03-01 00:18:20 +00:00
Jerry DeLisle
c1375d975d Fortran: Eliminate nuisance warnings by initializing.
Set sstride[0] and mstride[0] to zero, eliminating some warnings.

libgfortran/ChangeLog:

	* generated/pack_c10.c (pack_c10): Regenerated.
	* generated/pack_c16.c (pack_c16): Regenerated.
	* generated/pack_c17.c (pack_c17): Regenerated.
	* generated/pack_c4.c (pack_c4): Regenerated.
	* generated/pack_c8.c (pack_c8): Regenerated.
	* generated/pack_i1.c (pack_i1): Regenerated.
	* generated/pack_i16.c (pack_i16): Regenerated.
	* generated/pack_i2.c (pack_i2): Regenerated.
	* generated/pack_i4.c (pack_i4): Regenerated.
	* generated/pack_i8.c (pack_i8): Regenerated.
	* generated/pack_r10.c (pack_r10): Regenerated.
	* generated/pack_r16.c (pack_r16): Regenerated.
	* generated/pack_r17.c (pack_r17): Regenerated.
	* generated/pack_r4.c (pack_r4): Regenerated.
	* generated/pack_r8.c (pack_r8): Regenerated.
	* generated/spread_c10.c (spread_c10): Regenerated.
	* generated/spread_c16.c (spread_c16): Regenerated.
	* generated/spread_c17.c (spread_c17): Regenerated.
	* generated/spread_c4.c (spread_c4): Regenerated.
	* generated/spread_c8.c (spread_c8): Regenerated.
	* generated/spread_i1.c (spread_i1): Regenerated.
	* generated/spread_i16.c (spread_i16): Regenerated.
	* generated/spread_i2.c (spread_i2): Regenerated.
	* generated/spread_i4.c (spread_i4): Regenerated.
	* generated/spread_i8.c (spread_i8): Regenerated.
	* generated/spread_r10.c (spread_r10): Regenerated.
	* generated/spread_r16.c (spread_r16): Regenerated.
	* generated/spread_r17.c (spread_r17): Regenerated.
	* generated/spread_r4.c (spread_r4): Regenerated.
	* generated/spread_r8.c (spread_r8): Regenerated.
	* intrinsics/execute_command_line.c (execute_command_line_i4),
	(execute_command_line_i8): Set estat_initial to zero.
	* intrinsics/pack_generic.c (pack_internal): Set sstride[0] and
	mstride[0] to zero.
	* intrinsics/spread_generic.c (spread_internal): Set sstride[0].
	* m4/pack.m4: Set sstride[0] and mstride[0].
	* m4/spread.m4: Set sstride[0].
2023-02-27 18:02:59 -08:00
GCC Administrator
9f98cfa51b Daily bump. 2023-01-19 00:17:35 +00:00
Tobias Burnus
8e2c6e7b42 libfortran: Fix execute_command_line for Windows
On Windows, 'system' is called - that fails with -1 if the command
interpreter could not be started; on POSIX systems, if the child
process could not be started by the shell, exit(127)/_exit(127) is
called/returned. On Windows, cmd.exe (and also the PowerShell) return
errorlevel 9009.

libgfortran/ChangeLog:

	* intrinsics/execute_command_line.c (execute_command_line): On
	Windows, regard system()'s return value of 9009 as EXEC_INVALIDCOMMAND.
2023-01-18 23:31:41 +01:00
Jakub Jelinek
83ffe9cde7 Update copyright years. 2023-01-16 11:52:17 +01:00
GCC Administrator
d901bf8a44 Daily bump. 2023-01-08 00:16:59 +00:00
LIU Hao
902c755930 Always define WIN32_LEAN_AND_MEAN before <windows.h>
Recently, mingw-w64 has got updated <msxml.h> from Wine which is included
indirectly by <windows.h> if `WIN32_LEAN_AND_MEAN` is not defined. The
`IXMLDOMDocument` class has a member function named `abort()`, which gets
affected by our `abort()` macro in "system.h".

`WIN32_LEAN_AND_MEAN` should, nevertheless, always be defined. This
can exclude 'APIs such as Cryptography, DDE, RPC, Shell, and Windows
Sockets' [1], and speed up compilation of these files a bit.

[1] https://learn.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers

gcc/

	PR middle-end/108300
	* config/xtensa/xtensa-dynconfig.c: Define `WIN32_LEAN_AND_MEAN`
	before <windows.h>.
	* diagnostic-color.cc: Likewise.
	* plugin.cc: Likewise.
	* prefix.cc: Likewise.

gcc/ada/

	PR middle-end/108300
	* adaint.c: Define `WIN32_LEAN_AND_MEAN` before `#include
	<windows.h>`.
	* cio.c: Likewise.
	* ctrl_c.c: Likewise.
	* expect.c: Likewise.
	* gsocket.h: Likewise.
	* mingw32.h: Likewise.
	* mkdir.c: Likewise.
	* rtfinal.c: Likewise.
	* rtinit.c: Likewise.
	* seh_init.c: Likewise.
	* sysdep.c: Likewise.
	* terminals.c: Likewise.
	* tracebak.c: Likewise.

gcc/jit/

	PR middle-end/108300
	* jit-w32.h: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.

libatomic/

	PR middle-end/108300
	* config/mingw/lock.c: Define `WIN32_LEAN_AND_MEAN` before
	<windows.h>.

libffi/

	PR middle-end/108300
	* src/aarch64/ffi.c: Define `WIN32_LEAN_AND_MEAN` before
	<windows.h>.

libgcc/

	PR middle-end/108300
	* config/i386/enable-execute-stack-mingw32.c: Define
	`WIN32_LEAN_AND_MEAN` before <windows.h>.
	* libgcc2.c: Likewise.
	* unwind-generic.h: Likewise.

libgfortran/

	PR middle-end/108300
	* intrinsics/sleep.c: Define `WIN32_LEAN_AND_MEAN` before
	<windows.h>.

libgomp/

	PR middle-end/108300
	* config/mingw32/proc.c: Define `WIN32_LEAN_AND_MEAN` before
	<windows.h>.

libiberty/

	PR middle-end/108300
	* make-temp-file.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.
	* pex-win32.c: Likewise.

libssp/

	PR middle-end/108300
	* ssp.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.

libstdc++-v3/

	PR middle-end/108300
	* src/c++11/system_error.cc: Define `WIN32_LEAN_AND_MEAN` before
	<windows.h>.
	* src/c++11/thread.cc: Likewise.
	* src/c++17/fs_ops.cc: Likewise.
	* src/filesystem/ops.cc: Likewise.

libvtv/

	PR middle-end/108300
	* vtv_malloc.cc: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.
	* vtv_rts.cc: Likewise.
	* vtv_utils.cc: Likewise.
2023-01-07 06:51:06 +00:00
Jakub Jelinek
d64f877906 Rotate ChangeLog files.
Rotate ChangeLog files for ChangeLogs with yearly cadence.
2023-01-01 16:20:13 +01:00
GCC Administrator
c8f767b2c0 Daily bump. 2022-12-16 00:17:46 +00:00
Tobias Burnus
e205ec03f0 libgfortran's ISO_Fortran_binding.c: Use GCC11 version for backward-only code [PR108056]
Since GCC 12, the conversion between the array descriptors formats - the
internal (GFC) and the C binding one (CFI) - moved to the compiler itself
such that the cfi_desc_to_gfc_desc/gfc_desc_to_cfi_desc functions are only
used with older code (GCC 9 to 11).  The newly added checks caused asserts
as older code did not pass the proper values (e.g. real(4) as effective
argument arrived as BT_ASSUME type as the effective type got lost inbetween).

As proposed in the PR, revert to the GCC 11 version - known bugs is better
than some fixes and new issues. Still, GCC 12 is much better in terms of
TS29113 support and should really be used.

This patch uses the current libgomp version of the GCC 11 branch, except
it fixes the GFC version number (which is 0), uses calloc instead of malloc,
and sets the lower bound to 1 instead of keeping it as is for
CFI_attribute_other.

libgfortran/ChangeLog:

	PR libfortran/108056
	* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc,
	gfc_desc_to_cfi_desc): Mostly revert to GCC 11 version for
	those backward-compatiblity-only functions.
2022-12-15 12:26:06 +01:00
GCC Administrator
781f477a13 Daily bump. 2022-10-13 00:17:37 +00:00
Martin Liska
6d2294a83e regenerate configure files
Needed after a recent change.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

liboffloadmic/ChangeLog:

	* configure: Regenerate.
	* plugin/configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2022-10-12 09:31:32 +02:00
GCC Administrator
ab332cd78d Daily bump. 2022-10-12 00:17:24 +00:00
Olivier Hainque
0ecd0f1cc6 Generic configury support for shared libs on VxWorks
This change adds the configury bits to activate the build of
shared libs on VxWorks ports configured with --enable-shared,
for libraries variants where this is generally supported (rtp,
code model !large - currently not compatible with -fPIC).

Set lt_cv_deplibs_check_method in libtool.m4, so the build of
libraries know how to establish dependencies.  This is useful in
configurations such as aarch64 where proper support of LSE relies
on accurate dependency information between libstdc++ and libgcc_s
to begin with.

Regenerate configure scripts to reflect libtool.m4 change.

2022-10-09  Olivier Hainque  <hainque@adacore.com>

	* libtool.m4 (*vxworks*): When enable_shared, set dynamic_linker
	and friends for rtp !large. Assume the linker has the required
	abilities and set lt_cv_deplibs_check_method.

gcc/
	* config.gcc (*vxworks*): Add t-slibgcc fragment
	if enable_shared.

libgcc/
	* config.host (*vxworks*): When enable_shared, add
	libgcc and crtstuff "shared" fragments for rtp except
	large code model.
	(aarch64*-wrs-vxworks7*): Remove t-slibgcc-libgcc from
	the list of fragments.

2022-10-09  Olivier Hainque  <hainque@adacore.com>

gcc/
	* configure: Regenerate.

libatomic/
	* configure: Regenerate.

libbacktrace/
	* configure: Regenerate.

libcc1/
	* configure: Regenerate.

libffi/
	* configure: Regenerate.

libgfortran/
	* configure: Regenerate.

libgomp/
	* configure: Regenerate.

libitm/
	* configure: Regenerate.

libobjc/
	* configure: Regenerate.

liboffloadmic/
	* configure: Regenerate.

liboffloadmic/
	* plugin/configure: Regenerate.

libphobos/
	* configure: Regenerate.

libquadmath/
	* configure: Regenerate.

libsanitizer/
	* configure: Regenerate.

libssp/
	* configure: Regenerate.

libstdc++-v3/
	* configure: Regenerate.

libvtv/
	* configure: Regenerate.

lto-plugin/
	* configure: Regenerate.

zlib/
	* configure: Regenerate.
2022-10-11 07:31:07 +00:00
GCC Administrator
27bfe54e97 Daily bump. 2022-10-11 00:17:00 +00:00
LIU Hao
decbb5bf7c libgfortran: Use __gthread_t instead of pthread_t
It used to cause errors if a thread model other than `posix` was selected,
which looks like a leftover from a79878585a.

libgfortran/
	* io/async.h (struct async_unit): Use `__gthread_t` instead
	of `pthread_t`.

Signed-off-by: LIU Hao <lh_mouse@126.com>
Signed-off-by: Jonathan Yong <10walls@gmail.com>
2022-10-10 07:16:03 +00:00
GCC Administrator
f85847bd40 Daily bump. 2022-09-22 00:19:09 +00:00
Francois-Xavier Coudert
519196a27c Fortran: handle RADIX kind in IEEE_SET_ROUNDING_MODE
Make sure that calling IEEE_SET_ROUNDING_MODE with RADIX=10 does not
affect the binary rounding mode.

2022-09-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

libgfortran/

	* ieee/ieee_arithmetic.F90 (IEEE_SET_ROUNDING_MODE): Handle
	RADIX argument better.

gcc/testsuite/

	* gfortran.dg/ieee/rounding_3.f90: New test.
2022-09-21 11:15:21 +02:00
Francois-Xavier Coudert
ce8aed75a3 Fortran: add symbols in version map for IEEE_GET_MODES and IEEE_SET_MODES
The symbols were forgotten in the patch that added IEEE_GET_MODES
and IEEE_SET_MODES.

2022-09-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

libgfortran/

	* gfortran.map: Add symbols for IEEE_GET_MODES
	and IEEE_SET_MODES.
2022-09-21 10:04:22 +02:00
GCC Administrator
43be56c4c6 Daily bump. 2022-09-20 00:17:49 +00:00
Francois-Xavier Coudert
de40fab2f3 Fortran: add IEEE_MODES_TYPE, IEEE_GET_MODES and IEEE_SET_MODES
The IEEE_MODES_TYPE type and the two functions that get and set it
were added in Fortran 2018.  They can be implemented using the already
existing target-specific functions.  A future optimization could, on
some targets, set/get all modes through one or two instructions only,
but that would need a new set of functions in all config/fpu-* files.

2022-09-04  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

libgfortran/

	* ieee/ieee_exceptions.F90: Add IEEE_MODES_TYPE, IEEE_GET_MODES
	and IEEE_SET_MODES.
	* ieee/ieee_arithmetic.F90: Make them public in IEEE_ARITHMETIC
	as well.

gcc/testsuite/

	* gfortran.dg/ieee/modes_1.f90: New test.
2022-09-19 14:26:34 +02:00
Francois-Xavier Coudert
4637a1d293 Fortran: F2018 rounding modes changes
Add the new IEEE_AWAY rounding mode. It is unsupported on all known
targets, but could be supported by glibc and AIX as part of the C2x
proposal. Testing for now is minimal.

Add the optional RADIX argument to IEEE_SET_ROUNDING_MODE and
IEEE_GET_ROUNDING_MODE. It is unused for now, because we do not
support radices other than 2.

2022-08-31  Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>

gcc/fortran/
	* libgfortran.h: Declare GFC_FPE_AWAY.

gcc/testsuite/
	* gfortran.dg/ieee/rounding_2.f90: New test.

libgfortran/
	* ieee/ieee_arithmetic.F90: Add RADIX argument to
	IEEE_SET_ROUNDING_MODE and IEEE_GET_ROUNDING_MODE.
	* config/fpu-387.h: Add IEEE_AWAY mode.
	* config/fpu-aarch64.h: Add IEEE_AWAY mode.
	* config/fpu-aix.h: Add IEEE_AWAY mode.
	* config/fpu-generic.h: Add IEEE_AWAY mode.
	* config/fpu-glibc.h: Add IEEE_AWAY mode.
	* config/fpu-sysv.h: Add IEEE_AWAY mode.
2022-09-19 13:03:28 +02:00
GCC Administrator
5b3496e2ea Daily bump. 2022-09-11 00:16:56 +00:00
Francois-Xavier Coudert
7c4c65d114 fortran: Add IEEE_SIGNBIT and IEEE_FMA functions
The functions are added to the IEEE_ARITHMETIC module, but
are entirely expanded in the front-end, using GCC built-ins.

2022-08-31  Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>

	PR fortran/95644

gcc/fortran/
	* f95-lang.cc (gfc_init_builtin_functions): Declare FMA
	built-ins.
	* mathbuiltins.def: Declare FMA built-ins.
	* trans-intrinsic.cc (conv_intrinsic_ieee_fma): New function.
	(conv_intrinsic_ieee_signbit): New function.
	(gfc_build_intrinsic_lib_fndecls): Add cases for FMA and
	SIGNBIT.

gcc/testsuite/
	* gfortran.dg/ieee/fma_1.f90: New test.
	* gfortran.dg/ieee/signbit_1.f90: New test.

libgfortran/
	* ieee/ieee_arithmetic.F90: Add IEEE_SIGNBIT and IEEE_FMA.
2022-09-10 12:11:37 +02:00
GCC Administrator
16f542d6b8 Daily bump. 2022-08-27 00:17:09 +00:00
Jakub Jelinek
db630423a9 fortran: Expand ieee_arithmetic module's ieee_class inline [PR106579]
The following patch expands IEEE_CLASS inline in the FE, using the
__builtin_fpclassify, __builtin_signbit and the new __builtin_issignaling
builtins.

2022-08-26  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/106579
gcc/fortran/
	* f95-lang.cc (gfc_init_builtin_functions): Initialize
	BUILT_IN_FPCLASSIFY.
	* libgfortran.h (IEEE_OTHER_VALUE, IEEE_SIGNALING_NAN,
	IEEE_QUIET_NAN, IEEE_NEGATIVE_INF, IEEE_NEGATIVE_NORMAL,
	IEEE_NEGATIVE_DENORMAL, IEEE_NEGATIVE_SUBNORMAL,
	IEEE_NEGATIVE_ZERO, IEEE_POSITIVE_ZERO, IEEE_POSITIVE_DENORMAL,
	IEEE_POSITIVE_SUBNORMAL, IEEE_POSITIVE_NORMAL, IEEE_POSITIVE_INF):
	New enum.
	* trans-intrinsic.cc (conv_intrinsic_ieee_class): New function.
	(gfc_conv_ieee_arithmetic_function): Handle ieee_class.
libgfortran/
	* ieee/ieee_helper.c (IEEE_OTHER_VALUE, IEEE_SIGNALING_NAN,
	IEEE_QUIET_NAN, IEEE_NEGATIVE_INF, IEEE_NEGATIVE_NORMAL,
	IEEE_NEGATIVE_DENORMAL, IEEE_NEGATIVE_SUBNORMAL,
	IEEE_NEGATIVE_ZERO, IEEE_POSITIVE_ZERO, IEEE_POSITIVE_DENORMAL,
	IEEE_POSITIVE_SUBNORMAL, IEEE_POSITIVE_NORMAL, IEEE_POSITIVE_INF):
	Move to gcc/fortran/libgfortran.h.
2022-08-26 09:52:02 +02:00
Jakub Jelinek
387e6f1570 libgfortran: Use __builtin_issignaling in libgfortran [PR105105]
The following patch makes use of the new __builtin_issignaling,
so it no longer needs the fallback implementation and can use
the builtin even where glibc provides the macro.

2022-08-26  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/105105
	* ieee/ieee_helper.c: Don't include issignaling_fallback.h.
	(CLASSMACRO): Use __builtin_issignaling instead of issignaling.
	* ieee/issignaling_fallback.h: Removed.
2022-08-26 09:45:19 +02:00
GCC Administrator
0342f034ad Daily bump. 2022-08-18 00:16:43 +00:00
Jakub Jelinek
745be54bd6 fortran: Add -static-libquadmath support [PR46539]
The following patch is a revival of the
https://gcc.gnu.org/legacy-ml/gcc-patches/2014-10/msg00771.html
patch.  While trunk configured against recent glibc and with linker
--as-needed support doesn't really need to link against -lquadmath
anymore, there are still other targets where libquadmath is still in
use.
As has been discussed, making -static-libgfortran imply statically
linking both libgfortran and libquadmath is undesirable because of
the significant licensing differences between the 2 libraries.
Compared to the 2014 patch, this one doesn't handle -lquadmath
addition in the driver, which to me looks incorrect, libgfortran
configure determines where in libgfortran.spec -lquadmath should
be present if at all and with what it should be wrapped, but
analyzes gfortran -### -static-libgfortran stderr and based on
that figures out what gcc/configure.ac determined.

2022-08-17  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
	    Jakub Jelinek  <jakub@redhat.com>

	PR fortran/46539
gcc/
	* common.opt (static-libquadmath): New option.
	* gcc.cc (driver_handle_option): Always accept -static-libquadmath.
	* config/darwin.h (LINK_SPEC): Handle -static-libquadmath.
gcc/fortran/
	* lang.opt (static-libquadmath): New option.
	* invoke.texi (-static-libquadmath): Document it.
	* options.cc (gfc_handle_option): Error out if -static-libquadmath
	is passed but we do not support it.
libgfortran/
	* acinclude.m4 (LIBQUADSPEC): From $FC -static-libgfortran -###
	output determine -Bstatic/-Bdynamic, -bstatic/-bdynamic,
	-aarchive_shared/-adefault linker support or Darwin remapping
	of -lgfortran to libgfortran.a%s and use that around or instead
	of -lquadmath in LIBQUADSPEC.
	* configure: Regenerated.

Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
2022-08-17 17:03:30 +02:00
GCC Administrator
325103829e Daily bump. 2022-08-02 00:16:51 +00:00
Jakub Jelinek
82ac4cd213 libfortran: Fix up boz_15.f90 on powerpc64le with -mabi=ieeelongdouble [PR106079]
The boz_15.f90 test FAILs on powerpc64le-linux when -mabi=ieeelongdouble
is used (either default through --with-long-double-format=ieee or
when used explicitly).
The problem is that the read/write transfer routines are called with
BT_REAL (or BT_COMPLEX) type and kind 17 which is magic we use to say
it is the IEEE quad real(kind=16) rather than the IBM double double
real(kind=16).  For the floating point input/output we then handle kind
17 specially, but for B/O/Z we just treat the bytes of the floating point
value as binary blob and using 17 in that case results in unexpected
behavior, for write it means we don't estimate right how many chars we'll
need and print ******************** etc. rather than what we should, and
even with explicit size we'd print one further byte than intended.
For read it would even mean overwriting some unrelated byte after the
floating point object.

Fixed by using 16 instead of 17 in the read_radix and write_{b,o,z} calls.

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

	PR libfortran/106079
	* io/transfer.c (formatted_transfer_scalar_read,
	formatted_transfer_scalar_write): For type BT_REAL with kind 17
	change kind to 16 before calling read_radix or write_{b,o,z}.
2022-08-01 08:26:03 +02:00
GCC Administrator
ce600bc464 Daily bump. 2022-06-30 00:16:46 +00:00