Jakub Jelinek [Sat, 29 Sep 2018 16:28:53 +0000 (18:28 +0200)]
re PR target/87467 (Incorrect function parameter for _mm512_abs_pd in `include/avx512fintrin.h`)
PR target/87467
* config/i386/avx512fintrin.h (_mm512_abs_pd, _mm512_mask_abs_pd): Use
__m512d type for __A argument rather than __m512.
* gcc.target/i386/avx512f-abspd-1.c (SIZE): Divide by two.
(CALC): Use double instead of float.
(TEST): Adjust to test _mm512_abs_pd and _mm512_mask_abs_pd rather than
_mm512_abs_ps and _mm512_mask_abs_ps.
Paul Thomas [Thu, 13 Sep 2018 19:46:05 +0000 (19:46 +0000)]
re PR fortran/87284 (Allocation of class arrays with mold results in "conditional jump or move depends on uninitialised value")
2018-09-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/87284
* trans-expr.c (gfc_trans_class_init_assign): Access to
to array elements of the dynamic type requires that the array
reference be added to the class expression and not the _data
component, unlike scalar expressions.
2018-09-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/87284
* gfortran.dg/allocate_with_mold_2.f90: New test.
Eric Botcazou [Thu, 13 Sep 2018 10:14:39 +0000 (10:14 +0000)]
backport: s-osinte-solaris.ads (upad64_t): New private type.
Backport from mainline
2018-07-31 Eric Botcazou <ebotcazou@adacore.com>
* s-osinte-solaris.ads (upad64_t): New private type.
(mutex_t): Use it for 'lock' and 'data' components.
(cond_t): Likewise for 'data' and use single 'flags' component.
Andreas Krebbel [Wed, 12 Sep 2018 11:13:56 +0000 (11:13 +0000)]
S/390: Use proper rounding mode for DFP to BFD conversions
According to IEEE 754 2008 4.3 'Rounding-direction attributes' the
rounding mode of the target format needs to be used. By not setting
the value so far we have always used the DFP rounding mode.
gcc/ChangeLog:
2018-09-12 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2018-09-12 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/s390.md (PFPO_RND_MODE_DFP, PFPO_RND_MODE_BFP): New
constants.
("trunc<BFP:mode><DFP_ALL:mode>2")
("trunc<DFP_ALL:mode><BFP:mode>2")
("extend<BFP:mode><DFP_ALL:mode>2")
("extend<DFP_ALL:mode><BFP:mode>2"): Set proper rounding mode
according to the target operand type.
gcc/testsuite/ChangeLog:
2018-09-12 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2018-09-12 Andreas Krebbel <krebbel@linux.ibm.com>
* gcc.target/s390/dfp_to_bfp_rounding.c: New test.
Janus Weil [Fri, 7 Sep 2018 17:33:15 +0000 (19:33 +0200)]
backport: re PR fortran/86116 (Ambiguous generic interface not recognised)
2018-09-07 Janus Weil <janus@gcc.gnu.org>
Backported from trunk
PR fortran/86116
* interface.c (compare_type): Remove a CLASS/TYPE check.
(compare_type_characteristics): New function that behaves like the old
'compare_type'.
(gfc_check_dummy_characteristics, gfc_check_result_characteristics):
Call 'compare_type_characteristics' instead of 'compare_type'.
2018-09-07 Janus Weil <janus@gcc.gnu.org>
Backported from trunk
PR fortran/86116
* gfortran.dg/generic_34.f90: New test case.
backport: pa.md (UNSPEC_MEMORY_BARRIER): New unspec enum.
Backport from mainline
2018-08-11 John David Anglin <danglin@gcc.gnu.org>
gcc
* config/pa/pa.md (UNSPEC_MEMORY_BARRIER): New unspec enum.
Update comment for atomic instructions.
(atomic_storeqi, atomic_storehi, atomic_storesi, atomic_storesf,
atomic_loaddf, atomic_loaddf_1, atomic_storedf, atomic_storedf_1):
Remove.
(atomic_loaddi): Revise fence expansion to only emit fence prior to
load for __ATOMIC_SEQ_CST model.
(atomic_loaddi_1): Remove float register target.
(atomic_storedi): Handle CONST_INT values.
(atomic_storedi_1): Remove float register source. Add special case
for zero value.
(memory_barrier): New expander and insn.
libgcc
* config/pa/linux-atomic.c: Update comment.
(FETCH_AND_OP_2, OP_AND_FETCH_2, FETCH_AND_OP_WORD, OP_AND_FETCH_WORD,
COMPARE_AND_SWAP_2, __sync_val_compare_and_swap_4,
SYNC_LOCK_TEST_AND_SET_2, __sync_lock_test_and_set_4): Use
__ATOMIC_RELAXED for atomic loads.
(SYNC_LOCK_RELEASE_1): New define. Use __sync_synchronize() and
unordered store to release lock.
(__sync_lock_release_8): Likewise.
(SYNC_LOCK_RELEASE_2): Remove define.
Jonathan Wakely [Mon, 13 Aug 2018 19:16:02 +0000 (20:16 +0100)]
Revert "libstdc++-v3: Have aligned_alloc() on Newlib"
This reverts commit r263463 / b7edd52337828cc46e469bca12f58288795b78d5
because aligned_alloc is not defined for baremetal newlib targets, see
https://gcc.gnu.org/ml/libstdc++/2018-08/msg00065.html
Revert
2018-08-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR target/85904
* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
Newlib.
* configure: Regenerate.
backport: re PR target/86197 (POWERPC: float128 parameter passing)
Backport from mainline
2018-06-19 Segher Boessenkool <segher@kernel.crashing.org>
PR target/86197
* config/rs6000/rs6000.md (rs6000_discover_homogeneous_aggregate): An
ieee128 argument takes up only one (vector) register, not two (floating
point) registers.
Jonathan Wakely [Wed, 8 Aug 2018 15:53:25 +0000 (16:53 +0100)]
Prevent internal aligned_alloc clashing with libc version
If configure fails to detect aligned_alloc we will try to define our
own in new_opa.cc but that could clash with the libc version in
<stdlib.h>. Use a namespace to keep them distinct.
* libsupc++/new_opa.cc (aligned_alloc): Declare inside namespace to
avoid clashing with an ::aligned_alloc function that was not detected
by configure.
Jonathan Wakely [Tue, 7 Aug 2018 22:50:55 +0000 (23:50 +0100)]
Declare some explicit instantiations for strings in Debug Mode
The empty reps and the I/O functions do not need to be implicitly
instantiated to enable assertions, so declare the explicit
instantiations when _GLIBCXX_EXTERN_TEMPLATE == -1 (i.e. when
_GLIBCXX_ASSERTIONS is defined).
Backport from mainline
2018-06-27 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/86138
* include/bits/basic_string.tcc: [_GLIBCXX_EXTERN_TEMPLATE < 0]
Declare explicit instantiations of COW empty reps and I/O functions.
Jonathan Wakely [Tue, 7 Aug 2018 22:50:49 +0000 (23:50 +0100)]
PR libstdc++/84654 Disable __float128 specializations for -mno-float128
Backport from mainline
2018-05-08 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/85672
* include/Makefile.am [!ENABLE_FLOAT128]: Change c++config.h entry
to #undef _GLIBCXX_USE_FLOAT128 instead of defining it to zero.
* include/Makefile.in: Regenerate.
* include/bits/c++config (_GLIBCXX_USE_FLOAT128): Move definition
within conditional block.
Backport from mainline
2018-05-01 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
PR libstdc++/84654
* acinclude.m4: Set ENABLE_FLOAT128 instead of _GLIBCXX_USE_FLOAT128.
* config.h.in: Remove references to _GLIBCXX_USE_FLOAT128.
* configure: Regenerate.
* include/Makefile.am: Replace the value of _GLIBCXX_USE_FLOAT128
based on ENABLE_FLOAT128.
* include/Makefile.in: Regenerate.
* include/bits/c++config: Define _GLIBCXX_USE_FLOAT128.
[!defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)]: Undefine
_GLIBCXX_USE_FLOAT128.
Jonathan Wakely [Tue, 7 Aug 2018 22:50:28 +0000 (23:50 +0100)]
Improve libstdc++ docs w.r.t newer C++ standards
Instead of repeating all the old headers for every new standard I've
changed the docs to only list the new headers for each standard.
Backport from mainline
2018-07-31 Jonathan Wakely <jwakely@redhat.com>
* doc/xml/manual/test.xml: Improve documentation on writing tests for
newer standards.
* doc/xml/manual/using.xml: Document all headers for C++11 and later.
* doc/html/*: Regenerate.
Jonathan Wakely [Tue, 7 Aug 2018 22:50:24 +0000 (23:50 +0100)]
PR libstdc++/60555 std::system_category() should recognise POSIX errno values
Backport from mainline
2018-08-03 Jonathan Wakely <jwakely@redhat.com>
* src/c++11/system_error.cc
(system_error_category::default_error_condition): Add workaround for
ENOTEMPTY and EEXIST having the same value on AIX.
* testsuite/19_diagnostics/error_category/system_category.cc: Add
extra testcases for EDOM, EILSEQ, ERANGE, EEXIST and ENOTEMPTY.
Backport from mainline
2018-08-01 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60555
* src/c++11/system_error.cc
(system_error_category::default_error_condition): New override to
check for POSIX errno values.
* testsuite/19_diagnostics/error_category/generic_category.cc: New
* testsuite/19_diagnostics/error_category/system_category.cc: New
test.
Jonathan Wakely [Tue, 7 Aug 2018 22:50:19 +0000 (23:50 +0100)]
PR libstdc++/86861 Meet precondition for Solaris memalign
Solaris memalign requires alignment to be at least sizeof(int), so
increase it as needed.
Also move the check for valid alignments from the fallback
implementation of aligned_alloc into operator new, as it's required for
all of aligned_alloc, memalign, posix_memalign and __aligned_malloc.
Backport from mainline
2018-08-07 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/86861
* libsupc++/new_opa.cc [_GLIBCXX_HAVE_MEMALIGN] (aligned_alloc):
Replace macro with inline function.
[__sun]: Increase alignment to meet memalign precondition.
[!HAVE__ALIGNED_MALLOC && !HAVE_POSIX_MEMALIGN && !HAVE_MEMALIGN]
(aligned_alloc): Move check for valid alignment to operator new.
Remove redundant check for non-zero size, it's enforced by the caller.
(operator new): Move check for valid alignment here. Use
__builtin_expect on check for zero size.
Jonathan Wakely [Tue, 7 Aug 2018 22:50:06 +0000 (23:50 +0100)]
Fix std::codecvt_utf8<wchar_t> for Mingw
Backport from mainline
2018-05-19 Jonathan Wakely <jwakely@redhat.com>
* src/c++11/codecvt.cc (__codecvt_utf8_base<wchar_t>::do_in)
[__SIZEOF_WCHAR_T__==2 && __BYTE_ORDER__!=__ORDER_BIG_ENDIAN__]: Set
little_endian element in bitmask.
* testsuite/22_locale/codecvt/codecvt_utf8/69703.cc: Run all tests.
* testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc: New.
backport: re PR middle-end/86705 (pr45678-2.c ICE with msp430-elf -mlarge)
2018-08-02 Jozef Lawrynowicz <jozef.l@mittosystems.com>
Backport from mainline
2018-07-31 Jozef Lawrynowicz <jozef.l@mittosystems.com>
PR middle-end/86705
* gcc/cfgexpand.c (set_parm_rtl): Use the alignment of Pmode when
MAX_SUPPORTED_STACK_ALIGNMENT would otherwise be exceeded by the
requested variable alignment.
(expand_one_ssa_partition): Likewise.
(expand_one_var): Likewise.