Commit Graph

2014 Commits

Author SHA1 Message Date
Jakub Jelinek 99677969d4 Update ChangeLog and version files for release 2025-06-05 16:03:58 +00:00
GCC Administrator c2eb664666 Daily bump. 2025-05-24 00:21:15 +00:00
Jakub Jelinek b1fcb18faf libfortran: Fix up _gfortran_{,m,s}findloc2_s{1,4} [PR120196]
As mentioned in the PR, _gfortran_{,m,s}findloc2_s{1,4} iterate too many
times in the back case if nothing is found.
For !back, the loops are for (i = 1; i <= extent; i++) so i is in the
body [1, extent] if nothing is found, but for back it is
for (i = extent; i >= 0; i--) so i is in the body [0, extent] and compares
one element before the start of the array.
Note, findloc1_s{1,4} uses
          for (n = len; n > 0; n--, src -= delta * len_array)
for the back loop and
          for (n = 1; n <= len; n++, src += delta * len_array)
for !back.  This patch fixes that.
The testcase fails under valgrind without the libgfortran changes and
succeeds with those.

2025-05-13  Jakub Jelinek  <jakub@redhat.com>

	PR libfortran/120196
	* m4/ifindloc2.m4 (header1, header2): For back use i > 0 rather than
	i >= 0 as for condition.
	* generated/findloc2_s1.c: Regenerate.
	* generated/findloc2_s4.c: Regenerate.

	* gfortran.dg/pr120196.f90: New test.

(cherry picked from commit 748a7bc462)
2025-05-23 13:33:12 +02:00
Jakub Jelinek daed26377b libfortran: Fix up _gfortran_s{max,min}loc1_{4,8,16}_s{1,4} [PR120191]
There is a bug in _gfortran_s{max,min}loc1_{4,8,16}_s{1,4} which the
following testcase shows.
The functions return but then crash in the caller.
Seems that is because buffer overflows, I believe those functions for
if (mask == NULL || *mask) condition being false are supposed to fill in
the result array with all zeros (or allocate it and fill it with zeros).
My understanding is the result array in that case is integer(kind={4,8,16})
and should have the extents the character input array has.
The problem is that it uses * string_len in the extent multiplication:
      extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len;
and
      extent[n] =
        GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len;
which is I guess fine and desirable for the extents of the character array,
but not for the extents of the destination array.  Yet the code uses
that extent array for that purpose (and no other purposes).
Here it uses it to set the dimensions for the case where it needs to
allocate (as well as size):
      for (n = 0; n < rank; n++)
        {
          if (n == 0)
            str = 1;
          else
            str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
          GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
        }
Here it uses it for bounds checking of the destination:
      if (unlikely (compile_options.bounds_check))
        {
          for (n=0; n < rank; n++)
            {
              index_type ret_extent;

              ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n);
              if (extent[n] != ret_extent)
                runtime_error ("Incorrect extent in return value of"
                               " MAXLOC intrinsic in dimension %ld:"
                               " is %ld, should be %ld", (long int) n + 1,
                               (long int) ret_extent, (long int) extent[n]);
            }
        }
and here to find out how many retarray elements to actually fill in each
dimension:
  while(1)
    {
      *dest = 0;
      count[0]++;
      dest += dstride[0];
      n = 0;
      while (count[n] == extent[n])
        {
          /* When we get to the end of a dimension, reset it and increment
             the next dimension.  */
          count[n] = 0;
          /* We could precalculate these products, but this is a less
             frequently used path so probably not worth it.  */
          dest -= dstride[n] * extent[n];
Seems maxloc1s.m4 and minloc1s.m4 are the only users of ifunction-s.m4,
so we can change SCALAR_ARRAY_FUNCTION in there without breaking anything
else.

2025-05-13  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/120191
	* m4/ifunction-s.m4 (SCALAR_ARRAY_FUNCTION): Don't multiply
	GFC_DESCRIPTOR_EXTENT(array,) by string_len.
	* generated/maxloc1_4_s1.c: Regenerate.
	* generated/maxloc1_4_s4.c: Regenerate.
	* generated/maxloc1_8_s1.c: Regenerate.
	* generated/maxloc1_8_s4.c: Regenerate.
	* generated/maxloc1_16_s1.c: Regenerate.
	* generated/maxloc1_16_s4.c: Regenerate.
	* generated/minloc1_4_s1.c: Regenerate.
	* generated/minloc1_4_s4.c: Regenerate.
	* generated/minloc1_8_s1.c: Regenerate.
	* generated/minloc1_8_s4.c: Regenerate.
	* generated/minloc1_16_s1.c: Regenerate.
	* generated/minloc1_16_s4.c: Regenerate.

	* gfortran.dg/pr120191_3.f90: New test.

(cherry picked from commit 781cfc454b)
2025-05-23 13:32:38 +02:00
Jakub Jelinek 153f26425c libfortran: Fix up _gfortran_s{max,min}loc2_{4,8,16}_s{1,4} [PR120191]
I've tried to write a testcase for the BT_CHARACTER maxloc/minloc with named
or unnamed arguments and indeed the just posted patch fixed the arguments
in there in multiple cases to match what the library expects.
But the testcase still fails, due to library problems.

One dealt with in this patch are _gfortran_s{max,min}loc2_{4,8,16}_s{1,4}
functions.  Those are trivial wrappers around
_gfortrani_{max,min}loc2_{4,8,16}_s{1,4} which should call those functions
if the scalar mask is true and just return 0 otherwise.
The two bugs I see there is that the back, len arguments are swapped,
which means that it always acts as back=.true. and for len will use
character length of 1 or 0 instead of the desired one.
The _gfortrani_{max,min}loc2_{4,8,16}_s{1,4} functions have prototypes like
GFC_INTEGER_4
maxloc2_4_s1 (gfc_array_s1 * const restrict array, GFC_LOGICAL_4 back, gfc_charlen_type len)
so back comes before len, ditto for the
GFC_INTEGER_4
smaxloc2_4_s1 (gfc_array_s1 * const restrict array,
               GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len)
The other problem is that it was just testing if (mask).  In my limited
Fortran understanding that means that the optional argument mask was
supplied but nothing about its actual value.  Other scalar mask generated
routines use if (mask == NULL || *mask) as the condition when to call the
non-masked function, i.e. when mask is not supplied (then it should act like
.true. mask) or when it is supplied and evaluates to .true.).

2025-05-13  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/120191
	* m4/maxloc2s.m4: For smaxloc2 call maxloc2 if mask is NULL or *mask.
	Swap back and len arguments.
	* m4/minloc2s.m4: Likewise.
	* generated/maxloc2_4_s1.c: Regenerate.
	* generated/maxloc2_4_s4.c: Regenerate.
	* generated/maxloc2_8_s1.c: Regenerate.
	* generated/maxloc2_8_s4.c: Regenerate.
	* generated/maxloc2_16_s1.c: Regenerate.
	* generated/maxloc2_16_s4.c: Regenerate.
	* generated/minloc2_4_s1.c: Regenerate.
	* generated/minloc2_4_s4.c: Regenerate.
	* generated/minloc2_8_s1.c: Regenerate.
	* generated/minloc2_8_s4.c: Regenerate.
	* generated/minloc2_16_s1.c: Regenerate.
	* generated/minloc2_16_s4.c: Regenerate.

	* gfortran.dg/pr120191_2.f90: New test.

(cherry picked from commit 482f2192d4)
2025-05-23 13:30:56 +02:00
Jakub Jelinek b71f1de6e9 Update ChangeLog and version files for release 2024-05-21 07:32:24 +00:00
GCC Administrator 7bbad31994 Daily bump. 2024-04-23 00:21:36 +00:00
Jerry DeLisle b55a35bcc8 libfortran: Fix handling of formatted separators.
Backport from mainline.

	PR libfortran/114304
	PR libfortran/105473

libgfortran/ChangeLog:

	* io/list_read.c (eat_separator): Add logic to handle spaces
	preceding a comma or semicolon such that that a 'null' read
	occurs without error at the end of comma or semicolon
	terminated input lines. Add check and error message for ';'.
	Accept tab as alternative to space.
	(list_formatted_read_scalar): Treat comma as a decimal point
	when specified by the decimal mode on the first item.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr105473.f90: Modify for revised checks.
	* gfortran.dg/pr114304-2.f90: New test.
	* gfortran.dg/pr114304.f90: New test.
2024-04-21 21:05:20 -07:00
GCC Administrator 8f81688f32 Daily bump. 2024-03-12 00:22:31 +00:00
Jerry DeLisle 824a71f609 libgfortran: [PR114304] Revert portion of PR105347 change.
PR libfortran/105437
	PR libfortran/114304

libgfortran/ChangeLog:

	* io/list_read.c (eat_separator): Remove check for decimal
	point mode and semicolon used as a seprator. Removes
	the regression.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr105473.f90: Add additional checks to address
	the case of semicolon at the end of a line.

(cherry picked from commit 0c179654c3)
2024-03-11 15:27:40 -07:00
GCC Administrator abe32a9aa9 Daily bump. 2024-03-09 00:21:47 +00:00
Jerry DeLisle 7ecea49245 libgfortran: [PR105473] Fix checks for decimal='comma'.
PR libfortran/105473

libgfortran/ChangeLog:

	* io/list_read.c (eat_separator): Reject comma as a
	separator when it is being used as a decimal point.
	(parse_real): Reject a '.' when it should be a comma.
	(read_real): Likewise.
	* io/read.c (read_f): Add more checks for ',' and '.'
	conditions.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr105473.f90: New test.

(cherry picked from commit a71d87431d)
2024-03-07 16:29:09 -08:00
GCC Administrator c7dd2dea0c Daily bump. 2024-02-14 00:21:16 +00:00
Jerry DeLisle d85a658402 libgfortran: Adjust bytes_left and pos for access="STREAM".
During tab edits, the pos (position) and bytes_used
Variables were not being set correctly for stream I/O.
Since stream I/O does not have 'real' records, the
format buffer active length must be used instead of
the record length variable.

       PR libgfortran/109358

libgfortran/ChangeLog:

	* io/transfer.c (formatted_transfer_scalar_write): Adjust
	bytes_used and pos variable for stream access.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr109358.f90: New test.

(cherry picked from commit 153ce7a78e)
2024-02-12 16:46:07 -08:00
Jerry DeLisle fbe5e908de libgfortran: EN0.0E0 and ES0.0E0 format editing.
F2018 and F2023 standards added zero width exponents. This required
additional special handing in the process of building formatted
floating point strings.

G formatting uses either F or E formatting as documented in
write_float.def comments. This logic changes the format token from FMT_G
to FMT_F or FMT_E. The new formatting requirements interfere with this
process when a FMT_G float string is being built.  To avoid this, a new
component called 'pushed' is added to the fnode structure to save this
condition.  The 'pushed' condition is then used to bypass portions of
the new ES,E,EN, and D formatting, falling through to the existing
default formatting which is retained.

libgfortran/ChangeLog:
	PR libfortran/111022
	* io/format.c (get_fnode): Update initialization of fnode.
	(parse_format_list): Initialization.
	* io/format.h (struct fnode): Added the new 'pushed' component.
	* io/write.c (select_buffer): Whitespace.
	(write_real): Whitespace.
	(write_real_w0): Adjust logic for the d == 0 condition.
	* io/write_float.def (determine_precision): Whitespace.
	(build_float_string): Calculate width of ..E0 exponents and
	adjust logic accordingly.
	(build_infnan_string): Whitespace.
	(CALCULATE_EXP): Whitespace.
	(quadmath_snprintf): Whitespace.
	(determine_en_precision): Whitespace.

gcc/testsuite/ChangeLog:
	PR libfortran/111022
	* gfortran.dg/fmt_error_10.f: Show D+0 exponent.
	* gfortran.dg/pr96436_4.f90: Show E+0 exponent.
	* gfortran.dg/pr96436_5.f90: Show E+0 exponent.
	* gfortran.dg/pr111022.f90: New test.

(cherry picked from commit d436e8e70d)
2024-02-12 16:41:34 -08:00
GCC Administrator 8f561cd996 Daily bump. 2024-02-12 00:21:20 +00:00
Francois-Xavier Coudert 0ea5efea8f libgfortran: avoid duplicate libraries in spec
The linking of libgcc is already present in %(liborig), so the current
situation duplicates libraries. This was not an issue until macOS's new
linker started giving warnings for such cases.

libgfortran/ChangeLog:

	PR libfortran/110651
	* libgfortran.spec.in: Remove duplicate libraries.
2024-02-11 14:42:24 +01:00
GCC Administrator f7908a55b9 Daily bump. 2024-01-14 00:25:52 +00:00
Jerry DeLisle 370aa06510 libgfortran: Emit a space at beginning of internal unit NML.
PR libgfortran/113223

libgfortran/ChangeLog:

	* io/write.c (namelist_write): If internal_unit precede with space.

gcc/testsuite/ChangeLog:

	* gfortran.dg/dtio_25.f90: Update.
	* gfortran.dg/namelist_57.f90: Update.
	* gfortran.dg/namelist_65.f90: Update.

(cherry picked from commit add995ec11)
2024-01-13 12:59:48 -08:00
Jakub Jelinek c891d8dc23 Update ChangeLog and version files for release 2023-07-27 08:13:36 +00:00
Jakub Jelinek cc035c5d86 Update ChangeLog and version files for release 2023-04-26 07:10:03 +00: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