Commit Graph

1920 Commits

Author SHA1 Message Date
GCC Administrator d48df6f24b Daily bump. 2020-11-27 00:16:31 +00:00
Maciej W. Rozycki beb9afcaf1 libgfortran: Verify the presence of all functions for POSIX 2008 locale
While we have `configure' checks for the individual POSIX 2008 extended
locale functions we refer to and use to guard the respective call sites,
we only verify the presence of `newlocale' for our global feature enable
check.  Consequently compilation fails for targets like NetBSD that only
have partial support for POSIX 2008 locale features and in particular
lack the `uselocale' function:

.../libgfortran/io/transfer.c: In function 'data_transfer_init_worker':
.../libgfortran/io/transfer.c:3416:30: error:
'old_locale_lock' undeclared (first use in this function)
 3416 |       __gthread_mutex_lock (&old_locale_lock);
      |                              ^~~~~~~~~~~~~~~
.../libgfortran/io/transfer.c:3416:30: note: each undeclared identifier is reported only once for each function it appears in
.../libgfortran/io/transfer.c:3417:12: error:
'old_locale_ctr' undeclared (first use in this function)
 3417 |       if (!old_locale_ctr++)
      |            ^~~~~~~~~~~~~~
.../libgfortran/io/transfer.c:3419:11: error:
'old_locale' undeclared (first use in this function); did you mean 'c_locale'?
 3419 |           old_locale = setlocale (LC_NUMERIC, NULL);
      |           ^~~~~~~~~~
      |           c_locale
.../libgfortran/io/transfer.c: In function 'finalize_transfer':
.../libgfortran/io/transfer.c:4253:26: error:
'old_locale_lock' undeclared (first use in this function)
 4253 |   __gthread_mutex_lock (&old_locale_lock);
      |                          ^~~~~~~~~~~~~~~
.../libgfortran/io/transfer.c:4254:10: error:
'old_locale_ctr' undeclared (first use in this function)
 4254 |   if (!--old_locale_ctr)
      |          ^~~~~~~~~~~~~~
.../libgfortran/io/transfer.c:4256:30: error:
'old_locale' undeclared (first use in this function); did you mean 'c_locale'?
 4256 |       setlocale (LC_NUMERIC, old_locale);
      |                              ^~~~~~~~~~
      |                              c_locale
make[3]: *** [Makefile:6221: transfer.lo] Error 1

Only enable the use of POSIX 2008 extended locale features then when all
the three functions required are present, removing said build errors.

	libgfortran/
	* io/io.h [HAVE_NEWLOCALE]: Also check for HAVE_FREELOCALE and
	HAVE_USELOCALE.
	[HAVE_FREELOCALE && HAVE_NEWLOCALE && HAVE_USELOCALE]
	(HAVE_POSIX_2008_LOCALE): New macro.
	(st_parameter_dt) [HAVE_NEWLOCALE]: Check for
	HAVE_POSIX_2008_LOCALE instead.
	* io/transfer.c (data_transfer_init_worker, finalize_transfer)
	[HAVE_USELOCALE]: Check for HAVE_POSIX_2008_LOCALE instead.
	* io/unit.c [HAVE_NEWLOCALE]: Likewise.
	(init_units) [HAVE_NEWLOCALE]: Likewise.
	(close_units) [HAVE_FREELOCALE]: Likewise.
	* runtime/error.c (gf_strerror) [HAVE_USELOCALE]: Likewise.
2020-11-26 17:26:43 +00:00
Maciej W. Rozycki c87cce5a33 libgfortran: Correct FP feature macro checks
The *_HAS_* floating-point feature macros are defined as 0/1 rather than
#undef/#define settings by gcc/c-family/c-cppbuiltin.c.  Consequently we
choose to use infinity and NaN features even with non-IEEE-754 targets
such as `vax-netbsdelf' that lack them, causing build warnings and
failures like:

In file included from .../libgfortran/generated/maxval_r4.c:26:
.../libgfortran/generated/maxval_r4.c: In function 'maxval_r4':
.../libgfortran/libgfortran.h:292:30: warning: target format does not support infinity
  292 | # define GFC_REAL_4_INFINITY __builtin_inff ()
      |                              ^~~~~~~~~~~~~~
.../libgfortran/generated/maxval_r4.c:149:19:
note: in expansion of macro 'GFC_REAL_4_INFINITY'
  149 |         result = -GFC_REAL_4_INFINITY;
      |                   ^~~~~~~~~~~~~~~~~~~
.../libgfortran/generated/maxval_r4.c: In function 'mmaxval_r4':
.../libgfortran/libgfortran.h:292:30: warning: target format does not support infinity
  292 | # define GFC_REAL_4_INFINITY __builtin_inff ()
      |                              ^~~~~~~~~~~~~~
.../libgfortran/generated/maxval_r4.c:363:19:
note: in expansion of macro 'GFC_REAL_4_INFINITY'
  363 |         result = -GFC_REAL_4_INFINITY;
      |                   ^~~~~~~~~~~~~~~~~~~
{standard input}: Assembler messages:
{standard input}:204: Fatal error: Can't relocate expression
make[3]: *** [Makefile:3358: maxval_r4.lo] Error 1

Correct the checks then for __FLT_HAS_INFINITY__, __DBL_HAS_INFINITY__,
__LDBL_HAS_INFINITY__, __FLT_HAS_QUIET_NAN__, __DBL_HAS_QUIET_NAN__, and
__LDBL_HAS_QUIET_NAN__ to match semantics and remove build issues coming
from the misinterpretation of these macros.

	libgfortran/
	* libgfortran.h: Use #if rather than #ifdef with
	__FLT_HAS_INFINITY__, __DBL_HAS_INFINITY__,
	__LDBL_HAS_INFINITY__, __FLT_HAS_QUIET_NAN__,
	__DBL_HAS_QUIET_NAN__, and __LDBL_HAS_QUIET_NAN__.
2020-11-26 17:26:43 +00:00
GCC Administrator 7a97e2fcf7 Daily bump. 2020-11-22 00:16:24 +00:00
Iain Sandoe a345413076 Darwin, libgfortran : Do not use environ directly from the library.
On macOS / Darwin, the environ variable can be used directly in the
code of an executable, but cannot be used in the code of a shared
library (i.e. libgfortran.dylib), in this case.

In such cases, the  function _NSGetEnviron should be called to get
the address of 'environ'.

libgfortran/ChangeLog:

	* intrinsics/execute_command_line.c (environ): Use
	_NSGetEnviron to get the environment pointer on Darwin.
2020-11-21 09:06:49 +00:00
GCC Administrator 88ce3d5fbb Daily bump. 2020-11-02 20:53:00 +00:00
Harald Anlauf 667db6dedd PR libfortran/97581 - clean up size calculation of random generator state
The random number generator internal state may be saved to/restored from
an array of integers.  Clean up calculation of needed number of elements
to avoid redefiniton of auxiliary macro SZ.

libgfortran/ChangeLog:

	* intrinsics/random.c (SZ_IN_INT_4): Define size of state in int32_t.
	(SZ_IN_INT_8): Define size of state in int64_t.
	(SZ): Remove.
	(random_seed_i4): Use size SZ_IN_INT_4 instead of SZ.
	(random_seed_i8): Use size SZ_IN_INT_8 instead of SZ.
2020-10-30 20:49:32 +01:00
GCC Administrator 3acb91a48e Daily bump. 2020-10-19 00:16:22 +00:00
Harald Anlauf cd6cd6aed1 PR libfortran/97063 - Wrong result for vector (step size is negative) * matrix
The MATMUL intrinsic provided a wrong result for rank-1 times rank-2 array
when a negative stride was used for addressing the elements of the rank-1
array, because a check on strides was erroneously placed before the check
on the rank.  Interchange order of checks.

libgfortran/ChangeLog:

	* m4/matmul_internal.m4: Move check for rank-1 times rank-2 before
	checks on strides for rank-2 times rank-2.
	* generated/matmul_c10.c: Regenerated.
	* generated/matmul_c16.c: Likewise.
	* generated/matmul_c4.c: Likewise.
	* generated/matmul_c8.c: Likewise.
	* generated/matmul_i1.c: Likewise.
	* generated/matmul_i16.c: Likewise.
	* generated/matmul_i2.c: Likewise.
	* generated/matmul_i4.c: Likewise.
	* generated/matmul_i8.c: Likewise.
	* generated/matmul_r10.c: Likewise.
	* generated/matmul_r16.c: Likewise.
	* generated/matmul_r4.c: Likewise.
	* generated/matmul_r8.c: Likewise.
	* generated/matmulavx128_c10.c: Likewise.
	* generated/matmulavx128_c16.c: Likewise.
	* generated/matmulavx128_c4.c: Likewise.
	* generated/matmulavx128_c8.c: Likewise.
	* generated/matmulavx128_i1.c: Likewise.
	* generated/matmulavx128_i16.c: Likewise.
	* generated/matmulavx128_i2.c: Likewise.
	* generated/matmulavx128_i4.c: Likewise.
	* generated/matmulavx128_i8.c: Likewise.
	* generated/matmulavx128_r10.c: Likewise.
	* generated/matmulavx128_r16.c: Likewise.
	* generated/matmulavx128_r4.c: Likewise.
	* generated/matmulavx128_r8.c: Likewise.

gcc/testsuite/ChangeLog:

	* gfortran.dg/matmul_20.f90: New test.
2020-10-18 20:15:26 +02:00
GCC Administrator e84761c6f3 Daily bump. 2020-09-29 00:16:30 +00:00
Tobias Burnus 69c56ce673 libgfortran/m4/unpack.m4: Silence -Wmaybe-uninitialized
libgfortran/ChangeLog:

	* m4/unpack.m4 (unpack0_'rtype_code`,
	unpack1_'rtype_code`): Move 'rstride[0]' initialization outside
	conditional branch to silence -Wmaybe-uninitialized.
	* generated/unpack_c10.c: Regenerate.
	* generated/unpack_c16.c: Regenerate.
	* generated/unpack_c4.c: Regenerate.
	* generated/unpack_c8.c: Regenerate.
	* generated/unpack_i1.c: Regenerate.
	* generated/unpack_i16.c: Regenerate.
	* generated/unpack_i2.c: Regenerate.
	* generated/unpack_i4.c: Regenerate.
	* generated/unpack_i8.c: Regenerate.
	* generated/unpack_r10.c: Regenerate.
	* generated/unpack_r16.c: Regenerate.
	* generated/unpack_r4.c: Regenerate.
	* generated/unpack_r8.c: Regenerate.
2020-09-28 23:10:31 +02:00
GCC Administrator 4383c595ce Daily bump. 2020-09-28 00:16:21 +00:00
Clément Chigot 3c11f25fb8 aix: Use $(AR) without -X32_64 to build FAT libraries.
AIX FAT libraries should be built with the version of AR chosen by configure.
The GNU Make $(AR) variable includes the AIX -X32_64 option needed
by the default Makefile rules to accept both 32 bit and 64 bit object files.
The -X32_64 option conflicts with ar archiving objects of the same name
used to build FAT libraries.

This patch changes the Makefile fragments for AIX FAT libraries to use $(AR),
but strips the -X32_64 option from the Make variable.

libgcc/ChangeLog:

2020-09-27  Clement Chigot  <clement.chigot@atos.net>

	* config/rs6000/t-slibgcc-aix: Use $(AR) without -X32_64.

libatomic/ChangeLog:

2020-09-27  Clement Chigot  <clement.chigot@atos.net>

	* config/t-aix: Use $(AR) without -X32_64.

libgomp/ChangeLog:

2020-09-27  Clement Chigot  <clement.chigot@atos.net>

	* config/t-aix: Use $(AR) without -X32_64.

libstdc++-v3/ChangeLog:

2020-09-27  Clement Chigot  <clement.chigot@atos.net>

	* config/os/aix/t-aix: Use $(AR) without -X32_64.

libgfortran/ChangeLog:

2020-09-27  Clement Chigot  <clement.chigot@atos.net>

	* config/t-aix: Use $(AR) without -X32_64.
2020-09-27 12:43:29 -04:00
GCC Administrator 6e82b6cfcf Daily bump. 2020-09-04 00:16:32 +00:00
Harald Anlauf 8eeeecbcc1 PR fortran/96890 - Wrong answer with intrinsic IALL
The IALL intrinsic would always return 0 when the DIM and MASK arguments
were present since the initial value of repeated BIT-AND operations was
set to 0 instead of -1.

libgfortran/ChangeLog:

	* m4/iall.m4: Initial value for result should be -1.
	* generated/iall_i1.c (miall_i1): Generated.
	* generated/iall_i16.c (miall_i16): Likewise.
	* generated/iall_i2.c (miall_i2): Likewise.
	* generated/iall_i4.c (miall_i4): Likewise.
	* generated/iall_i8.c (miall_i8): Likewise.

gcc/testsuite/ChangeLog:

	* gfortran.dg/iall_masked.f90: New test.
2020-09-03 20:33:14 +02:00
GCC Administrator b2b24d30bb Daily bump. 2020-08-25 00:16:24 +00:00
Mark Eggleston de09e7ebc9 Fortran : get_environment_variable runtime error PR96486
Runtime error occurs when the type of the value argument is
character(0):  "Zero-length string passed as value...".
The status argument, intent(out), will contain -1 if the value
of the environment is too large to fit in the value argument, this
is the case if the type is character(0) so there is no reason to
produce a runtime error if the value argument is zero length.

2020-08-24  Mark Eggleston  <markeggleston@gcc.gnu.org>

libgfortran/

	PR fortran/96486
	* intrinsics/env.c: If value_len is > 0 blank the string.
	Copy the result only if its length is > 0.

2020-08-24  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

	PR fortran/96486
	* gfortran.dg/pr96486.f90: New test.
2020-08-24 11:13:11 +01:00
GCC Administrator 5b9a3d2a05 Daily bump. 2020-08-21 00:16:23 +00:00
Mark Eggleston c2a0fd7c8f Fortran : rejected f0.d edit descriptor PR96436
Zero length f format descriptors are valid for Fortran 95 and
later.  For g format descriptors from Fortran 2008 and later.
Finally for D, E, EN and ES for Fortran 2018 and later.

2020-08-20  Mark Eggleston  <markeggleston@gcc.gnu.org>

libgfortran/

	PR fortran/96436
	* io/format.c (parse_format_list):  Add new local variable
	"standard" to hold the required standard to check. If the
	format width is zero select standard depending on descriptor.
	Call notification_std using the new standard variable.

2020-08-20  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

	PR fortran/96436
	* gfortran.dg/pr96436_1.f90: New test.
	* gfortran.dg/pr96436_2.f90: New test.
	* gfortran.dg/pr96436_3.f90: New test.
	* gfortran.dg/pr96436_4.f90: New test.
	* gfortran.dg/pr96436_5.f90: New test.
	* gfortran.dg/pr96436_6.f90: New test.
	* gfortran.dg/pr96436_7.f90: New test.
	* gfortran.dg/pr96436_8.f90: New test.
	* gfortran.dg/pr96436_9.f90
	* gfortran.dg/pr96436_10.f90
2020-08-20 07:40:55 +01:00
GCC Administrator deee2322a2 Daily bump. 2020-08-18 00:16:26 +00:00
David Edelsohn 26fdc47da7 aix: Support libgfortran libcaf_single.a as a FAT library
Build libgfortran static library libcaf_single.a as a FAT 32/64 bit library.

libgfortran/ChangeLog:

2020-08-17  David Edelsohn  <dje.gcc@gmail.com>
	    Clement Chigot  <clement.chigot@atos.net>

	* config/t-aix: Add complementary mode object file to libcaf_single.a.
2020-08-17 14:05:41 -04:00
GCC Administrator 6a1ad710ad Daily bump. 2020-08-04 00:16:24 +00:00
Tobias Burnus 58cfec3a6e libgfortran/caf/single.c: Fix typo.
libgfortran/ChangeLog

	* caf/single.c (_gfortran_caf_lock): Fix typo.
2020-08-03 09:41:24 +02:00
GCC Administrator 049fbbdc60 Daily bump. 2020-07-27 00:16:20 +00:00
Tobias Burnus 2e764ae1d6 libgfortran: Skip integer-kind=16 check for amdgcn
libgfortran/ChangeLog:

	PR target/96306
	* configure.ac: Add LIBGOMP_CHECKED_INT_KINDS and
	LIBGOMP_CHECKED_REAL_KINDS and use it for to skip
	integer kind=16 checks for amdgcn.
	* Makefile.am (kinds.h, selected_int_kind.inc,
	selected_real_kind.inc): Pass them on.
	* mk-kinds-h.sh: Takes to-be-check kinds as argument.
	* mk-sik-inc.sh: Likewise.
	* mk-srk-inc.sh: Likewise.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
2020-07-26 07:20:24 +02:00
GCC Administrator 53256ee3d5 Daily bump. 2020-07-25 00:16:22 +00:00
Dominique d'Humieres aa7e7eff5e PR 93567, G edit descriptor uses E instead of F editing in rounding mode UP.
The switch between FMT_E and FMT_F is based on the absolute value.
Set r=0 for rounding toward zero and r = 1 otherwise.
If (exp_d - m) == 1 there is no rounding needed.

libgfortran/ChangeLog:

	PR fortran/93567
	* io/write_float.def (determine_en_precision): Fix switch between
	FMT_E and FMT_F.

gcc/testsuite/ChangeLog:

	PR fortran/93567
	* gfortran.dg/round_3.f08: Add test cases.
2020-07-24 20:47:47 +02:00
Dominique d'Humieres 05e0971bcf PR 93592 - Invalid UP/DOWN rounding with EN descriptor.
The fix is obvious (I have added a comment). The tests are probably
an overkill, but it does not hurt.

libgfortran/ChangeLog:

	PR fortran/93592
	* io/write_float.def (build_float_string): Do not reset
	  nbefore for FMT_F and FMT_EN.

gcc/testsuite/ChangeLog:

	PR fortran/93592
	* gfortran.dg/fmt_en.f90: Adjust test.
	* gfortran.dg/fmt_en_rd.f90: New test.
	* gfortran.dg/fmt_en_rn.f90: New test.
	* gfortran.dg/fmt_en_ru.f90: New test.
	* gfortran.dg/fmt_en_rz.f90: New test.
2020-07-24 20:47:30 +02:00
GCC Administrator 8ca07a3072 Daily bump. 2020-07-15 00:16:35 +00:00
David Edelsohn 4f97bed9a7 aix: FAT libraries: test native compiler mode directly
The FAT libraries config fragments need to know which library is native
and which is a multilib to choose the correct multilib from which to
append the additional object file or shared object file.  Testing the
top-level archive is fragile because it will fail if rebuilding.  This
patch tests the compiler preprocessing macros for the 64 bit AIX specific
__64BIT__ to determine the native mode of the compiler in MULTILIBTOP.

2020-07-14  David Edelsohn  <dje.gcc@gmail.com>

libatomic/ChangeLog

	* config/t-aix: Set BITS from compiler cpp macro.

libgcc/ChangeLog

	* config/rs6000/t-slibgcc-aix: Set BITS from compiler cpp macro.

libgfortran/ChangeLog

	* config/t-aix: Set BITS from compiler cpp macro.

libgomp/ChangeLog

	* config/t-aix: Set BITS from compiler cpp macro.

libstdc++-v3/ChangeLog

	* config/os/aix/t-aix: Set BITS from compiler cpp macro.
2020-07-14 10:41:40 -04:00
GCC Administrator 605a8f3bbc Daily bump. 2020-06-23 00:16:23 +00:00
David Edelsohn 0164e59835 build: Use -include instead of conditional include.
Automake and GNU Make both use the endif keyword, which conflicts and
elicits an error for matching if/ifdef and endif.

This patch changes the conditional include to use "-include" to prevent
a warning about a possible empty tmake_file.

libgomp/ChangeLog

2020-06-22  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am: Use -include.
	* Makefile.in: Regenerate.

libatomic/ChangeLog

2020-06-22  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am: Use -include.
	* Makefile.in: Regenerate.

libstdc++-v3/ChangeLog

2020-06-22  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am: Use -include.
	* Makefile.in: Regenerate.

libgfortran/ChangeLog

2020-06-22  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am: Use -include.
	* Makefile.in: Regenerate.
2020-06-22 21:31:48 +00:00
GCC Administrator f86e11a267 Daily bump. 2020-06-22 00:16:23 +00:00
David Edelsohn 47ddb895df aix: Add GCC64 configuration and FAT target libraries.
This patch adds the ability to configure GCC on AIX to build as a
64 bit application and to build target libraries "FAT" libraries in both
32 bit and 64 bit mode.

The patch adds makefile fragment hooks to target libraries that allows
them to include target-specific rules.  The target specific rules for
AIX place both 32 bit and 64 bit objects and shared objects
in archives at the top-level, not multilib subdirectories.  The
multilibs are built in subdirectories, but must be combined during the
last parts of the target library build process.  Because of the way
that GCC bootstrap works, the libraries must be combined during the
multiple stages of GCC bootstrap, not solely when installed in the
final destination, so the libraries are correct at the end of
each target library build stage, not solely an install recipe.

gcc/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* config.gcc: Use t-aix64, biarch64 and default64 for cpu_is_64bit.
	* config/rs6000/aix72.h (ASM_SPEC): Remove aix64 option.
	(ASM_SPEC32): New.
	(ASM_SPEC64): New.
	(ASM_CPU_SPEC): Remove vsx and altivec options.
	(CPP_SPEC_COMMON): Rename from CPP_SPEC.
	(CPP_SPEC32): New.
	(CPP_SPEC64): New.
	(CPLUSPLUS_CPP_SPEC): Rename to CPLUSPLUS_CPP_SPEC_COMMON..
	(TARGET_DEFAULT): Only define if not BIARCH.
	(LIB_SPEC_COMMON): Rename from LIB_SPEC.
	(LIB_SPEC32): New.
	(LIB_SPEC64): New.
	(LINK_SPEC_COMMON): Rename from LINK_SPEC.
	(LINK_SPEC32): New.
	(LINK_SPEC64): New.
	(STARTFILE_SPEC): Add 64 bit version of crtcxa and crtdbase.
	(ASM_SPEC): Define 32 and 64 bit alternatives using DEFAULT_ARCH64_P.
	(CPP_SPEC): Same.
	(CPLUSPLUS_CPP_SPEC): Same.
	(LIB_SPEC): Same.
	(LINK_SPEC): Same.
	(SUBTARGET_EXTRA_SPECS): Add new 32/64 specs.
	* config/rs6000/defaultaix64.h: New file.
	* config/rs6000/t-aix64: New file.

libgcc/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* config.host (extra_parts): Add crtcxa_64 and crtdbase_64.
	* config/rs6000/t-aix-cxa: Explicitly compile 32 bit with -maix32
	and 64 bit with -maix64.
	* config/rs6000/t-slibgcc-aix: Remove extra @multilib_dir@ level.
	Build and install AIX-style FAT libraries.

libgomp/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.tgt (powerpc-ibm-aix*): Define tmake_file.
	* config/t-aix: New file.

libstdc++-v3/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.host (aix*): Define tmake_file.
	* config/os/aix/t-aix: New file.

libatomic/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.tgt (powerpc-ibm-aix*): Define tmake_file.
	* config/t-aix: New file.

libgfortran/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.host: Add system configury stanza. Define tmake_file.
	* config/t-aix: New file.
2020-06-21 14:14:46 -04:00
GCC Administrator efb4d74555 Daily bump. 2020-06-14 00:16:18 +00:00
Thomas Koenig 0cfc34ad12 Disable -Wstringop-overflow warning after checking code path of caller.
The warning that is disabled, only on this single line, has been
inspected and found to be not applicable; it is known that the size
of the buffer is safe.

libgfortran/ChangeLog:

2020-06-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/95313
	* io/write.c (ztoa_big): Disable -Wstringop-overflow for one
	line.
2020-06-13 10:04:33 +02:00
GCC Administrator 2c455ae06c Daily bump. 2020-06-09 00:16:47 +00:00
Harald Anlauf 8cd239614e PR fortran/95195 - Fortran testcase should clean up afterwards
Change testcase to check error message (iomsg) at runtime, rather than to crash.

libgfortran/
	PR fortran/95091
	* io/transfer.c (finalize_transfer): Fix type in error message.

gcc/testsuite/
	PR fortran/95195
	* gfortran.dg/namelist_97.f90: Adjust testcase.
2020-06-08 21:01:06 +02:00
GCC Administrator 4a9aa9dec7 Daily bump. 2020-06-02 00:16:25 +00:00
Uros Bizjak 832c1192eb i386: Add __attribute__ ((gcc_struct)) to struct fenv [PR95418]
Windows ABI (MinGW) is different than Linux ABI when bitfileds are involved.
The following patch adds __attribute__ ((gcc_struct)) to struct fenv in order
to match the layout of x87 state image in memory.

2020-06-01  Uroš Bizjak  <ubizjak@gmail.com>

libatomic/ChangeLog:
	* config/x86/fenv.c (struct fenv): Add __attribute__ ((gcc_struct)).

libgcc/ChangeLog:
	* config/i386/sfp-exceptions.c (struct fenv):
	Add __attribute__ ((gcc_struct)).

libgfortran/ChangeLog:
	PR libfortran/95418
	* config/fpu-387.h (struct fenv): Add __attribute__ ((gcc_struct)).
2020-06-01 22:29:20 +02:00
GCC Administrator 885ef72f27 Daily bump. 2020-05-30 00:16:27 +00:00
H.J. Lu 9051b54827 Avoid nested save_CFLAGS and save_LDFLAGS
Avoid nested save_CFLAGS and save_LDFLAGS by replacing save_CFLAGS and
save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS in cet.m4.

config/

	PR bootstrap/95413
	* cet.m4: Replace save_CFLAGS and save_LDFLAGS with
	cet_save_CFLAGS and cet_save_LDFLAGS.

gcc/

	PR bootstrap/95413
	* configure: Regenerated.

libatomic/

	PR bootstrap/95413
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/95413
	* configure: Regenerated.

libcc1/

	PR bootstrap/95413
	* configure: Regenerated.

libcpp/

	PR bootstrap/95413
	* configure: Regenerated.

libdecnumber/

	PR bootstrap/95413
	* configure: Regenerated.

libgcc/

	PR bootstrap/95413
	* configure: Regenerated.

libgfortran/

	PR bootstrap/95413
	* configure: Regenerated.

libgomp/

	PR bootstrap/95413
	* configure: Regenerated.

libiberty/

	PR bootstrap/95413
	* configure: Regenerated.

libitm/

	PR bootstrap/95413
	* configure: Regenerated.

libobjc/

	PR bootstrap/95413
	* configure: Regenerated.

libphobos/

	PR bootstrap/95413
	* configure: Regenerated.

libquadmath/

	PR bootstrap/95413
	* configure: Regenerated.

libsanitizer/

	PR bootstrap/95413
	* configure: Regenerated.

libssp/

	PR bootstrap/95413
	* configure: Regenerated.

libstdc++-v3/

	PR bootstrap/95413
	* configure: Regenerated.

libvtv/

	PR bootstrap/95413
	* configure: Regenerated.

lto-plugin/

	PR bootstrap/95413
	* configure: Regenerated.

zlib/

	PR bootstrap/95413
	* configure: Regenerated.
2020-05-29 12:56:40 -07:00
Jakub Jelinek 316fe6b401 libgfortran: Export forgotten _gfortran_{,m,s}findloc{0,1}_c10 [PR95390]
I have noticed we don't export these 6 symbols and thus the testcase
below fails to link.

2020-05-29  Jakub Jelinek  <jakub@redhat.com>

	PR libfortran/95390
	* gfortran.dg/findloc_8.f90: New test.

	* Makefile.am (i_findloc0_c): Add findloc0_i10.c.
	(i_findloc1_c): Add findloc1_i10.c.
	* gfortran.map (GFORTRAN_10.2): New symbol version, export
	_gfortran_{,m,s}findloc{0,1}_c10 symbols.
	* Makefile.in: Regenerated.
	* generated/findloc0_c10.c: Generated.
	* generated/findloc1_c10.c: Generated.
2020-05-29 19:01:50 +02:00
GCC Administrator 53ffb43a79 Daily bump. 2020-05-29 00:16:23 +00:00
Harald Anlauf 6ce3d791df PR fortran/95104 - Segfault on a legal WAIT statement
The initial commit for this PR uncovered a latent issue with unit locking
in the Fortran run-time library.  Add check for valid unit.

2020-05-28  Harald Anlauf  <anlauf@gmx.de>

libgfortran/
	PR libfortran/95104
	* io/unit.c (unlock_unit): Guard by check for NULL pointer.
2020-05-28 21:53:17 +02:00
GCC Administrator c3a4169be9 Daily bump. 2020-05-27 07:45:56 +00:00
Harald Anlauf 56f03cd12b PR fortran/95104 - Segfault on a legal WAIT statement
Referencing a unit in a WAIT statement that has not been opened before
resulted in a NULL pointer dereference.  Check for this condition.

2020-05-26  Harald Anlauf  <anlauf@gmx.de>

libgfortran/
	PR libfortran/95104
	* io/transfer.c (st_wait_async): Do not dereference NULL pointer.

gcc/testsuite/
	PR libfortran/95104
	* gfortran.dg/pr95104.f90: New test.

Co-Authored-By: Steven G. Kargl  <kargl@gcc.gnu.org>
2020-05-26 23:29:52 +02:00
Harald Anlauf 8d8a25b0a7 PR libfortran/95195 - improve runtime error for namelist i/o to unformatted file
Namelist input/output to unformatted files is prohibited.
Generate useful runtime errors instead instead of misleading ones.

2020-05-26  Harald Anlauf  <anlauf@gmx.de>

libgfortran/
	PR fortran/95195
	* io/transfer.c (finalize_transfer): Generate runtime error for
	namelist input/output to unformatted file.

gcc/testsuite/
	PR fortran/95195
	* gfortran.dg/namelist_97.f90: New test.
2020-05-26 21:33:46 +02:00
Thomas Koenig 8df7ee67f6 Fixes a hang on an invalid ID in a WAIT statement.
gcc/fortran/ChangeLog:

2020-05-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/95191
	* libgfortran.h (libgfortran_error_codes): Add
	LIBERROR_BAD_WAIT_ID.

libgfortran/ChangeLog:

2020-05-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/95191
	* io/async.c (async_wait_id): Generate error if ID is higher
	than the highest current ID.
	* runtime/error.c (translate_error): Handle LIBERROR_BAD_WAIT_ID.

libgomp/ChangeLog:

2020-05-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/95191
	* testsuite/libgomp.fortran/async_io_9.f90: New test.
2020-05-23 19:01:43 +02:00
H.J. Lu 8ebc2f5e05 libgfortran: Use __builtin_cpu_is/__builtin_cpu_supports
* m4/matmul.m4: Don't include <config/i386/cpuinfo.h>.  Use
	__builtin_cpu_is/__builtin_cpu_supports
	* generated/matmul_c10.c: Regenerated.
	* generated/matmul_c16.c: Likewise.
	* generated/matmul_c4.c: Likewise.
	* generated/matmul_c8.c: Likewise.
	* generated/matmul_i1.c: Likewise.
	* generated/matmul_i16.c: Likewise.
	* generated/matmul_i2.c: Likewise.
	* generated/matmul_i4.c: Likewise.
	* generated/matmul_i8.c: Likewise.
	* generated/matmul_r10.c: Likewise.
	* generated/matmul_r16.c: Likewise.
	* generated/matmul_r4.c: Likewise.
	* generated/matmul_r8.c: Likewise.
2020-05-21 03:54:47 -07:00
H.J. Lu 4c1a5d8b71 x86: Also check if -fcf-protection works
When defaulting CET run-time support to auto, check if -fcf-protection
works.  Even if the stage1 GCC doesn't support -fcf-protection, since
the final GCC does, CET run-time support will be enabled by default if
binutils support CET.

config/

	PR bootstrap/95147
	* cet.m4 (GCC_CET_FLAGS): Also check if -fcf-protection works
	when defaulting to auto.

libatomic/

	PR bootstrap/95147
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/95147
	* configure: Regenerated.

libgcc/

	PR bootstrap/95147
	* configure: Regenerated.

libgfortran/

	PR bootstrap/95147
	* configure: Regenerated.

libgomp/

	PR bootstrap/95147
	* configure: Regenerated.

libitm/

	PR bootstrap/95147
	* configure: Regenerated.

libobjc/

	PR bootstrap/95147
	* configure: Regenerated.

libphobos/

	PR bootstrap/95147
	* configure: Regenerated.

libquadmath/

	PR bootstrap/95147
	* configure: Regenerated.

libsanitizer/

	PR bootstrap/95147
	* configure: Regenerated.

libssp/

	PR bootstrap/95147
	* configure: Regenerated.

libstdc++-v3/

	PR bootstrap/95147
	* configure: Regenerated.

libvtv/

	PR bootstrap/95147
	* configure: Regenerated.

zlib/

	PR bootstrap/95147
	* configure: Regenerated.
2020-05-15 09:07:17 -07:00
Thomas Koenig d975519ad1 Removed double ChangeLog entries from previous commit. 2020-05-14 18:37:18 +02:00
Thomas Koenig cdc34b5057 Add early return for invalid STATUS for close.
2020-05-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/95119
	* io/close.c (close_status): Add CLOSE_INVALID.
	(st_close): Return early on invalid STATUS parameter.

2020-05-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/95119
	* testsuite/libgomp.fortran/close_errors_1.f90: New test.
2020-05-14 18:33:24 +02:00
H.J. Lu 8d286dd118 x86: Default CET run-time support to auto
CET has been added since GCC 8.  This patch defaults CET run-time support
to auto.  It enables CET run-time support if asssembler supports CET
instructions and multi-byte NOPs are enabled via SSE2.

config/

	* cet.m4 (GCC_CET_FLAGS): Change default to auto.

gcc/

	* configure: Regenerated.

libatomic/

	* configure: Regenerated.

libbacktrace/

	* configure: Regenerated.

libcc1/

	* configure: Regenerated.

libcpp/

	* configure: Regenerated.

libdecnumber/

	* configure: Regenerated.

libgcc/

	* configure: Regenerated.

libgfortran/

	* configure: Regenerated.

libgomp/

	* configure: Regenerated.

libitm/

	* configure: Regenerated.

libobjc/

	* configure: Regenerated.

libquadmath/

	* configure: Regenerated.

libsanitizer/

	* configure: Regenerated.

libssp/

	* configure: Regenerated.

libstdc++-v3/

	* configure: Regenerated.

libvtv/

	* configure: Regenerated.

zlib/

	* configure: Regenerated.
2020-05-14 09:05:02 -07:00
Uros Bizjak d3a1459cd4 i386: Use generic division to generate INEXACT exception
Introduce math_force_eval_div to use generic division to generate
INEXACT as well as INVALID and DIVZERO exceptions.

libgcc/ChangeLog:

	* config/i386/sfp-exceptions.c (__math_force_eval): Remove.
	(__math_force_eval_div): New define.
	(__sfp_handle_exceptions): Use __math_force_eval_div to use
	generic division to generate INVALID, DIVZERO and INEXACT
	exceptions.

libatomic/ChangeLog:

	* config/x86/fenv.c (__math_force_eval): Remove.
	(__math_force_eval_div): New define.
	(__atomic_deraiseexcept): Use __math_force_eval_div to use
	generic division to generate INVALID, DIVZERO and INEXACT
	exceptions.

libgfortran/ChangeLog:

	* config/fpu-387.h (__math_force_eval): Remove.
	(__math_force_eval_div): New define.
	(local_feraiseexcept): Use __math_force_eval_div to use
	generic division to generate INVALID, DIVZERO and INEXACT
	exceptions.
	(struct fenv): Define named struct instead of typedef.
2020-05-06 23:01:32 +02:00
Uros Bizjak afb9b71081 i386: Use generic division to generate INVALID and DIVZERO exceptions
Introduce math_force_eval to evaluate generic division to generate
INVALID and DIVZERO exceptions.

libgcc/ChangeLog:

	* config/i386/sfp-exceptions.c (__math_force_eval): New define.
	(__sfp_handle_exceptions): Use __math_force_eval to evaluete
	generic division to generate INVALID and DIVZERO exceptions.

libatomic/ChangeLog:

	* config/x86/fenv.c (__math_force_eval): New define.
	(__atomic_feraiseexcept): Use __math_force_eval to evaluete
	generic division to generate INVALID and DIVZERO exceptions.

libgfortran/ChangeLog:

	* config/fpu-387.h (__math_force_eval): New define.
	(local_feraiseexcept): Use __math_force_eval to evaluete
	generic division to generate INVALID and DIVZERO exceptions.
2020-05-01 19:20:57 +02:00
Fritz Reese e8eecc2a91 Protect the trigd functions in libgfortran from unavailable math functions.
libgfortran/ChangeLog:

2020-04-22  Fritz Reese  <foreese@gcc.gnu.org>

	PR libfortran/94694
	PR libfortran/94586
	* intrinsics/trigd.c, intrinsics/trigd_lib.inc, intrinsics/trigd.inc:
	Guard against unavailable math functions.
	Use suffixes from kinds.h based on the REAL kind.

gcc/fortran/ChangeLog:

2020-04-22  Fritz Reese  <foreese@gcc.gnu.org>

	* trigd_fe.inc: Use mpfr to compute cosd(30) rather than a host-
	precision floating point literal based on an invalid macro.
2020-04-23 10:11:01 -04:00
Jakub Jelinek 1868599f8d libgfortran: Provide some further math library fallbacks [PR94694]
The following patch provides some further math library fallbacks.
fmaf can be implemented using fma if available, fma and fmal can use
x * y + z as fallback, it is not perfect, but e.g. glibc on various arches
has been using that as fallback for many years,
and copysign/copysignl/fabs/fabsl can be implemented using corresponding
__builtin_* if we make sure that gcc expands it inline instead of using
a library call (these days it is expanded inline on most targets).

2020-04-22  Jakub Jelinek  <jakub@redhat.com>

	PR libfortran/94694
	PR libfortran/94586
	* configure.ac: Add math func checks for fmaf, fma and fmal.  Add
	HAVE_INLINE_BUILTIN_COPYSIGN check.
	* c99_protos.h (copysign, fmaf, fma, fmal): Provide fallback
	prototypes.
	(HAVE_COPYSIGN, HAVE_FMAF, HAVE_FMA, HAVE_FMAL): Define if not
	defined and fallback version is provided.
	* intrinsics/c99_functions.c (copysign, fmaf, fma, fmal): Provide
	fallback implementations if possible
	* configure: Regenerated.
	* config.h.in: Regenerated.

	* math.m4 (GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK1,
	GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK2): New.
2020-04-22 21:34:19 +02:00
Uros Bizjak df73e5842f i386: Remove unneeded assignments when triggering SSE exceptions
According to "Intel 64 and IA32 Arch SDM, Vol. 3:

"Because SIMD floating-point exceptions are precise and occur immediately,
the situation does not arise where an x87 FPU instruction, a WAIT/FWAIT
instruction, or another SSE/SSE2/SSE3 instruction will catch a pending
unmasked SIMD floating-point exception."

Remove unneeded assignments to volatile memory.

libgcc/ChangeLog:

	* config/i386/sfp-exceptions.c (__sfp_handle_exceptions) [__SSE_MATH__]:
	Remove unneeded assignments to volatile memory.

libatomic/ChangeLog:

	* config/x86/fenv.c (__atomic_feraiseexcept) [__SSE_MATH__]:
	Remove unneeded assignments to volatile memory.

libgfortran/ChangeLog:

	* config/fpu-387.h (local_feraiseexcept) [__SSE_MATH__]:
	Remove unneeded assignments to volatile memory.
2020-04-19 14:27:12 +02:00
Fritz Reese 57391ddaf3 Fix PR fortran/93871 and re-implement degree-valued trigonometric intrinsics.
2020-04-01  Fritz Reese  <foreese@gcc.gnu.org>
	    Steven G. Kargl  <kargl@gcc.gnu.org>

gcc/fortran/ChangeLog

	PR fortran/93871
	* gfortran.h (GFC_ISYM_ACOSD, GFC_ISYM_ASIND, GFC_ISYM_ATAN2D,
	GFC_ISYM_ATAND, GFC_ISYM_COSD, GFC_ISYM_COTAND, GFC_ISYM_SIND,
	GFC_ISYM_TAND): New.
	* intrinsic.c (add_functions): Remove check for flag_dec_math.
	Give degree trig functions simplification and name resolution
	functions (e.g, gfc_simplify_atrigd () and gfc_resolve_atrigd ()).
	(do_simplify): Remove special casing of degree trig functions.
	* intrinsic.h (gfc_simplify_acosd, gfc_simplify_asind,
	gfc_simplify_atand, gfc_simplify_cosd, gfc_simplify_cotand,
	gfc_simplify_sind, gfc_simplify_tand, gfc_resolve_trigd2): Add new
	prototypes.
	(gfc_simplify_atrigd, gfc_simplify_trigd, gfc_resolve_cotan,
	resolve_atrigd): Remove prototypes of deleted functions.
	* iresolve.c (is_trig_resolved, copy_replace_function_shallow,
	gfc_resolve_cotan, get_radians, get_degrees, resolve_trig_call,
	gfc_resolve_atrigd, gfc_resolve_atan2d): Delete functions.
	(gfc_resolve_trigd, gfc_resolve_trigd2): Resolve to library functions.
	* simplify.c (rad2deg, deg2rad, gfc_simplify_acosd, gfc_simplify_asind,
	gfc_simplify_atand, gfc_simplify_atan2d, gfc_simplify_cosd,
	gfc_simplify_sind, gfc_simplify_tand, gfc_simplify_cotand): New
	functions.
	(gfc_simplify_atan2): Fix error message.
	(simplify_trig_call, gfc_simplify_trigd, gfc_simplify_atrigd,
	radians_f): Delete functions.
	* trans-intrinsic.c: Add LIB_FUNCTION decls for sind, cosd, tand.
	(rad2deg, gfc_conv_intrinsic_atrigd, gfc_conv_intrinsic_cotan,
	gfc_conv_intrinsic_cotand, gfc_conv_intrinsic_atan2d): New functions.
	(gfc_conv_intrinsic_function): Handle ACOSD, ASIND, ATAND, COTAN,
	COTAND, ATAN2D.
	* trigd_fe.inc: New file. Included by simplify.c to implement
	simplify_sind, simplify_cosd, simplify_tand with code common to the
	libgfortran implementation.

gcc/testsuite/ChangeLog

	PR fortran/93871
	* gfortran.dg/dec_math.f90: Extend coverage to real(10) and real(16).
	* gfortran.dg/dec_math_2.f90: New test.
	* gfortran.dg/dec_math_3.f90: Likewise.
	* gfortran.dg/dec_math_4.f90: Likewise.
	* gfortran.dg/dec_math_5.f90: Likewise.

libgfortran/ChangeLog

	PR fortran/93871
	* Makefile.am, Makefile.in: New make rule for intrinsics/trigd.c.
	* gfortran.map: New routines for {sind, cosd, tand}X{r4, r8, r10, r16}.
	* intrinsics/trigd.c, intrinsics/trigd_lib.inc, intrinsics/trigd.inc:
	New files. Defines native degree-valued trig functions.
2020-04-07 13:18:38 -04:00
Thomas König 3fe1910509 Use au->lock exclusively for locking in async I/O.
2020-02-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/93599
	* io/async.c (destroy_adv_cond): Do not destroy lock.
	(async_io): Make sure au->lock is locked for finishing of thread.
	Do not lock/unlock around signalling emptysignal. Unlock au->lock
	before return.
	(init_adv_cond): Do not initialize lock.
	(enqueue_transfer): Unlock after signal.
	(enqueue_done_id): Likewise.
	(enqueue_done): Likewise.
	(enqueue_close): Likewise.
	(enqueue_data_transfer): Likewise.
	(async_wait_id): Do not lock/unlock around signalling au->work.
	(async_wait): Unlock after signal.
	* io/async.h (SIGNAL): Add comment about needed au->lock.
	Remove locking/unlocking of advcond->lock.
	(WAIT_SIGNAL_MUTEX): Add comment. Remove locking/unlocking of
	advcond->lock.  Unlock mutex only at the end.  Loop on
	__ghread_cond_wait returning zero.
	(REVOKE_SIGNAL): Add comment. Remove locking/unlocking of
	advcond->lock.
	(struct adv_cond): Remove mutex from struct.

asdf
2020-02-18 19:45:25 +01:00
Sandra Loosemore 02ce382cd3 Use a non-empty test program to test ability to link.
On bare-metal targets, I/O support is typically provided by a BSP and
requires a linker script and/or hosting library to be specified on the
linker command line.  Linking an empty program with the default linker
script may succeed, however, which confuses libstdc++ configuration
when programs that probe for the presence of various I/O features fail
with link errors.

2020-02-12  Sandra Loosemore  <sandra@codesourcery.com>

	PR libstdc++/79193
	PR libstdc++/88999

	config/
	* no-executables.m4: Use a non-empty program to test for linker
	support.

	libgcc/
	* configure: Regenerated.

	libgfortran/
	* configure: Regenerated.

	libiberty/
	* configure: Regenerated.

	libitm/
	* configure: Regenerated.

	libobjc/
	* configure: Regenerated.

	libquadmath/
	* configure: Regenerated.

	libssp/
	* configure: Regenerated.

	libstdc++v-3/
	* configure: Regenerated.
2020-02-12 13:22:07 -08:00
Maciej W. Rozycki e8e66971cd Add `--with-toolexeclibdir=' configuration option
Provide means, in the form of a `--with-toolexeclibdir=' configuration
option, to override the default installation directory for target
libraries, otherwise known as $toolexeclibdir.  This is so that it is
possible to get newly-built libraries, particularly the shared ones,
installed in a common place, so that they can be readily used by the
target system as their host libraries, possibly over NFS, without a need
to manually copy them over from the currently hardcoded location they
would otherwise be installed in.

In the presence of the `--enable-version-specific-runtime-libs' option
and for configurations building native GCC the option is ignored.

	config/
	* toolexeclibdir.m4: New file.

	gcc/
	* doc/install.texi (Cross-Compiler-Specific Options): Document
	`--with-toolexeclibdir' option.

	libada/
	* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	libatomic/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libffi/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* man/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libgcc/
	* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	libgfortran/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libgomp/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libhsail-rt/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libitm/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libobjc/
	* Makefile.in (aclocal_deps): Add `toolexeclibdir.m4'.
	* aclocal.m4: Include `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	liboffloadmic/
	* plugin/configure.ac: Handle `--with-toolexeclibdir='.
	* plugin/Makefile.in: Regenerate.
	* plugin/aclocal.m4: Regenerate.
	* plugin/configure: Regenerate.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libphobos/
	* m4/druntime.m4: Handle `--with-toolexeclibdir='.
	* m4/Makefile.in: Regenerate.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libquadmath/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libsanitizer/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* asan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.in: Regenerate.

	libssp/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libstdc++-v3/
	* acinclude.m4: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++17/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libvtv/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	zlib/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
2020-01-24 11:24:25 +00:00
Jerry DeLisle e2947cfa2d PR93234 INQUIRE on pre-assigned files of ROUND and SIGN properties
PR libfortran/93234
	* io/unit.c (set_internal_unit): Set round and sign flags
	correctly.

	* gfortran.dg/inquire_pre.f90: New test.
2020-01-17 19:36:03 -08:00
Jerry DeLisle 82033483fd PR90374 Zero width format specifiers.
PR libfortran/90374
	* io/format.c (parse_format_list): Zero width not allowed with
	FMT_D.
	* io/write_float.def (build_float_string): Include range of
	higher exponent values that require wider width.
2020-01-17 11:26:10 -08:00
Jerry DeLisle 2b70275ee1 PR 90374 d0.d, e0.d, es0.d, en0.d, g0.d and ew.d edit descriptors.
PR libfortran/90274
        * io/format.c (parse_format_list): Implement the E0 exponent
        width to provide smallest possible width for exponent fields.
        Refactor code for correct parsing and better readability of the
        code.
        * io/io.h (write_real_w0): Change interface to pass in pointer
        to fnode.
        * io/transfer.c: Update all calls to write_real_w0 to use the
        new interface.
        * io/write.c ((write_real_w0): Use the new interface with fnode
        to access both the decimal precision and exponent widths used in
        build_float_string.
        * io/write_float.def (build_float_string): Use the passed in
        exponent width to calculate the used width in the case of E0.

From-SVN: r279828
2020-01-02 00:57:31 +00:00
Jakub Jelinek 8d9254fc8a Update copyright years.
From-SVN: r279813
2020-01-01 12:51:42 +01:00
Jerry DeLisle e51e2058f0 re PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors for output)
2019-12-01  Jerry DeLisle  <jvdelisle@gcc.ngu.org>

	PR fortran/90374
	* io/format.c (parse_format_list): Add braces to disambiguate
	conditional.

From-SVN: r278886
2019-12-01 22:29:43 +00:00
Jerry DeLisle 68c28e37e4 re PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors for output)
PR fortran/90374
	* io.c (check_format): Allow zero width expoenent with e0.

	* io/format.c (parse_format_list): Relax format checking to allow
	e0 exponent specifier.

	* gfortran.dg/fmt_zero_width.f90: Update test.

From-SVN: r278817
2019-11-28 18:33:20 +00:00
Jerry DeLisle 73af0c7b3a re PR libfortran/92100 (Formatted stream IO irreproducible read with binary data in file)
2019-11-24  Jerry DeLisle  <jvdelisle@gcc.ngu.org>

	PR fortran/92100
	io/transfer.c (data_transfer_init_worker): Use fbuf_reset
	instead of fbuf_flush before the seek. Note that fbuf_reset
	calls fbuf_flush and adjusts fbuf pointers.

From-SVN: r278660
2019-11-24 22:14:59 +00:00
Thomas Koenig 859174c824 Fix EOF handling for arrays.
2019-11-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Harald Anlauf <anlauf@gmx.de>

	PR fortran/92569
	* io/transfer.c (transfer_array_inner):  If position is
	at AFTER_ENDFILE in current unit, return from data loop.

2019-11-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Harald Anlauf <anlauf@gmx.de>

	PR fortran/92569
	* gfortran.dg/eof_6.f90: New test.


Co-Authored-By: Harald Anlauf <anlauf@gmx.de>

From-SVN: r278659
2019-11-24 19:16:23 +00:00
Maciej W. Rozycki 38397aa621 libgfortran: Regenerate `Makefile.in' for `runstatedir' removal
A change made with r271340 ("libfortran/90038: Use posix_spawn instead
of fork") accidentally brought the obsolete `runstatedir' setting back
in.  Fix it.

	libgfortran/
	* Makefile.in: Regenerate.

From-SVN: r278383
2019-11-18 00:21:45 +00:00
Tobias Burnus 46927ade0f PR fortran/92470 Fixes for CFI_address
libgfortran/
        PR fortran/92470
        * runtime/ISO_Fortran_binding.c (CFI_establish): Set lower_bound to 0
        also for CFI_attribute_other.

        gcc/testsuite/
        PR fortran/92470
        * gfortran.dg/ISO_Fortran_binding_1.c (establish_c): Add assert for
        lower_bound == 0.

From-SVN: r278128
2019-11-13 12:13:57 +01:00
Tobias Burnus fde7112d79 PR fortran/92470 Fixes for CFI_address
libgfortran/
        PR fortran/92470
        * runtime/ISO_Fortran_binding.c (CFI_address): Handle non-zero
        lower_bound; update error message.
        (CFI_allocate): Fix comment typo.
        (CFI_establish): Fix identation, fix typos, don't check values of 'dv'
        argument.

        gcc/testsuite/
        PR fortran/92470
        * gfortran.dg/ISO_Fortran_binding_17.c: New.
        * gfortran.dg/ISO_Fortran_binding_17.f90: New.
        * gfortran.dg/ISO_Fortran_binding_1.c (elemental_mult_c, allocate_c,
        section_c, select_part_c): Update for CFI_{address} changes;
        add asserts.

From-SVN: r278101
2019-11-12 20:33:10 +01:00
José Rui Faustino de Sousa 3f246567a4 PR fortran/92142 - CFI_setpointer corrupts descriptor
2019-11-11  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

        libgfortran/
        PR fortran/92142
        * runtime/ISO_Fortran_binding.c (CFI_setpointer): Don't
        override descriptor attribute; with -fcheck, check that
        it is a pointer.

        gcc/testsuite/
        PR fortran/92142
        * gcc/testsuite/gfortran.dg/ISO_Fortran_binding_16.c: New.
        * gcc/testsuite/gfortran.dg/ISO_Fortran_binding_16.f90: New.
        * gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.c: Correct
        upper bounds for case 0.

From-SVN: r278048
2019-11-11 11:18:14 +01:00
Jerry DeLisle 67732fbced re PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors for output)
2019-11-06  Jerry DeLisle  <jvdelisle@gcc.ngu.org>

	PR fortran/90374
	* io.c (check_format): Allow zero width for D, E, EN, and ES
	specifiers as default and when -std=F2018 is given. Retain
	existing errors when using the -fdec family of flags.

	* libgfortran/io/format.c (parse_format_list): Relax format checking for
	zero width as default and when -std=f2018.
	io/format.h (format_token): Move definition to io.h.
	io/io.h (format_token): Add definition here to allow access to
	this definition at higher levels. Rename the declaration of
	write_real_g0 to write_real_w0 and add a new format_token
	argument, allowing higher level functions to pass in the
	token for handling of g0 vs the other zero width specifiers.
	io/transfer.c (formatted_transfer_scalar_write): Add checks for
	zero width and call write_real_w0 to handle it.
	io/write.c (write_real_g0): Remove.
	(write_real_w0): Add new, same as previous write_real_g0 except
	check format token to handle the g0 case.

	* gfortran.dg/fmt_error_10.f: Modify for new constraints.
	* gfortran.dg/fmt_error_7.f: Add dg-options "-std=f95".
	* gfortran.dg/fmt_error_9.f: Modify for new constraints.
	* gfortran.dg/fmt_zero_width.f90: New test.

From-SVN: r277905
2019-11-07 03:06:20 +00:00
Tobias Burnus fc5a970817 Fortran] PR92284 – gfc_desc_to_cfi_desc fixes
gcc/fortran/
        PR fortran/92284.
        * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Free CFI descriptor
        at the end; partial revised revert of Rev. 277502.

        libgfortran/
        PR fortran/92284.
        * runtime/ISO_Fortran_binding.c (gfc_desc_to_cfi_desc):

        gcc/testsuite/
        PR fortran/92284.
        * gfortran.dg/bind-c-intent-out.f90: Update expected dump;
        extend comment.
        * gfortran.dg/bind_c_array_params_3.f90: New.
        * gfortran.dg/bind_c_array_params_3_aux.c: New.

From-SVN: r277663
2019-10-31 11:12:55 +01:00
Paul Thomas b3fbf95ec1 re PR fortran/91926 (assumed rank optional)
2019-10-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91926
	* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Revert
	the change made on 2019-10-05.

From-SVN: r277204
2019-10-19 16:44:06 +00:00
Thomas Schwinge ca72b78045 Extend 'libgfortran/runtime/minimal.c' per r274599 "PR fortran/68401 Improve allocation error message"
libgfortran/
	PR fortran/68401
	* runtime/minimal.c (os_error_at): New function.

From-SVN: r276691
2019-10-08 12:20:41 +02:00
Thomas Schwinge 41bc80c3cd Revise 'libgfortran/runtime/minimal.c' to better conform to the original sources
libgfortran/
	* runtime/minimal.c: Revise.

From-SVN: r276690
2019-10-08 12:20:31 +02:00
Paul Thomas 980f185ce3 re PR fortran/91926 (assumed rank optional)
2019-10-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91926
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Correct the
	assignment of the attribute field to account correctly for an
	assumed shape dummy. Assign separately to the gfc and cfi
	descriptors since the atribute can be different. Add btanch to
	correctly handle missing optional dummies.

2019-10-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91926
	* gfortran.dg/ISO_Fortran_binding_13.f90 : New test.
	* gfortran.dg/ISO_Fortran_binding_13.c : Additional source.
	* gfortran.dg/ISO_Fortran_binding_14.f90 : New test.

2019-10-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91926
	* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Do not
	modify the bounds and offset for CFI_other.

From-SVN: r276624
2019-10-05 08:17:55 +00:00
Jerry DeLisle a4626a7b3e re PR libfortran/91593 (Implicit enum conversions in libgfortran/io/transfer.c)
2019-10-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/91593
	* io/read.c (read_decimal): Cast constant to size_t to turn off
	a bogus warning.
	* io/write.c (btoa_big): Use memset in lieu of setting the null
	byte in a string buffer to turn off a bogus warning.

From-SVN: r276439
2019-10-02 02:35:14 +00:00
Jerry DeLisle 60674b3f8a re PR libfortran/91593 (Implicit enum conversions in libgfortran/io/transfer.c)
2019-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/91593
	* io/io.h: Add gcc_unreachable().
	* io/transfer.c (file_mode, current_mode,
	formatted_transfer_scalar_read, formatted_transfer_scalar_write,
	pre_position, next_record_r, next_record_w): Add and use
	FORMATTED_UNSPECIFIED to enumeration.

From-SVN: r276255
2019-09-28 19:14:47 +00:00
Maciej W. Rozycki e9085da528 Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update
A change made with r275564 ("[ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle 
arm*-*-uclinuxfdpiceabi in configure scripts") to libtool.m4 has not 
regenerated all the `configure' scripts affected.  Fix it.

	gcc/
	* configure: Regenerate.

	libatomic/
	* configure: Regenerate.

	libbacktrace/
	* configure: Regenerate.

	libcc1/
	* configure: Regenerate.

	libffi/
	* configure: Regenerate.

	libgfortran/
	* configure: Regenerate.

	libgomp/
	* configure: Regenerate.

	libhsail-rt/
	* configure: Regenerate.

	libitm/
	* configure: Regenerate.

	libobjc/
	* configure: Regenerate.

	liboffloadmic/
	* 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.

From-SVN: r276213
2019-09-27 21:24:42 +00:00
Janne Blomqvist 0eaee4abb1 Improve PRNG jumping when using threads
Currently, when a new thread needs to use the RANDOM_NUMBER intrinsic,
the per-thread PRNG state is initialized by copying the master state
and then jumping forwards N*2**128 entries in the stream so that the
PRNG streams for different threads don't alias each other, where N is
the number of threads that have so far initialized the PRNG.

With this patch the master state itself is jumped forwards once each
time a new thread initializes the PRNG, thus obviating the need to
jump through all the N-1 previous streams. Effectively turning an O(N)
algorithm into an O(1) one.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2019-09-05  Janne Blomqvist  <jb@gcc.gnu.org>

	* intrinsics/random.c (master_init): Replace with
	master_state.init.
	(njumps): Remove variable.
	(master_state): Make instance of struct prng_state.
	(init_rand_state): When jumping, update the master_state once
	instead of keeping track of how many jumps need to be done.
	(SZU64): Modify to handle new master_state.
	(SZ): Likewise.
	(random_seed_i4): Likewise.
	(random_seed_i8): Likewise.

From-SVN: r275397
2019-09-05 09:59:55 +03:00
Janne Blomqvist d74a8b0579 PR fortran/68401 Improve allocation error message
Improve the error message that is printed when a memory allocation
fails, by including the location, and the size of the allocation that
failed.

Regtested on x86_64-pc-linux-gnu.

gcc/fortran/ChangeLog:

2019-08-17  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/68401
	* trans-decl.c (gfc_build_builtin_function_decls): Replace
	os_error with os_error_at decl.
	* trans.c (trans_runtime_error_vararg): Modify so the error
	function decl is passed directly.
	(gfc_trans_runtime_error): Pass correct error function decl.
	(gfc_trans_runtime_check): Likewise.
	(trans_os_error_at): New function.
	(gfc_call_malloc): Use trans_os_error_at.
	(gfc_allocate_using_malloc): Likewise.
	(gfc_call_realloc): Likewise.
	* trans.h (gfor_fndecl_os_error): Replace with gfor_fndecl_os_error_at.

libgfortran/ChangeLog:

2019-08-17  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/68401
	* gfortran.map: Add GFORTRAN_10 node, add _gfortran_os_error_at
	symbol.
	* libgfortran.h (os_error_at): New prototype.
	* runtime/error.c (os_error_at): New function.

From-SVN: r274599
2019-08-17 08:45:37 +03:00
Janne Blomqvist f77d27597d PR fortran/91414 Bugfix for previous commit
Correctly fill master_seed from os_seed.

From-SVN: r274365
2019-08-13 12:04:18 +03:00
Janne Blomqvist 0e99e09339 PR fortran/91414: Improved PRNG
Update the PRNG from xorshift1024* to xoshiro256** by the same
author. For details see

http://prng.di.unimi.it/

and the paper at

https://arxiv.org/abs/1805.01407

Also the seeding is slightly improved, by reading only 8 bytes from
the operating system and using the simple splitmix64 PRNG to fill in
the rest of the PRNG state (as recommended by the xoshiro author),
instead of reading the entire state from the OS.

Regtested on x86_64-pc-linux-gnu, Ok for trunk?

gcc/fortran/ChangeLog:

2019-08-13  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/91414
	* check.c (gfc_check_random_seed): Reduce seed_size.
	* intrinsic.texi (RANDOM_NUMBER): Update to match new PRNG.

gcc/testsuite/ChangeLog:

2019-08-13  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/91414
	* gfortran.dg/random_seed_1.f90: Update to match new seed size.

libgfortran/ChangeLog:

2019-08-13  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/91414
	* intrinsics/random.c (prng_state): Update state struct.
	(master_state): Update to match new size.
	(get_rand_state): Update to match new PRNG.
	(rotl): New function.
	(xorshift1024star): Replace with prng_next.
	(prng_next): New function.
	(jump): Update for new PRNG.
	(lcg_parkmiller): Replace with splitmix64.
	(splitmix64): New function.
	(getosrandom): Fix return value, simplify.
	(init_rand_state): Use getosrandom only to get 8 bytes, splitmix64
	to fill rest of state.
	(random_r4): Update to new function and struct names.
	(random_r8): Likewise.
	(random_r10): Likewise.
	(random_r16): Likewise.
	(arandom_r4): Liekwise.
	(arandom_r8): Likewise.
	(arandom_r10): Likwewise.
	(arandom_r16): Likewise.
	(xor_keys): Reduce size to match new PRNG.
	(random_seed_i4): Update to new function and struct names, remove
	special handling of variable p used in previous PRNG.
	(random_seed_i8): Likewise.

From-SVN: r274361
2019-08-13 11:24:43 +03:00
Janne Blomqvist 4047bab96d PR 53796 Make inquire(file=, recl=) conform to F2018
In my original patch to fix PR 53796 I forgot to fix the behavior for
unconnected units when inquiring via filename. This patch fixes that.

Regtested on x86_64-pc-linux-gnu, committed as obvious.

libgfortran/ChangeLog:

2019-08-07  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/53796
	* io/inquire.c (inquire_via_filename): Set recl to -1 for
	unconnected units.

gcc/testsuite/ChangeLog:

2019-08-07  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/53796
	* gfortran.dg/inquire_recl_f2018.f90: Test for unconnected unit
	with inquire via filename.

From-SVN: r274160
2019-08-07 10:34:10 +03:00
Thomas Koenig c37b0163fe re PR libfortran/91030 (Poor performance of I/O -fconvert=big-endian)
2019-07-21  Thomas König  <tkoenig@gcc.gnu.org>

	PR libfortran/91030
	* gfortran.texi (GFORTRAN_FORMATTED_BUFFER_SIZE): Document
	(GFORTRAN_UNFORMATTED_BUFFER_SIZE): Likewise.

2019-07-21  Thomas König  <tkoenig@gcc.gnu.org>

	PR libfortran/91030
	* io/unix.c (BUFFER_SIZE): Delete.
	(BUFFER_FORMATTED_SIZE_DEFAULT): New variable.
	(BUFFER_UNFORMATTED_SIZE_DEFAULT): New variable.
	(unix_stream): Add buffer_size.
	(buf_read): Use s->buffer_size instead of BUFFER_SIZE.
	(buf_write): Likewise.
	(buf_init): Add argument unformatted.  Handle block sizes
	for unformatted vs. formatted, using defaults if provided.
	(fd_to_stream): Add argument unformatted in call to buf_init.
	* libgfortran.h (options_t): Add buffer_size_formatted and
	buffer_size_unformatted.
	* runtime/environ.c (variable_table): Add
	GFORTRAN_UNFORMATTED_BUFFER_SIZE and
	GFORTRAN_FORMATTED_BUFFER_SIZE.

From-SVN: r273643
2019-07-21 15:55:49 +00:00
Kwok Cheung Yeung b1e86e33a2 Enable full GFortran library for AMD GCN
2019-06-25  Kwok Cheung Yeung  <kcy@codesourcery.com>
            Andrew Stubbs  <ams@codesourcery.com>

	libgfortran/
	* configure: Regenerate.
	* configure.ac (LIBGFOR_MINIMAL): Do not use on AMD GCN.

Co-Authored-By: Andrew Stubbs <ams@codesourcery.com>

From-SVN: r272649
2019-06-25 11:41:38 +00:00
Janne Blomqvist 6bd4871707 libfortran/65921: Add forgotten PR number to ChangeLog
2019-06-14  Janne Blomqvist  <jb@gcc.gnu.org>

        PR fortran/65921
        * runtime/memory.c (SIZE_MAX):Remove macro definition.
        (xmallocarray): Use __builtin_mul_overflow.

From-SVN: r272520
2019-06-20 23:26:39 +03:00
Janne Blomqvist 84d38abbc9 Use __builtin_mul_overflow in xmallocarray
As GCC now provides builtins for doing integer overflow checking, lets
use it when checking for overflow in xmallocarray.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2019-06-14  Janne Blomqvist  <jb@gcc.gnu.org>

	* runtime/memory.c (SIZE_MAX):Remove macro definition.
	(xmallocarray): Use __builtin_mul_overflow.

From-SVN: r272295
2019-06-14 19:05:54 +03:00
Janne Blomqvist 88a8126a90 fortran/89100: Default widths with -fdec-format-defaults
gcc/fortran ChangeLog:

2019-05-22  Jeff Law  <law@redhat.com>
            Mark Eggleston  <mark.eggleston@codethink.com>

        PR fortran/89100
        * gfortran.texi: Add Default widths for F, G and I format
        descriptors to Extensions section.
        * invoke.texi: Add -fdec-format-defaults
        * io.c (check_format): Use default widths for i, f and g when
        flag_dec_format_defaults is enabled.
        * lang.opt: Add new option.
        * options.c (set_dec_flags): Add SET_BITFLAG for
        flag_dec_format_defaults.


gcc/testsuite ChangeLog:

2019-05-22  Mark Eggleston  <mark.eggleston@codethink.com>

        PR fortran/89100
        * gfortran.dg/fmt_f_default_field_width_1.f90: New test.
        * gfortran.dg/fmt_f_default_field_width_2.f90: New test.
        * gfortran.dg/fmt_f_default_field_width_3.f90: New test.
        * gfortran.dg/fmt_g_default_field_width_1.f90: New test.
        * gfortran.dg/fmt_g_default_field_width_2.f90: New test.
        * gfortran.dg/fmt_g_default_field_width_3.f90: New test.
        * gfortran.dg/fmt_i_default_field_width_1.f90: New test.
        * gfortran.dg/fmt_i_default_field_width_2.f90: New test.
        * gfortran.dg/fmt_i_default_field_width_3.f90: New test.


libgfortran ChangeLog:

2019-05-22  Jeff Law  <law@redhat.com>

        PR fortran/89100
        * io/format.c (parse_format_list): set default width when the
        IOPARM_DT_DEC_EXT flag is set for i, f and g.
        * io/io.h: add default_width_for_integer, default_width_for_float
        and default_precision_for_float.
        * io/write.c (write_boz): extra parameter giving length of data
        corresponding to the type's kind.
        (write_b): pass data length as extra parameter in calls to
        write_boz.
        (write_o): pass data length as extra parameter in calls to
        write_boz.
        (write_z): pass data length as extra parameter in calls to
        write_boz.
        (size_from_kind): also set size is default width is set.
        * io/write_float.def (build_float_string): new paramter inserted
        before result parameter. If default width use values passed
        instead of the values in fnode.
        (FORMAT_FLOAT): macro modified to check for default width and
        calls to build_float_string to pass in default width.
        (get_float_string): set width and precision to defaults when
        needed.

From-SVN: r271511
2019-05-22 14:56:01 +03:00
Janne Blomqvist ef536b413e libfortran/90038 Reap dead children when wait=.false.
When using posix_spawn or fork to launch a child process, the parent
needs to wait for the child, otherwise the dead child is left as a
zombie process. For this purpose one can install a signal handler for
SIGCHLD.

2019-05-19  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/90038
	* intrinsics/execute_command_line (sigchld_handler): New function.
        (execute_command_line): Install handler for SIGCHLD.
        * configure.ac: Check for presence of sigaction and waitpid.
        * config.h.in: Regenerated.
        * configure: Regenerated.

Regtested on x86_64-pc-linux-gnu.

From-SVN: r271384
2019-05-19 22:38:11 +03:00
Janne Blomqvist f888603842 libfortran/90038: Use posix_spawn instead of fork
fork() semantics can be problematic.  Most unix style OS'es have
posix_spawn which can be used to replace fork + exec in many cases.
For more information see
e.g. https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf
    
This replaces the one use of fork in libgfortran with posix_spawn.
    
2019-05-17  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/90038
        * configure.ac (AC_CHECK_FUNCS_ONCE): Check for posix_spawn.
        * intrinsics/execute_command_line (execute_command_line): Use
        posix_spawn.
        * Makefile.in: Regenerated.
        * config.h.in: Regenerated.
        * configure: Regenerated.
    
Regtested on x86_64-pc-linux-gnu.

From-SVN: r271340
2019-05-17 21:18:04 +03:00
Jakub Jelinek 6df6f67a28 re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=)
PR fortran/54613
	* gfortran.map (GFORTRAN_9.2): Export _gfortran_{,m,s}findloc{0,1}_r10.
	* Makefile.am (i_findloc0_c): Add $(srcdir)/generated/findloc0_r10.c.
	(i_findloc1_c): Add $(srcdir)/generated/findloc1_r10.c.
	* Makefile.in: Regenerated.
	* generated/findloc0_r10.c: Generated.
	* generated/findloc1_r10.c: Generated.

From-SVN: r271336
2019-05-17 19:50:55 +02:00
Jakub Jelinek 9f65885a93 re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=)
PR fortran/54613
	* gfortran.map (GFORTRAN_9.2): Export _gfortran_{,m,s}findloc{0,1}_r10.
	* Makefile.am (i_findloc0_c): Add $(srcdir)/generated/findloc0_r10.c.
	(i_findloc1_c): Add $(srcdir)/generated/findloc1_r10.c.
	* Makefile.in: Regenerated.
	* generated/findloc0_r10.c: Generated.
	* generated/findloc1_r10.c: Generated.

From-SVN: r271335
2019-05-17 19:24:27 +02:00
Jakub Jelinek d315183222 re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=)
PR fortran/54613
	* gfortran.map (GFORTRAN_9.2): New symbol version, export
	_gfortran_{,m,s}findloc0_i2 in it.

From-SVN: r271334
2019-05-17 19:23:30 +02:00
Janne Blomqvist 0c15ebf1bd Allow opening file on multiple units
As of Fortran 2018 it's allowed to open the same file on multiple
units.

libgfortran/ChangeLog:

2019-05-15  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/90461
        * io/open.c (new_unit): Don't check if the file is already open
	for F2018.

testsuite/ChangeLog:

2019-05-15  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/90461
        * gfortran.dg/open_errors_2.f90: Add -std=f2008, adjust line number.
	* gfortran.dg/open_errors_3.f90: New test.

From-SVN: r271260
2019-05-15 21:02:36 +03:00
Jakub Jelinek 5cf393b236 Makefile.am (gfor_cdir): Remove $(MULTISUBDIR).
* Makefile.am (gfor_cdir): Remove $(MULTISUBDIR).
	* Makefile.in: Regenerated.

From-SVN: r270793
2019-05-02 15:02:27 +02:00
Paul Thomas 0d78e4aa06 re PR fortran/89843 (CFI_section delivers incorrect result descriptor)
2019-04-14  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/89843
	* trans-decl.c (gfc_get_symbol_decl): Assumed shape and assumed
	rank dummies of bind C procs require deferred initialization.
	(convert_CFI_desc): New procedure to convert incoming CFI
	descriptors to gfc types and back again.
	(gfc_trans_deferred_vars): Call it.
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Null the CFI
	descriptor pointer. Free the descriptor in all cases.

	PR fortran/89846
	* expr.c (is_CFI_desc): New function.
	(is_subref_array): Tidy up by referencing the symbol directly.
	* gfortran.h : Prototype for is_CFI_desc.
	* trans_array.c (get_CFI_desc): New function.
	(gfc_get_array_span, gfc_conv_scalarized_array_ref,
	gfc_conv_array_ref): Use it.
	* trans.c (get_array_span): Extract the span from descriptors
	that are indirect references.

	PR fortran/90022
	* trans-decl.c (gfc_get_symbol_decl): Make sure that the se
	expression is a pointer type before converting it to the symbol
	backend_decl type.
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Eliminate
	temporary creation for intent(in).

2019-04-14  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/89843
	* gfortran.dg/ISO_Fortran_binding_4.f90: Modify the value of x
	in ctg. Test the conversion of the descriptor types in the main
	program.
	* gfortran.dg/ISO_Fortran_binding_10.f90: New test.
	* gfortran.dg/ISO_Fortran_binding_10.c: Called by it.

	PR fortran/89846
	* gfortran.dg/ISO_Fortran_binding_11.f90: New test.
	* gfortran.dg/ISO_Fortran_binding_11.c: Called by it.

	PR fortran/90022
	* gfortran.dg/ISO_Fortran_binding_1.c: Correct the indexing for
	the computation of 'ans'. Also, change the expected results for
	CFI_is_contiguous to comply with standard.
	* gfortran.dg/ISO_Fortran_binding_1.f90: Correct the expected
	results for CFI_is_contiguous to comply with standard.
	* gfortran.dg/ISO_Fortran_binding_9.f90: New test.
	* gfortran.dg/ISO_Fortran_binding_9.c: Called by it.

2019-04-14  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/89843
	* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Only
	return immediately if the source pointer is null. Bring
	forward the extraction of the gfc type. Extract the kind so
	that the element size can be correctly computed for sections
	and components of derived type arrays. Remove the free of the
	CFI descriptor since this is now done in trans-expr.c.
	(gfc_desc_to_cfi_desc): Only allocate the CFI descriptor if it
	is not null.
	(CFI_section): Normalise the difference between the upper and
	lower bounds by the stride to correctly calculate the extents
	of the section.

	PR fortran/89846
	* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Use
	the stride measure for the gfc span if it is not a multiple
	of the element length. Otherwise use the element length.

	PR fortran/90022
	* runtime/ISO_Fortran_binding.c (CFI_is_contiguous) : Return
	1 for true and 0 otherwise to comply with the standard. Correct
	the contiguity check for rank 3 and greater by using the stride
	measure of the lower dimension rather than the element length.

From-SVN: r270353
2019-04-14 18:14:58 +00:00
John David Anglin b7ca376ae9 re PR libfortran/79540 (FAIL: gfortran.dg/fmt_fw_d.f90 -O0 execution test)
PR libgfortran/79540
	* io/write_float.def (build_float_string): Don't copy digits when
	ndigits is negative.

From-SVN: r269911
2019-03-25 11:48:36 +00:00
Jakub Jelinek 934e992600 re PR libfortran/89593 (warning "passing argument 3 of ‘_gfortran_caf_{get,send}_by_ref’ from incompatible pointer type" when building libgfortran)
PR libgfortran/89593
	* caf/single.c (_gfortran_caf_sendget_by_ref): Cast &temp to
	gfc_descriptor_t * to avoid warning.

From-SVN: r269405
2019-03-05 23:41:39 +01:00
Uros Bizjak 140a0bddcc transfer.c (transfer_array_inner): Do not cast charlen to index_type.
* io/transfer.c (transfer_array_inner): Do not
	cast charlen to index_type.

From-SVN: r269224
2019-02-26 19:41:53 +01:00
Dominique d'Humieres b8f412849b re PR libfortran/89274 (Inconsistent list directed output of INTEGER(16))
2019-02-25  Dominique d'Humieres  <dominiq@gcc.gnu.org>

	PR libfortran/89274
	* gfortran.dg/list_directed_large.f90: New test. 

2019-02-25  Dominique d'Humieres  <dominiq@gcc.gnu.org>

	PR libfortran/89274
	* io/write.c (write_integer): Add width for INTEGER(16).

From-SVN: r269187
2019-02-25 11:39:38 +01:00
Paul Thomas c280838969 re PR fortran/89385 (Incorrect members of C descriptor for an allocatable object)
2019-02-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/89385
	PR fortran/89366
	* decl.c (gfc_verify_c_interop_param): Restriction on string
	length being one is lifted for F2018.
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): For scalar
	characters with intent in, make a temporary and copy the result
	of the expression evaluation into it.
	(gfc_conv_procedure_call): Set a flag for character formal args
	having a character length that is not unity. If the procedure
	is bind C, call gfc_conv_gfc_desc_to_cfi_desc in this case.
	Also, extend bind C calls to unconditionally convert both
	pointers and allocatable expressions.

2019-02-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/89385
	* gfortran.dg/ISO_Fortran_binding_1.f90 : Correct test for
	previously incorrect lbound for allocatable expressions. Also
	correct stop values to avoid repetition.
	* gfortran.dg/ISO_Fortran_binding_5.f90 : New test
	* gfortran.dg/ISO_Fortran_binding_5.c : Support previous test.

	PR fortran/89366
	* gfortran.dg/ISO_Fortran_binding_6.f90 : New test
	* gfortran.dg/ISO_Fortran_binding_6.c : Support previous test.
	* gfortran.dg/pr32599.f03 : Set standard to F2008.

2019-02-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/89385
	PR fortran/89366
	* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc) : In the
	interchange between character and derived, the character type
	was being set incorrectly.
	(gfc_desc_to_cfi_desc) : Eliminate the interchange of types in
	this function. Do not add the kind and length information to
	the type field of structures. Lbounds were incorrectly being
	set to zero for allocatable and pointer descriptors. Should
	have been non-pointer, non-allocatables that received this
	treatment.

From-SVN: r269156
2019-02-23 12:18:44 +00:00
Uros Bizjak 8d169fc1b1 * libgfortran/ChangeLog: Better commit message for my last commit.
From-SVN: r268433
2019-01-31 23:59:36 +01:00
Uros Bizjak 05dfdd6c5a re PR fortran/88678 (Many gfortran.dg/ieee/ieee_X.f90 test cases fail starting with r267465)
PR fortran/88678
	* config/fpu-glibc.h (support_fpu_trap): Do not try to enable
	exceptions to determine if exception is supported.

From-SVN: r268402
2019-01-30 21:44:35 +01:00
Uros Bizjak de0c04f99c re PR fortran/88678 (Many gfortran.dg/ieee/ieee_X.f90 test cases fail starting with r267465)
PR fortran/88678
	* config/fpu-glibc.h (set_fpu_trap_exceptions): Clear stalled
	exception flags before changing trap mode.  Optimize to call
	feenableexcept and fedisableexcept only once.

From-SVN: r268392
2019-01-30 16:04:06 +01:00
Sebastian Huber 92ab6b83cd libgfortran: Use proper gthr.h API
libgfortran/

	* io/async.c (init_adv_cond): Use __GTHREAD_COND_INIT_FUNCTION().

From-SVN: r268331
2019-01-28 06:35:41 +00:00
Jerry DeLisle 9faf6e7018 re PR libfortran/89020 (close(status='DELETE') does not remove file)
2019-01-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/89020
	* io/close.c (st_close): Simplify text of error message to not
	presume a specific cause of failure to remove file.

From-SVN: r268319
2019-01-27 19:42:34 +00:00
Jerry DeLisle 2ee43ae6d6 re PR libfortran/89020 (close(status='DELETE') does not remove file)
2019-01-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/89020
	* io/close.c (st_close): Fix typo.

From-SVN: r268309
2019-01-27 01:36:40 +00:00
Jerry DeLisle fac29445ac Fix bug number referenced in previous commit.
From-SVN: r268302
2019-01-26 20:39:33 +00:00
Jerry DeLisle 0e34715e97 re PR libfortran/89020 (close(status='DELETE') does not remove file)
2019-01-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/88020
	* io/close.c (st_close): Generate error if calls to 'remove' return
	an error.

From-SVN: r268301
2019-01-26 20:27:16 +00:00
Andrew Stubbs 5ab99fa41c GCN libgfortran.
This patch contains the GCN port of libgfortran.  We use the minimal
configuration created for NVPTX.  That's all that's required, besides the
target-independent bug fixes posted already.

2019-01-17  Andrew Stubbs  <ams@codesourcery.com>
	    Kwok Cheung Yeung  <kcy@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>
	    Tom de Vries  <tom@codesourcery.com>

	libgfortran/
	* configure.ac: Use minimal mode for amdgcn.
	* configure: Regenerate.


Co-Authored-By: Julian Brown <julian@codesourcery.com>
Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com>
Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r268020
2019-01-17 12:27:46 +00:00
Jerry DeLisle 9c5f89006f re PR libfortran/88776 (Namelist read from stdin: loss of data)
2019-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/88776
	* io/open.c (newunit): Free format buffer if the unit specified is for
	stdin, stdout, or stderr.

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

From-SVN: r267910
2019-01-14 00:22:00 +00:00
Jerry DeLisle 9443a1859f re PR libfortran/88776 (Namelist read from stdin: loss of data)
2019-01-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/88776
	* io/list_read.c (namelist_read): Use nml_err_ret path on read error
	not based on stdin_unit.

From-SVN: r267898
2019-01-12 23:06:47 +00:00
Paul Thomas bbf18dc5d2 gfortran.texi: Add description in sections on TS 29113 and further interoperability with C.
2019-01-12  Paul Thomas  <pault@gcc.gnu.org>

	* gfortran.texi : Add description in sections on TS 29113 and
	further interoperability with C.
	* trans-array.c (gfc_conv_descriptor_attribute): New function.
	(gfc_get_dataptr_offset): Remove static function attribute.
	* trans-array.h : Add prototypes for above functions.
	* trans-decl.c : Add declarations for the library functions
	cfi_desc_to_gfc_desc and gfc_desc_to_cfi_desc.
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): New function.
	(gfc_conv_procedure_call): Call it for scalar and array actual
	arguments, when the formal arguments are bind_c with assumed
	shape or assumed rank.
	* trans.h : External declarations for gfor_fndecl_cfi_to_gfc
	and gfor_fndecl_gfc_to_cfi.

2019-01-12  Paul Thomas  <pault@gcc.gnu.org>

	* gfortran.dg/ISO_Fortran_binding_1.f90 : New test.
	* gfortran.dg/ISO_Fortran_binding_1.c : Auxilliary file for test.
	* gfortran.dg/ISO_Fortran_binding_2.f90 : New test.
	* gfortran.dg/ISO_Fortran_binding_2.c : Auxilliary file for test.
	* gfortran.dg/bind_c_array_params_2.f90 : Change search string
	for dump tree scan.

2019-01-12  Paul Thomas  <pault@gcc.gnu.org>

	* ISO_Fortran_binding.h : New file.
	* Makefile.am : Include ISO_Fortran_binding.c in the list of
	files to compile.
	* Makefile.in : Regenerated.
	* gfortran.map : Add _gfortran_cfi_desc_to_gfc_desc,
	_gfortran_gfc_desc_to_cfi_desc and the CFI API functions.
	* runtime/ISO_Fortran_binding.c : New file containing the new
	functions added to the map.

From-SVN: r267881
2019-01-12 15:25:52 +00:00
Jakub Jelinek fc560ecd49 re PR libfortran/88807 (misleading indentation warnings building libgfortran)
PR libfortran/88807
	* m4/minloc0.m4: Reindent to avoid -Wmisleading-indentation warnings.
	* generated/minloc0_4_i1.c: Regenerated.
	* generated/minloc0_4_i2.c: Regenerated.
	* generated/minloc0_4_i4.c: Regenerated.
	* generated/minloc0_4_i8.c: Regenerated.
	* generated/minloc0_4_i16.c: Regenerated.
	* generated/minloc0_4_r4.c: Regenerated.
	* generated/minloc0_4_r8.c: Regenerated.
	* generated/minloc0_4_r10.c: Regenerated.
	* generated/minloc0_4_r16.c: Regenerated.
	* generated/minloc0_8_i1.c: Regenerated.
	* generated/minloc0_8_i2.c: Regenerated.
	* generated/minloc0_8_i4.c: Regenerated.
	* generated/minloc0_8_i8.c: Regenerated.
	* generated/minloc0_8_i16.c: Regenerated.
	* generated/minloc0_8_r4.c: Regenerated.
	* generated/minloc0_8_r8.c: Regenerated.
	* generated/minloc0_8_r10.c: Regenerated.
	* generated/minloc0_8_r16.c: Regenerated.
	* generated/minloc0_16_i1.c: Regenerated.
	* generated/minloc0_16_i2.c: Regenerated.
	* generated/minloc0_16_i4.c: Regenerated.
	* generated/minloc0_16_i8.c: Regenerated.
	* generated/minloc0_16_i16.c: Regenerated.
	* generated/minloc0_16_r4.c: Regenerated.
	* generated/minloc0_16_r8.c: Regenerated.
	* generated/minloc0_16_r10.c: Regenerated.
	* generated/minloc0_16_r16.c: Regenerated.

From-SVN: r267875
2019-01-12 10:15:54 +01:00
Sandra Loosemore 6791469314 PR other/16615 [1/5]
2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>

	PR other/16615 [1/5]

	contrib/
	* mklog: Mechanically replace "can not" with "cannot".

	gcc/
	* Makefile.in: Mechanically replace "can not" with "cannot".
	* alias.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* common/config/i386/i386-common.c: Likewise.
	* config/aarch64/aarch64.c: Likewise.
	* config/alpha/sync.md: Likewise.
	* config/arc/arc.c: Likewise.
	* config/arc/predicates.md: Likewise.
	* config/arm/arm-c.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/arm.h: Likewise.
	* config/arm/arm.md: Likewise.
	* config/arm/cortex-r4f.md: Likewise.
	* config/csky/csky.c: Likewise.
	* config/csky/csky.h: Likewise.
	* config/darwin-f.c: Likewise.
	* config/epiphany/epiphany.md: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/sol2.h: Likewise.
	* config/m68k/m68k.c: Likewise.
	* config/mcore/mcore.h: Likewise.
	* config/microblaze/microblaze.md: Likewise.
	* config/mips/20kc.md: Likewise.
	* config/mips/sb1.md: Likewise.
	* config/nds32/nds32.c: Likewise.
	* config/nds32/predicates.md: Likewise.
	* config/pa/pa.c: Likewise.
	* config/rs6000/e300c2c3.md: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/s390/s390.h: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/sh.md: Likewise.
	* config/spu/vmx2spu.h: Likewise.
	* cprop.c: Likewise.
	* dbxout.c: Likewise.
	* df-scan.c: Likewise.
	* doc/cfg.texi: Likewise.
	* doc/extend.texi: Likewise.
	* doc/fragments.texi: Likewise.
	* doc/gty.texi: Likewise.
	* doc/invoke.texi: Likewise.
	* doc/lto.texi: Likewise.
	* doc/md.texi: Likewise.
	* doc/objc.texi: Likewise.
	* doc/rtl.texi: Likewise.
	* doc/tm.texi: Likewise.
	* dse.c: Likewise.
	* emit-rtl.c: Likewise.
	* emit-rtl.h: Likewise.
	* except.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* genautomata.c: Likewise.
	* gimple-fold.c: Likewise.
	* hard-reg-set.h: Likewise.
	* ifcvt.c: Likewise.
	* ipa-comdats.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-fnsummary.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-visibility.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-int.h: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* ira.h: Likewise.
	* loop-invariant.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-assigns.c: Likewise.
	* lra-constraints.c: Likewise.
	* lra-eliminations.c: Likewise.
	* lra-lives.c: Likewise.
	* lra-remat.c: Likewise.
	* lra-spills.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* postreload-gcse.c: Likewise.
	* predict.c: Likewise.
	* profile-count.h: Likewise.
	* profile.c: Likewise.
	* recog.c: Likewise.
	* ree.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl.def: Likewise.
	* rtl.h: Likewise.
	* rtlanal.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched.c: Likewise.
	* shrink-wrap.c: Likewise.
	* simplify-rtx.c: Likewise.
	* symtab.c: Likewise.
	* target.def: Likewise.
	* toplev.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-core.h: Likewise.
	* tree-eh.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-phionlycprop.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* vr-values.c: Likewise.

	gcc/ada/
	* exp_ch9.adb: Mechanically replace "can not" with "cannot".
	* libgnat/s-regpat.ads: Likewise.
	* par-ch4.adb: Likewise.
	* set_targ.adb: Likewise.
	* types.ads: Likewise.

	gcc/cp/
	* cp-tree.h: Mechanically replace "can not" with "cannot".
	* parser.c: Likewise.
	* pt.c: Likewise.

	gcc/fortran/
	* class.c: Mechanically replace "can not" with "cannot".
	* decl.c: Likewise.
	* expr.c: Likewise.
	* gfc-internals.texi: Likewise.
	* intrinsic.texi: Likewise.
	* invoke.texi: Likewise.
	* io.c: Likewise.
	* match.c: Likewise.
	* parse.c: Likewise.
	* primary.c: Likewise.
	* resolve.c: Likewise.
	* symbol.c: Likewise.
	* trans-array.c: Likewise.
	* trans-decl.c: Likewise.
	* trans-intrinsic.c: Likewise.
	* trans-stmt.c: Likewise.

	gcc/go/
	* go-backend.c: Mechanically replace "can not" with "cannot".
	* go-gcc.cc: Likewise.

	gcc/lto/
	* lto-partition.c: Mechanically replace "can not" with "cannot".
	* lto-symtab.c: Likewise.
	* lto.c: Likewise.

	gcc/objc/
	* objc-act.c: Mechanically replace "can not" with "cannot".

	libbacktrace/
	* backtrace.h: Mechanically replace "can not" with "cannot".

	libgcc/
	* config/c6x/libunwind.S: Mechanically replace "can not" with
	"cannot".
	* config/tilepro/atomic.h: Likewise.
	* config/vxlib-tls.c: Likewise.
	* generic-morestack-thread.c: Likewise.
	* generic-morestack.c: Likewise.
	* mkmap-symver.awk: Likewise.

	libgfortran/
	* caf/single.c: Mechanically replace "can not" with "cannot".
	* io/unit.c: Likewise.

	libobjc/
	* class.c: Mechanically replace "can not" with "cannot".
	* objc/runtime.h: Likewise.
	* sendmsg.c: Likewise.

	liboffloadmic/
	* include/coi/common/COIResult_common.h: Mechanically replace
	"can not" with "cannot".
	* include/coi/source/COIBuffer_source.h: Likewise.

	libstdc++-v3/
	* include/ext/bitmap_allocator.h: Mechanically replace "can not"
	with "cannot".

From-SVN: r267783
2019-01-09 16:37:45 -05:00
Thomas Koenig 419af57c13 re PR fortran/45424 ([F08] Add IS_CONTIGUOUS intrinsic)
2019-01-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Harald Anlauf <anlauf@gmx.de>
	Tobias Burnus <burnus@gcc.gnu.org>

	PR fortran/45424
	* check.c (gfc_check_is_contiguous): New function.
	* expr.c (gfc_is_not_contiguous): New function.
	* gfortran.h (gfc_isym_id): Add GFC_ISYM_IS_CONTIGUOUS.
	Add prototype for gfc_is_not_contiguous.
	* intrinsic.c (do_ts29113_check): Add GFC_ISYM_IS_CONTIGUOUS.
	(add_function): Add is_contiguous.
	* intrinsic.h: Add prototypes for gfc_check_is_contiguous,
	gfc_simplify_is_contiguous and gfc_resolve_is_contiguous.
	* intrinsic.texi: Add IS_CONTIGUOUS.
	* iresolve.c (gfc_resolve_is_contiguous): New function.
	* simplify.c (gfc_simplify_is_contiguous): New function.
	* trans-decl.c (gfor_fncecl_is_contiguous0): New variable.
	(gfc_build_intrinsic_function_decl): Add it.
	* trans-intrinsic.c (gfc_conv_intrinsic_is_contiguous): New
	function.
	(gfc_conv_intrinsic_function): Handle GFC_ISYM_IS_CONTIGUOUS.

2019-01-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Harald Anlauf <anlauf@gmx.de>
	Tobias Burnus <burnus@gcc.gnu.org>

	PR fortran/45424
	* Makefile.am: Add intrinsics/is_contiguous.c.
	* Makefile.in: Regenerated.
	* gfortran.map: Add _gfortran_is_contiguous0.
	* intrinsics/is_contiguous.c: New file.
	* libgfortran.h: Add prototype for is_contiguous0.

2019-01-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Harald Anlauf <anlauf@gmx.de>
	Tobias Burnus <burnus@gcc.gnu.org>

	* gfortran.dg/is_contiguous_1.f90: New test.
	* gfortran.dg/is_contiguous_2.f90: New test.
	* gfortran.dg/is_contiguous_3.f90: New test.


Co-Authored-By: Harald Anlauf <anlauf@gmx.de>
Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org>

From-SVN: r267657
2019-01-07 19:30:28 +00:00
Janne Blomqvist 0aa6ee3670 Make GFORTRAN_9 symbol node depend on GFORTRAN_8.
At some point when the GFORTRAN_9 node was added it was forgotten to
make it depend on GFORTRAN_8. This patch fixes this.

Committed as obvious.

2019-01-07  Janne Blomqvist  <jb@gcc.gnu.org>

       * gfortran.map (GFORTRAN_9): Make GFORTRAN_9 node depend on
       GFORTRAN_8.

From-SVN: r267621
2019-01-07 08:40:37 +02:00
Martin Sebor 29d2485270 PR c/88546 - Copy attribute unusable for weakrefs
gcc/c-family/ChangeLog:

	PR c/88546
	* c-attribs.c (handle_copy_attribute): Avoid copying attribute leaf.
	Handle C++ empty throw specification and C11 _Noreturn.
	(has_attribute): Also handle C11 _Noreturn.

gcc/ChangeLog:

	PR c/88546
	* attribs.c (decls_mismatched_attributes): Avoid warning for attribute
	leaf.

gcc/testsuite/ChangeLog:

	PR c/88546
	* g++.dg/ext/attr-copy.C: New test.
	* gcc.dg/attr-copy-4.c: Disable macro expansion tracking.
	* gcc.dg/attr-copy-6.c: New test.
	* gcc.dg/attr-copy-7.c: New test.

From-SVN: r267591
2019-01-04 17:57:30 -07:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Thomas Koenig 2ea47ee9fd re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum function)
2018-12-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/82995
	* trans-expr.c (gfc_conv_procedure_call):  Pass NULL pointer
	for missing optional dummy arguments for library routines.
	* trans-intinsic.c (conv_mask_condition): New function.
	(gfc_conv_intrinsic_arith): Detect and handle optional mask.
	(gfc_conv_intrinsic_minmaxloc): Likewise.
	(gfc_conv_intrinsic_findloc): Likewise.
	(gfc_conv_intrinsic_minmaxval): Likewise.
	(gfc_inline_intrinsic_function_p): Do not inline for rank > 1 if
	an optional mask is present.

2018-12-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/82995
        * m4/ifindloc0.m4: Handle case of absend optional argument, passed
	as a NULL pointer.  Correct allocation of retarray->base_addr.
        * m4/ifindloc1.m4: Likewise.
        * m4/ifindloc2.m4: Handle case of absend optional argument, passed
	as a NULL pointer.
        * m4/iforeach-s.m4: Likewise.
        * m4/iforeach-s2.m4: Likewise.
        * m4/iforeach.m4: Likewise.
        * m4/ifunction-s.m4: Likewise.
        * m4/ifunction-s2.m4: Likewise.
        * m4/ifunction.m4: Likewise.
        * generated/findloc0_c16.c: Regenerated.
        * generated/findloc0_c4.c: Regenerated.
        * generated/findloc0_c8.c: Regenerated.
        * generated/findloc0_i1.c: Regenerated.
        * generated/findloc0_i16.c: Regenerated.
        * generated/findloc0_i2.c: Regenerated.
        * generated/findloc0_i4.c: Regenerated.
        * generated/findloc0_i8.c: Regenerated.
        * generated/findloc0_r16.c: Regenerated.
        * generated/findloc0_r4.c: Regenerated.
        * generated/findloc0_r8.c: Regenerated.
        * generated/findloc0_s1.c: Regenerated.
        * generated/findloc0_s4.c: Regenerated.
        * generated/findloc1_c16.c: Regenerated.
        * generated/findloc1_c4.c: Regenerated.
        * generated/findloc1_c8.c: Regenerated.
        * generated/findloc1_i1.c: Regenerated.
        * generated/findloc1_i16.c: Regenerated.
        * generated/findloc1_i2.c: Regenerated.
        * generated/findloc1_i4.c: Regenerated.
        * generated/findloc1_i8.c: Regenerated.
        * generated/findloc1_r16.c: Regenerated.
        * generated/findloc1_r4.c: Regenerated.
        * generated/findloc1_r8.c: Regenerated.
        * generated/findloc1_s1.c: Regenerated.
        * generated/findloc1_s4.c: Regenerated.
        * generated/findloc2_s1.c: Regenerated.
        * generated/findloc2_s4.c: Regenerated.
        * generated/iall_i1.c: Regenerated.
        * generated/iall_i16.c: Regenerated.
        * generated/iall_i2.c: Regenerated.
        * generated/iall_i4.c: Regenerated.
        * generated/iall_i8.c: Regenerated.
        * generated/iany_i1.c: Regenerated.
        * generated/iany_i16.c: Regenerated.
        * generated/iany_i2.c: Regenerated.
        * generated/iany_i4.c: Regenerated.
        * generated/iany_i8.c: Regenerated.
        * generated/iparity_i1.c: Regenerated.
        * generated/iparity_i16.c: Regenerated.
        * generated/iparity_i2.c: Regenerated.
        * generated/iparity_i4.c: Regenerated.
        * generated/iparity_i8.c: Regenerated.
        * generated/maxloc0_16_i1.c: Regenerated.
        * generated/maxloc0_16_i16.c: Regenerated.
        * generated/maxloc0_16_i2.c: Regenerated.
        * generated/maxloc0_16_i4.c: Regenerated.
        * generated/maxloc0_16_i8.c: Regenerated.
        * generated/maxloc0_16_r10.c: Regenerated.
        * generated/maxloc0_16_r16.c: Regenerated.
        * generated/maxloc0_16_r4.c: Regenerated.
        * generated/maxloc0_16_r8.c: Regenerated.
        * generated/maxloc0_16_s1.c: Regenerated.
        * generated/maxloc0_16_s4.c: Regenerated.
        * generated/maxloc0_4_i1.c: Regenerated.
        * generated/maxloc0_4_i16.c: Regenerated.
        * generated/maxloc0_4_i2.c: Regenerated.
        * generated/maxloc0_4_i4.c: Regenerated.
        * generated/maxloc0_4_i8.c: Regenerated.
        * generated/maxloc0_4_r10.c: Regenerated.
        * generated/maxloc0_4_r16.c: Regenerated.
        * generated/maxloc0_4_r4.c: Regenerated.
        * generated/maxloc0_4_r8.c: Regenerated.
        * generated/maxloc0_4_s1.c: Regenerated.
        * generated/maxloc0_4_s4.c: Regenerated.
        * generated/maxloc0_8_i1.c: Regenerated.
        * generated/maxloc0_8_i16.c: Regenerated.
        * generated/maxloc0_8_i2.c: Regenerated.
        * generated/maxloc0_8_i4.c: Regenerated.
        * generated/maxloc0_8_i8.c: Regenerated.
        * generated/maxloc0_8_r10.c: Regenerated.
        * generated/maxloc0_8_r16.c: Regenerated.
        * generated/maxloc0_8_r4.c: Regenerated.
        * generated/maxloc0_8_r8.c: Regenerated.
        * generated/maxloc0_8_s1.c: Regenerated.
        * generated/maxloc0_8_s4.c: Regenerated.
        * generated/maxloc1_16_i1.c: Regenerated.
        * generated/maxloc1_16_i16.c: Regenerated.
        * generated/maxloc1_16_i2.c: Regenerated.
        * generated/maxloc1_16_i4.c: Regenerated.
        * generated/maxloc1_16_i8.c: Regenerated.
        * generated/maxloc1_16_r10.c: Regenerated.
        * generated/maxloc1_16_r16.c: Regenerated.
        * generated/maxloc1_16_r4.c: Regenerated.
        * generated/maxloc1_16_r8.c: Regenerated.
        * generated/maxloc1_16_s1.c: Regenerated.
        * generated/maxloc1_16_s4.c: Regenerated.
        * generated/maxloc1_4_i1.c: Regenerated.
        * generated/maxloc1_4_i16.c: Regenerated.
        * generated/maxloc1_4_i2.c: Regenerated.
        * generated/maxloc1_4_i4.c: Regenerated.
        * generated/maxloc1_4_i8.c: Regenerated.
        * generated/maxloc1_4_r10.c: Regenerated.
        * generated/maxloc1_4_r16.c: Regenerated.
        * generated/maxloc1_4_r4.c: Regenerated.
        * generated/maxloc1_4_r8.c: Regenerated.
        * generated/maxloc1_4_s1.c: Regenerated.
        * generated/maxloc1_4_s4.c: Regenerated.
        * generated/maxloc1_8_i1.c: Regenerated.
        * generated/maxloc1_8_i16.c: Regenerated.
        * generated/maxloc1_8_i2.c: Regenerated.
        * generated/maxloc1_8_i4.c: Regenerated.
        * generated/maxloc1_8_i8.c: Regenerated.
        * generated/maxloc1_8_r10.c: Regenerated.
        * generated/maxloc1_8_r16.c: Regenerated.
        * generated/maxloc1_8_r4.c: Regenerated.
        * generated/maxloc1_8_r8.c: Regenerated.
        * generated/maxloc1_8_s1.c: Regenerated.
        * generated/maxloc1_8_s4.c: Regenerated.
        * generated/maxval0_s1.c: Regenerated.
        * generated/maxval0_s4.c: Regenerated.
        * generated/maxval1_s1.c: Regenerated.
        * generated/maxval1_s4.c: Regenerated.
        * generated/maxval_i1.c: Regenerated.
        * generated/maxval_i16.c: Regenerated.
        * generated/maxval_i2.c: Regenerated.
        * generated/maxval_i4.c: Regenerated.
        * generated/maxval_i8.c: Regenerated.
        * generated/maxval_r10.c: Regenerated.
        * generated/maxval_r16.c: Regenerated.
        * generated/maxval_r4.c: Regenerated.
        * generated/maxval_r8.c: Regenerated.
        * generated/minloc0_16_i1.c: Regenerated.
        * generated/minloc0_16_i16.c: Regenerated.
        * generated/minloc0_16_i2.c: Regenerated.
        * generated/minloc0_16_i4.c: Regenerated.
        * generated/minloc0_16_i8.c: Regenerated.
        * generated/minloc0_16_r10.c: Regenerated.
        * generated/minloc0_16_r16.c: Regenerated.
        * generated/minloc0_16_r4.c: Regenerated.
        * generated/minloc0_16_r8.c: Regenerated.
        * generated/minloc0_16_s1.c: Regenerated.
        * generated/minloc0_16_s4.c: Regenerated.
        * generated/minloc0_4_i1.c: Regenerated.
        * generated/minloc0_4_i16.c: Regenerated.
        * generated/minloc0_4_i2.c: Regenerated.
        * generated/minloc0_4_i4.c: Regenerated.
        * generated/minloc0_4_i8.c: Regenerated.
        * generated/minloc0_4_r10.c: Regenerated.
        * generated/minloc0_4_r16.c: Regenerated.
        * generated/minloc0_4_r4.c: Regenerated.
        * generated/minloc0_4_r8.c: Regenerated.
        * generated/minloc0_4_s1.c: Regenerated.
        * generated/minloc0_4_s4.c: Regenerated.
        * generated/minloc0_8_i1.c: Regenerated.
        * generated/minloc0_8_i16.c: Regenerated.
        * generated/minloc0_8_i2.c: Regenerated.
        * generated/minloc0_8_i4.c: Regenerated.
        * generated/minloc0_8_i8.c: Regenerated.
        * generated/minloc0_8_r10.c: Regenerated.
        * generated/minloc0_8_r16.c: Regenerated.
        * generated/minloc0_8_r4.c: Regenerated.
        * generated/minloc0_8_r8.c: Regenerated.
        * generated/minloc0_8_s1.c: Regenerated.
        * generated/minloc0_8_s4.c: Regenerated.
        * generated/minloc1_16_i1.c: Regenerated.
        * generated/minloc1_16_i16.c: Regenerated.
        * generated/minloc1_16_i2.c: Regenerated.
        * generated/minloc1_16_i4.c: Regenerated.
        * generated/minloc1_16_i8.c: Regenerated.
        * generated/minloc1_16_r10.c: Regenerated.
        * generated/minloc1_16_r16.c: Regenerated.
        * generated/minloc1_16_r4.c: Regenerated.
        * generated/minloc1_16_r8.c: Regenerated.
        * generated/minloc1_16_s1.c: Regenerated.
        * generated/minloc1_16_s4.c: Regenerated.
        * generated/minloc1_4_i1.c: Regenerated.
        * generated/minloc1_4_i16.c: Regenerated.
        * generated/minloc1_4_i2.c: Regenerated.
        * generated/minloc1_4_i4.c: Regenerated.
        * generated/minloc1_4_i8.c: Regenerated.
        * generated/minloc1_4_r10.c: Regenerated.
        * generated/minloc1_4_r16.c: Regenerated.
        * generated/minloc1_4_r4.c: Regenerated.
        * generated/minloc1_4_r8.c: Regenerated.
        * generated/minloc1_4_s1.c: Regenerated.
        * generated/minloc1_4_s4.c: Regenerated.
        * generated/minloc1_8_i1.c: Regenerated.
        * generated/minloc1_8_i16.c: Regenerated.
        * generated/minloc1_8_i2.c: Regenerated.
        * generated/minloc1_8_i4.c: Regenerated.
        * generated/minloc1_8_i8.c: Regenerated.
        * generated/minloc1_8_r10.c: Regenerated.
        * generated/minloc1_8_r16.c: Regenerated.
        * generated/minloc1_8_r4.c: Regenerated.
        * generated/minloc1_8_r8.c: Regenerated.
        * generated/minloc1_8_s1.c: Regenerated.
        * generated/minloc1_8_s4.c: Regenerated.
        * generated/minval0_s1.c: Regenerated.
        * generated/minval0_s4.c: Regenerated.
        * generated/minval1_s1.c: Regenerated.
        * generated/minval1_s4.c: Regenerated.
        * generated/minval_i1.c: Regenerated.
        * generated/minval_i16.c: Regenerated.
        * generated/minval_i2.c: Regenerated.
        * generated/minval_i4.c: Regenerated.
        * generated/minval_i8.c: Regenerated.
        * generated/minval_r10.c: Regenerated.
        * generated/minval_r16.c: Regenerated.
        * generated/minval_r4.c: Regenerated.
        * generated/minval_r8.c: Regenerated.
        * generated/product_c10.c: Regenerated.
        * generated/product_c16.c: Regenerated.
        * generated/product_c4.c: Regenerated.
        * generated/product_c8.c: Regenerated.
        * generated/product_i1.c: Regenerated.
        * generated/product_i16.c: Regenerated.
        * generated/product_i2.c: Regenerated.
        * generated/product_i4.c: Regenerated.
        * generated/product_i8.c: Regenerated.
        * generated/product_r10.c: Regenerated.
        * generated/product_r16.c: Regenerated.
        * generated/product_r4.c: Regenerated.
        * generated/product_r8.c: Regenerated.
        * generated/sum_c10.c: Regenerated.
        * generated/sum_c16.c: Regenerated.
        * generated/sum_c4.c: Regenerated.
        * generated/sum_c8.c: Regenerated.
        * generated/sum_i1.c: Regenerated.
        * generated/sum_i16.c: Regenerated.
        * generated/sum_i2.c: Regenerated.
        * generated/sum_i4.c: Regenerated.
        * generated/sum_i8.c: Regenerated.
        * generated/sum_r10.c: Regenerated.
        * generated/sum_r16.c: Regenerated.
        * generated/sum_r4.c: Regenerated.
        * generated/sum_r8.c: Regenerated.

2018-12-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/82995
	* gfortran.dg/optional_absent_4.f90: New test.
	* gfortran.dg/optional_absent_5.f90: New test.

From-SVN: r267487
2018-12-31 14:59:46 +00:00
Steven G. Kargl ede9dea5c4 expr.c (external_spec_function): Add ieee_support_subnormal to list of IEEE inquiry functions.
2018-12-29  Steven G. Kargl  <kargl@gcc.gnu.org>

	* expr.c (external_spec_function): Add ieee_support_subnormal to list
	of IEEE inquiry functions.

2018-12-29  Steven G. Kargl  <kargl@gcc.gnu.org>

	* gfortran.map: Expose subnormal functions in dynamic library.
	* ieee/ieee_arithmetic.F90: Add support for IEEE_SUBNORMAL,
	IEEE_POSITIVE_SUBNORMAL, and IEEE_NEGATIVE_SUBNORMAL.
	* ieee/ieee_helper.c: Ditto.
	* ieee/ieee_features.F90:  Add IEEE_SUBNORMAL.

2018-12-29  Steven G. Kargl  <kargl@gcc.gnu.org>

	* gfortran.dg/ieee/ieee_11.F90: New test.

From-SVN: r267468
2018-12-29 19:14:32 +00:00
Steven G. Kargl 74ee24e23e re PR fortran/88342 (Possible bug with IEEE_POSITIVE_INF and -ffpe-trap=overflow)
2018-12-29  Steven G. Kargl  <kargl@gcc.gnu.org>
      
	PR fortran/88342
	* ieee/ieee_arithmetic.F90: Prevent exceptions in IEEE_VALUE if
	-ffpe-trap=invalid or -ffpe-trap=overflow is used.

2018-12-29  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88342
	* gfortran.dg/ieee/ieee_10.f90:  New test.

From-SVN: r267465
2018-12-29 18:10:57 +00:00
Steven G. Kargl 07b700ead5 re PR libfortran/81984 (NULL string pointer dereferencing forces undefined behaviour in libgfortran)
2018-12-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/81984
	* intrinsics/string_intrinsics_inc.c: Placate the sanitizer.

From-SVN: r267452
2018-12-28 18:26:09 +00:00
Steven G. Kargl 8ab8b08a13 re PR fortran/69121 (IEEE_SCALB is not generic)
2018-12-21  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69121
	* ieee/ieee_arithmetic.F90: Provide missing interfaces for IEEE_SCALB.

2018-12-21  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69121
	* gfortran.dg/ieee/ieee_9.f90: New test.

From-SVN: r267343
2018-12-21 21:09:17 +00:00
Steven G. Kargl 11e07fa432 ieee_arithmetic.F90: Re-organize file to eliminate #ifdef ...
2018-12-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	* libgfortran/ieee/ieee_arithmetic.F90: Re-organize file to 
	eliminate #ifdef ... #endif.  No functional change.

From-SVN: r267312
2018-12-20 19:39:30 +00:00
Thomas Koenig d0cbb206e2 re PR libfortran/88411 (Random crashes for ASYNCHRONOUS writes (bad locking?))
2018-12-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/88411
	* io/transfer.c (dta_transfer_init): Do not treat as an
	asynchronous statement unless the statement has
	ASYNCHRONOUS="YES".
	(st_write_done): Likewise.
	(st_read_done): Do not perform async_wait for synchronous I/O
	on an async unit.
	(st_read_done): Likewise.

2018-12-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/88411
	* testsuite/libgomp.fortran/async_io_8.f90: New test.

From-SVN: r266929
2018-12-09 18:54:47 +00:00
Janne Blomqvist df996c3fd2 Use atomic load/store to access static backtrace state pointer
As the static backtrace state pointer can be accessed from multiple
threads, use atomics to access it.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2018-12-02  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/88137
	* runtime/backtrace.c (show_backtrace): Use atomic load/store to
	access the static lbstate pointer.

From-SVN: r266724
2018-12-02 17:12:44 +02:00
Janne Blomqvist 854cedfd40 Initialize backtrace state once
From backtrace.h for backtrace_create_state:

   Calling this function allocates resources that can not be freed.
   There is no backtrace_free_state function.  The state is used to
   cache information that is expensive to recompute.  Programs are
   expected to call this function at most once and to save the return
   value for all later calls to backtrace functions.

So instead of calling backtrace_create_state every time we wish to
show a backtrace, do it once and store the result in a static
variable.  libbacktrace allows multiple threads to access the state,
so no need to use TLS.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2018-11-30  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/88137
	* runtime/backtrace.c (show_backtrace): Make lbstate a static
	variable, initialize once.

From-SVN: r266677
2018-11-30 18:44:27 +02:00
Janne Blomqvist f4c0f88881 Make recursion_check work for multiple threads
With multiple threads, using an unprotected static variable to check
whether recursion has occured isn't valid, as one thread might have
modified the variable, thus causing another thread to incorrectly
conclude that recursion has occured.  This patch avoids this problem
by using a thread-specific variable for the recursion check.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2018-11-23  Janne Blomqvist  <jb@gcc.gnu.org>

	* runtime/error.c (MAGIC): Remove.
	(recursion_key): New variable.
	(recursion_check): Use thread-specific variable for recursion
	check if threads are active.
	(constructor_recursion_check): New function.
	(destructor_recursion_check): New funcion.

From-SVN: r266419
2018-11-23 22:42:03 +02:00
Janne Blomqvist 0536d5b37d Replace sync builtins with atomic builtins
The old __sync builtins have been deprecated for a long time now in
favor of the __atomic builtins following the C++11/C11 memory model.
This patch converts libgfortran to use the modern __atomic builtins.

At the same time I weakened the consistency to relaxed for
incrementing and decrementing the counter, and acquire-release when
decrementing to check whether the counter is 0 and the unit can be
freed.  This is similar to e.g. std::shared_ptr in C++.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2018-11-22  Janne Blomqvist  <jb@gcc.gnu.org>

	* acinclude.m4 (LIBGFOR_CHECK_ATOMIC_FETCH_ADD): Rename and test
	presence of atomic builtins instead of sync builtins.
	* configure.ac (LIBGFOR_CHECK_ATOMIC_FETCH_ADD): Call new test.
	* io/io.h (inc_waiting_locked): Use __atomic_fetch_add.
	(predec_waiting_locked): Use __atomic_add_fetch.
	(dec_waiting_unlocked): Use __atomic_fetch_add.
	* config.h.in: Regenerated.
	* configure: Regenerated.
        * Makefile.in: Regenerated.

From-SVN: r266367
2018-11-22 09:58:29 +02:00
Jerry DeLisle 900dab1338 re PR fortran/78351 (comma not terminating READ of formatted input field - ok in 4.1.7, not 4.4.7- maybe related to 25419?)
2018-11-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/78351
	* io/transfer.c (read_sf_internal): Delete leftover
	debug code.

From-SVN: r265979
2018-11-09 17:29:33 +00:00
Jerry DeLisle 3f3284629b re PR fortran/78351 (comma not terminating READ of formatted input field - ok in 4.1.7, not 4.4.7- maybe related to 25419?)
2018-11-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/78351
	* io/transfer.c (read_sf_internal): Add support for early
	comma termination of internal unit formatted reads.

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

From-SVN: r265946
2018-11-09 02:46:03 +00:00
Joseph Myers 22e0527251 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856).
This patch updates GCC to use autoconf 2.69 and automake 1.15.1.
(That's not the latest automake version, but it's the one used by
binutils-gdb, with which consistency is desirable, and in any case
seems a useful incremental update that should make a future update to
1.16.1 easier.)

The changes are generally similar to the binutils-gdb ones, and are
copied from there where shared files and directories are involved
(there are some further changes to such shared directories, however,
which I'd expect to apply to binutils-gdb once this patch is in GCC).
Largely, obsolete AC_PREREQ calls are removed, while many
AC_LANG_SOURCE calls are added to avoid warnings from aclocal and
autoconf.  Multilib support is no longer included in core automake,
meaning that multilib.am needs copying from automake's contrib
directory into the GCC source tree.  Autoconf 2.69 has Go support, so
local copies of that support are removed.  I hope the D support will
soon be submitted to upstream autoconf so the local copy of that can
be removed in a future update.  Changes to how automake generates
runtest calls mean quotes are removed from RUNTEST definitions in five
lib*/testsuite/Makefile.am files (libatomic, libgomp, libitm,
libphobos, libvtv; some others have RUNTEST definitions without
quotes, which are still OK); libgo and libphobos also get
-Wno-override added to AM_INIT_AUTOMAKE so those overrides of RUNTEST
do not generate automake warnings.

Note that the regeneration did not include regeneration of
fixincludes/config.h.in (attempting such regeneration resulted in all
the USED_FOR_TARGET conditionals disappearing; and I don't see
anything in the fixincludes/ directory that would result in such
conditionals being generated, unlike in the gcc/ directory).  Also
note that libvtv/testsuite/other-tests/Makefile.in was not
regenerated; that directory is not listed as a subdirectory for which
Makefile.in gets regenerated by calling "automake" in libvtv/, so I'm
not sure how it's meant to be regenerated.

While I mostly fixed warnings should running aclocal / automake /
autoconf, there were various such warnings from automake in the
libgfortran, libgo, libgomp, liboffloadmic, libsanitizer, libphobos
directories that I did not fix, preferring to leave those to the
relevant subsystem maintainers.  Specifically, most of those warnings
were of the following form (example from libgfortran):

Makefile.am:48: warning: source file 'caf/single.c' is in a subdirectory,
Makefile.am:48: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they
will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.

I think it's best for the relevant maintainers to add subdir-objects
and do any other associated Makefile.am changes needed.  In some cases
the paths in the warnings involved ../; I don't know if that adds any
extra complications to the use of subdir-objects.

I've tested this with native, cross and Canadian cross builds.  The
risk of any OS-specific issues should I hope be rather lower than if a
libtool upgrade were included (we *should* do such an upgrade at some
point, but it's more complicated - it involves identifying all our
local libtool changes to see if any aren't included in the upstream
version we update to, and reverting an upstream libtool patch that's
inappropriate for use in GCC); I think it would be better to get this
update into GCC so that people can test in different configurations
and we can fix any issues found, rather than to try to get more and
more testing done before it goes in.

top level:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* multilib.am: New file.  From automake.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
	* ar-lib: New file.
	* test-driver: New file.
	* configure: Re-generate.

config:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* math.m4, tls.m4: Use AC_LANG_SOURCE.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.

fixincludes:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* aclocal.m4, configure: Regenerate.

gcc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.  Use single
	line for second argument of AC_DEFINE_UNQUOTED.
	* doc/install.texi (Tools/packages necessary for modifying GCC):
	Update to autoconf 2.69 and automake 1.15.1.
	* aclocal.m4, config.in, configure: Regenerate.

gnattools:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* configure: Regenerate.

gotools:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* config/go.m4: Remove file.
	* Makefile.am (ACLOCAL_AMFLAGS): Do not use -I ./config.
	* configure.ac:  Remove AC_PREREQ.  Do not include config/go.m4.
	* Makefile.in, aclocal.m4, configure: Regenerate.

intl:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
	* configure: Re-generate.
	* config.h.in: Re-generate.
	* aclocal.m4: Re-generate.

libada:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* configure: Regenerate.

libatomic:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* acinclude.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libbacktrace:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libcc1:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libcpp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* aclocal.m4, config.in, configure: Regenerate.

libdecnumber:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* aclocal.m4.

libffi:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove doc/libffi.info.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, fficonfig.h.in,
	include/Makefile.in, man/Makefile.in, testsuite/Makefile.in:
	Regenerate.

libgcc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* configure: Regenerate.

libgfortran:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libgo [logically part of this change but omitted from the commit]:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* config/go.m4: Remove file.
	* config/libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.  Use
	-Wno-override in AM_INIT_AUTOMAKE call.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libgomp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove libgomp.info.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libhsail-rt:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libiberty:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* config.in: Re-generate.

libitm:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove libitm.info.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libobjc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* aclocal.m4, config.h.in, configure: Regenerate.

liboffloadmic:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* plugin/Makefile.am: Include multilib.am.
	* plugin/configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, plugin/Makefile.in,
	plugin/aclocal.m4, plugin/configure: Regenerate.

libphobos:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use -Wno-override in
	AM_INIT_AUTOMAKE call.
	* m4/autoconf.m4: Add extra argument to AC_LANG_DEFINE call.
	* m4/druntime/os.m4: Use AC_LANG_SOURCE.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, libdruntime/Makefile.in,
	src/Makefile.in, testsuite/Makefile.in: Regenerate.

libquadmath:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Remove 1.8.  Add info-in-builddir.
	(all-local): Define outside conditional code.
	(CLEANFILES): Remove libquadmath.info.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libsanitizer:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, asan/Makefile.in, configure,
	interception/Makefile.in, libbacktrace/Makefile.in,
	lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in,
	ubsan/Makefile.in: Regenerate.

libssp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Remove 1.9.5.
	* configure.ac: Remove AC_PREREQ.  Quote argument to
	AC_RUN_IFELSE.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libstdc++-v3:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, doc/Makefile.in,
	include/Makefile.in, libsupc++/Makefile.in, po/Makefile.in,
	python/Makefile.in, src/Makefile.in, src/c++11/Makefile.in,
	src/c++17/Makefile.in, src/c++98/Makefile.in,
	src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate.

libvtv:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

lto-plugin:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

zlib:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.

From-SVN: r265695
2018-10-31 17:03:16 +00:00
Thomas Koenig 01ce9e31a0 re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=)
2017-10-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/54613
	* gfortran.h (gfc_isym_id): Add GFC_ISYM_FINDLOC.
	(gfc_check_f): Add f6fl field.
	(gfc_simplify_f): Add f6 field.
	(gfc_resolve_f): Likewise.
	(gfc_type_letter): Add optional logical_equas_int flag.
	* check.c (intrinsic_type_check): New function.
	(gfc_check_findloc): New function.
	* intrinsics.c (gfc_type_letter): If logical_equals_int is
	set, act accordingly.
	(add_sym_5ml):  Reformat comment.
	(add_sym_6fl): New function.
	(add_functions): Add findloc.
	(check_arglist): Add sixth argument, handle it.
	(resolve_intrinsic): Likewise.
	(check_specific): Handle findloc.
	* intrinsic.h (gfc_check_findloc): Add prototype.
	(gfc_simplify_findloc): Likewise.
	(gfc_resolve_findloc): Likewise.
	(MAX_INTRINSIC_ARGS): Adjust.
	* iresolve.c (gfc_resolve_findloc): New function.
	* simplify.c (gfc_simplify_minmaxloc): Make static.
	(simplify_findloc_to_scalar): New function.
	(simplify_findloc_nodim): New function.
	(simplify_findloc_to_array): New function.
	(gfc_simplify_findloc): New function.
	(gfc_conv_intrinsic_findloc): New function.
	(gfc_conv_intrinsic_function): Handle GFC_ISYM_FINDLOC.
	(gfc_is_intrinsic_libcall): Likewise.

2017-10-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/54613
	* Makefile.am: Add files for findloc.
	* Makefile.in: Regenerated.
	* libgfortran.h (gfc_array_index_type): Add.
	(gfc_array_s1): Add using GFC_UINTEGER_1.
	(gfc_array_s4): Likewise.
	Replace unnecessary comment.
	(HAVE_GFC_UINTEGER_1): Define.
	(HAVE_GFC_UINTEGER_4): Define.
	* m4/findloc0.m4: New file.
	* m4/findloc0s.m4: New file.
	* m4/findloc1.m4: New file.
	* m4/findloc1s.m4: New file.
	* m4/findloc2s.m4: New file.
	* m4/ifindloc0.m4: New file.
	* m4/ifindloc1.m4: New file.
	* m4/ifindloc2.m4: New file.
	* m4/iparm.m4: Use unsigned integer for characters.
        * generated/findloc0_c16.c: New file.
        * generated/findloc0_c4.c: New file.
        * generated/findloc0_c8.c: New file.
        * generated/findloc0_i1.c: New file.
        * generated/findloc0_i16.c: New file.
        * generated/findloc0_i2.c: New file.
        * generated/findloc0_i4.c: New file.
        * generated/findloc0_i8.c: New file.
        * generated/findloc0_r16.c: New file.
        * generated/findloc0_r4.c: New file.
        * generated/findloc0_r8.c: New file.
        * generated/findloc0_s1.c: New file.
        * generated/findloc0_s4.c: New file.
        * generated/findloc1_c16.c: New file.
        * generated/findloc1_c4.c: New file.
        * generated/findloc1_c8.c: New file.
        * generated/findloc1_i1.c: New file.
        * generated/findloc1_i16.c: New file.
        * generated/findloc1_i2.c: New file.
        * generated/findloc1_i4.c: New file.
        * generated/findloc1_i8.c: New file.
        * generated/findloc1_r16.c: New file.
        * generated/findloc1_r4.c: New file.
        * generated/findloc1_r8.c: New file.
        * generated/findloc1_s1.c: New file.
        * generated/findloc1_s4.c: New file.
        * generated/findloc2_s1.c: New file.
        * generated/findloc2_s4.c: New file.
        * generated/maxloc0_16_s1.c: Regenerated.
        * generated/maxloc0_16_s4.c: Regenerated.
        * generated/maxloc0_4_s1.c: Regenerated.
        * generated/maxloc0_4_s4.c: Regenerated.
        * generated/maxloc0_8_s1.c: Regenerated.
        * generated/maxloc0_8_s4.c: Regenerated.
        * generated/maxloc1_16_s1.c: Regenerated.
        * generated/maxloc1_16_s4.c: Regenerated.
        * generated/maxloc1_4_s1.c: Regenerated.
        * generated/maxloc1_4_s4.c: Regenerated.
        * generated/maxloc1_8_s1.c: Regenerated.
        * generated/maxloc1_8_s4.c: Regenerated.
        * generated/maxloc2_16_s1.c: Regenerated.
        * generated/maxloc2_16_s4.c: Regenerated.
        * generated/maxloc2_4_s1.c: Regenerated.
        * generated/maxloc2_4_s4.c: Regenerated.
        * generated/maxloc2_8_s1.c: Regenerated.
        * generated/maxloc2_8_s4.c: Regenerated.
        * generated/maxval0_s1.c: Regenerated.
        * generated/maxval0_s4.c: Regenerated.
        * generated/maxval1_s1.c: Regenerated.
        * generated/maxval1_s4.c: Regenerated.
        * generated/minloc0_16_s1.c: Regenerated.
        * generated/minloc0_16_s4.c: Regenerated.
        * generated/minloc0_4_s1.c: Regenerated.
        * generated/minloc0_4_s4.c: Regenerated.
        * generated/minloc0_8_s1.c: Regenerated.
        * generated/minloc0_8_s4.c: Regenerated.
        * generated/minloc1_16_s1.c: Regenerated.
        * generated/minloc1_16_s4.c: Regenerated.
        * generated/minloc1_4_s1.c: Regenerated.
        * generated/minloc1_4_s4.c: Regenerated.
        * generated/minloc1_8_s1.c: Regenerated.
        * generated/minloc1_8_s4.c: Regenerated.
        * generated/minloc2_16_s1.c: Regenerated.
        * generated/minloc2_16_s4.c: Regenerated.
        * generated/minloc2_4_s1.c: Regenerated.
        * generated/minloc2_4_s4.c: Regenerated.
        * generated/minloc2_8_s1.c: Regenerated.
        * generated/minloc2_8_s4.c: Regenerated.
        * generated/minval0_s1.c: Regenerated.
        * generated/minval0_s4.c: Regenerated.
        * generated/minval1_s1.c: Regenerated.
        * generated/minval1_s4.c: Regenerated.

2017-10-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/54613
	* gfortran.dg/findloc_1.f90: New test.
	* gfortran.dg/findloc_2.f90: New test.
	* gfortran.dg/findloc_3.f90: New test.
	* gfortran.dg/findloc_4.f90: New test.
	* gfortran.dg/findloc_5.f90: New test.
	* gfortran.dg/findloc_6.f90: New test.

From-SVN: r265570
2018-10-28 11:05:05 +00:00
Janne Blomqvist c0ab1530d4 Use gfc_charlen_type instead of int for string lenghts
This patch cleans up a few places where I noticed the code was still
using int instead gfc_charlen_type for string lengths.  Regtested on
x86_64-pc-linux-gnu, committed as obvious.

libgfortran/ChangeLog:

2018-10-06  Janne Blomqvist  <jb@gcc.gnu.org>

	* io/unix.c (compare_file_filename): Use gfc_charlen_type instead
	of int for string length.
	(inquire_sequential): Likewise.
	(inquire_direct): Likewise.
	(inquire_formatted): Likewise.
	(inquire_unformatted): Likewise.
	(inquire_access): Likewise.
	(inquire_read): Likewise.
	(inquire_write): Likewise.
	(inquire_readwrite): Likewise.
	* io/unix.h (compare_file_filename): Likewise.
	(inquire_sequential): Likewise.
	(inquire_direct): Likewise.
	(inquire_formatted): Likewise.
	(inquire_unformatted): Likewise.
	(inquire_read): Likewise.
	(inquire_write): Likewise.
	(inquire_readwrite): Likewise.

From-SVN: r264901
2018-10-06 21:21:00 +03:00
Gerald Pfeifer ff504cc2b8 * io/close.c [!HAVE_UNLINK_OPEN_FILE]: Include <string.h>.
From-SVN: r264800
2018-10-02 20:02:03 +00:00
Janne Blomqvist edaaef601d Use vectored writes when reporting errors and warnings.
When producing error and warning messages, libgfortran writes a
message by using many system calls.  By using vectored writes (the
POSIX writev function) when available and feasible to use without
major surgery, we reduce the chance that output gets intermingled with
other output to stderr.

In practice, this is done by introducing a new function estr_writev in
addition to the existing estr_write.  In order to use this, the old
st_vprintf is removed, replaced by direct calls of vsnprintf, allowing
more message batching.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2018-09-21  Janne Blomqvist  <jb@gcc.gnu.org>

	* config.h.in: Regenerated.
	* configure: Regenerated.
	* configure.ac: Check for writev and sys/uio.h.
	* libgfortran.h: Include sys/uio.h.
	(st_vprintf): Remove prototype.
	(struct iovec): Define if not available.
	(estr_writev): New prototype.
	* runtime/backtrace.c (error_callback): Use estr_writev.
	* runtime/error.c (ST_VPRINTF_SIZE): Remove.
	(estr_writev): New function.
	(st_vprintf): Remove.
	(gf_vsnprintf): New function.
	(ST_ERRBUF_SIZE): New macro.
	(st_printf): Use vsnprintf.
	(os_error): Use estr_writev.
	(runtime_error): Use vsnprintf and estr_writev.
	(runtime_error_at): Likewise.
	(runtime_warning_at): Likewise.
	(internal_error): Use estr_writev.
	(generate_error_common): Likewise.
	(generate_warning): Likewise.
	(notify_std): Likewise.
	* runtime/pause.c (pause_string): Likewise.
	* runtime/stop.c (report_exception): Likewise.
	(stop_string): Likewise.
	(error_stop_string): Likewise.

From-SVN: r264487
2018-09-21 21:12:59 +03:00
Thomas Koenig ed33417a64 re PR fortran/37802 (Improve wording for matmul bound checking)
2018-09-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/37802
	* frontend-passes.c (B_ERROR): New macro for matmul bounds
	checking error messages.
	(C_ERROR): Likewise.
	(inline_matmul_assign): Reorganize bounds checking, use B_ERROR
	and C_ERROR macros.

2018-09-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/37802
	* gfortran.dg/matmul_bounds_13.f90: New test case.
	* gfortran.dg/inline_matmul_15.f90:  Adjust test for runtime
	error.
	* gfortran.dg/matmul_5.f90: Likewise.
	* gfortran.dg/matmul_bounds_10.f90: Likewise.
	* gfortran.dg/matmul_bounds_11.f90: Likewise.
	* gfortran.dg/matmul_bounds_2.f90: Likewise.
	* gfortran.dg/matmul_bounds_4.f90: Likewise.
	* gfortran.dg/matmul_bounds_5.f90: Likewise.

2018-09-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/37802
	* m4/matmul_internal.m4: Adjust error messages.
        * generated/matmul_c10.c: Regenerated.
        * generated/matmul_c16.c: Regenerated.
        * generated/matmul_c4.c: Regenerated.
        * generated/matmul_c8.c: Regenerated.
        * generated/matmul_i1.c: Regenerated.
        * generated/matmul_i16.c: Regenerated.
        * generated/matmul_i2.c: Regenerated.
        * generated/matmul_i4.c: Regenerated.
        * generated/matmul_i8.c: Regenerated.
        * generated/matmul_r10.c: Regenerated.
        * generated/matmul_r16.c: Regenerated.
        * generated/matmul_r4.c: Regenerated.
        * generated/matmul_r8.c: Regenerated.
        * generated/matmulavx128_c10.c: Regenerated.
        * generated/matmulavx128_c16.c: Regenerated.
        * generated/matmulavx128_c4.c: Regenerated.
        * generated/matmulavx128_c8.c: Regenerated.
        * generated/matmulavx128_i1.c: Regenerated.
        * generated/matmulavx128_i16.c: Regenerated.
        * generated/matmulavx128_i2.c: Regenerated.
        * generated/matmulavx128_i4.c: Regenerated.
        * generated/matmulavx128_i8.c: Regenerated.
        * generated/matmulavx128_r10.c: Regenerated.
        * generated/matmulavx128_r16.c: Regenerated.
        * generated/matmulavx128_r4.c: Regenerated.
        * generated/matmulavx128_r8.c: Regenerated.

From-SVN: r264349
2018-09-16 19:37:44 +00:00
Kyrylo Tkachov ef5057c89e [libgfortran] Fix uninitialized variable use in fallback_access
I've been tracking down a bug in a Fortran program on a newlib target and it boils down to fallback_access doing something bad.
The unconditional calls to close cause havoc when open doesn't get called due to the short-circuiting in the if-statement above
because the fd is uninitialised. In my environment GCC ends up calling close on file descriptor 0, thus trying to close stdin.

This patch tightens up the calling so that close is called only when the corresponding open call succeeded.
With this my runtime failure disappears.

Bootstrapped and tested on aarch64-none-linux-gnu.
Though that doesn't exercise this call I hope it's an obviously correct change. 

	* io/unix.c (fallback_access): Avoid calling close on
	uninitialized file descriptor.

From-SVN: r264305
2018-09-14 09:22:01 +00:00
Kwok Cheung Yeung 72ced87475 Fix interleaving of Fortran STOP messages
Fortran STOP and ERROR STOP use a different function to print the "STOP" string
and the message string.  On GCN this results in out-of-order output, such as
"<msg>ERROR STOP ".

This patch fixes the problem by making estr_write use the proper Fortran write,
not C printf, so both parts are now output the same way.  This also ensures
that both parts are output to STDERR (not that that means anything on GCN).

2018-09-12  Kwok Cheung Yeung  <kcy@codesourcery.com>

	libgfortran/
	* runtime/minimal.c (estr_write): Define in terms of write.

From-SVN: r264239
2018-09-12 13:53:34 +00:00
Andrew Stubbs 4986a9568a Fix Fortran STOP.
The minimal libgfortran setup was created for NVPTX, but will also be used by
AMD GCN.

This patch simply removes an assumption that NVPTX is the only user.
Specifically, NVPTX exit is broken, but AMD GCN exit works just fine.

2018-09-12  Andrew Stubbs  <ams@codesourcery.com>

	libgfortran/
	* runtime/minimal.c (exit): Only work around nvptx bugs on nvptx.

From-SVN: r264238
2018-09-12 13:53:32 +00:00
Janne Blomqvist d4c0eb58b7 Remove unused init_unsigned_integer function.
As pointed out by Bernhard Reutner-Fischer, this function is unused
since the fix for PR 53796 in November 2017.

2018-09-07  Janne Blomqvist  <jb@gcc.gnu.org>

        * runtime/environ.c (init_unsigned_integer): Remove.

From-SVN: r264163
2018-09-07 21:59:50 +03:00
Hans-Peter Nilsson a79878585a * io/async.h: Use __gthread_mutex_t, not pthread_mutex_t.
From-SVN: r264120
2018-09-05 10:28:45 +00:00
Jerry DeLisle 636b78f0a3 io.h: Change declaration of vlist type to gfc_full_array_i4 to eliminate warning for...
2018-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/io.h: Change declaration of vlist type to
	gfc_full_array_i4 to eliminate warning for mismatched type.
	* io/format.c ((parse_format_list): Use gfc_full_array_i4.
	* io/io.h: Use gfc_full_array_i4.

From-SVN: r264043
2018-09-02 15:55:51 +00:00