Uros Bizjak [Sat, 25 Mar 2017 19:47:14 +0000 (20:47 +0100)]
re PR target/80180 (Incorrect codegen from rdseed intrinsic use (CVE-2017-11671))
PR target/80180
* config/i386/i386.c (ix86_expand_builtin)
<IX86_BUILTIN_RDSEED{16,32,64}_STEP>: Do not expand arg0 between
flags reg setting and flags reg using instructions.
<IX86_BUILTIN_RDRAND{16,32,64}_STEP>: Ditto. Use non-flags reg
clobbering instructions to zero extend op2.
Martin Liska [Wed, 22 Mar 2017 14:59:44 +0000 (15:59 +0100)]
Backport r245647
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-02-22 Martin Liska <mliska@suse.cz>
PR lto/79587
* data-streamer-in.c (streamer_read_gcov_count): Remove assert.
* data-streamer-out.c (streamer_write_gcov_count_stream):
Likewise.
* value-prof.c (stream_out_histogram_value): Make assert more
precise based on type of counter.
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-02-22 Martin Liska <mliska@suse.cz>
PR lto/79587
* gcc.dg/tree-prof/pr79587.c: New test.
Martin Liska [Wed, 22 Mar 2017 12:32:56 +0000 (13:32 +0100)]
Backport r246321
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-21 Martin Liska <mliska@suse.cz>
PR gcov-profile/80081
* Makefile.in: Add gcov-dump and fix installation of gcov-tool.
* doc/gcc.texi: Include gcov-dump stuff.
* doc/gcov-dump.texi: New file.
Martin Liska [Wed, 22 Mar 2017 12:32:17 +0000 (13:32 +0100)]
Backport r246276
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-20 Martin Liska <mliska@suse.cz>
PR middle-end/79753
* tree-chkp.c (chkp_build_returned_bound): Do not build
returned bounds for a LHS that's not a BOUNDED_P type.
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-20 Martin Liska <mliska@suse.cz>
PR middle-end/79753
* gcc.target/i386/mpx/pr79753.c: New test.
Martin Liska [Wed, 22 Mar 2017 12:31:04 +0000 (13:31 +0100)]
Backport r246098
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-13 Martin Liska <mliska@suse.cz>
PR middle-end/78339
* ipa-pure-const.c (warn_function_noreturn): If the declarations
is a CHKP clone, use original declaration.
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-13 Martin Liska <mliska@suse.cz>
PR middle-end/78339
* gcc.target/i386/mpx/pr78339.c: New test.
* toplev.c (process_options): Enable MPX with LSAN and UBSAN.
* tree-chkp.c (chkp_walk_pointer_assignments): Verify that
FIELD != NULL.
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2016-06-13 Martin Liska <mliska@suse.cz>
PR sanitizer/71458
* gcc.target/i386/pr71458.c: New test.
Martin Liska [Wed, 22 Mar 2017 12:29:56 +0000 (13:29 +0100)]
Backport r245998
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-09 Martin Liska <mliska@suse.cz>
PR tree-optimization/79631
* tree-chkp-opt.c (chkp_is_constant_addr): Call
tree_int_cst_sign_bit just for INTEGER constants.
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-09 Martin Liska <mliska@suse.cz>
PR tree-optimization/79631
* gcc.target/i386/mpx/pr79631.c: New test.
Martin Liska [Wed, 22 Mar 2017 12:29:36 +0000 (13:29 +0100)]
Backport r245993
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-09 Martin Liska <mliska@suse.cz>
PR ipa/79761
* tree-chkp.c (chkp_get_bound_for_parm): Get bounds for a param.
(chkp_find_bounds_1): Remove gcc_unreachable.
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-09 Martin Liska <mliska@suse.cz>
Martin Liska [Wed, 22 Mar 2017 12:28:50 +0000 (13:28 +0100)]
Backport r245869
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-03 Martin Liska <mliska@suse.cz>
PR tree-optimization/79803
* tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Remove
assert.
(pass_loop_prefetch::execute): Disabled optimization if an
assumption about L1 cache size is not met.
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-03-03 Martin Liska <mliska@suse.cz>
PR tree-optimization/79803
* gcc.dg/tree-ssa/pr79803.c: New test.
Jonathan Wakely [Fri, 17 Mar 2017 19:28:42 +0000 (19:28 +0000)]
Backport <codecvt> fixes from trunk
Fix alignment bugs in std::codecvt_utf16
* src/c++11/codecvt.cc (range): Add non-type template parameter and
define oerloaded operators for reading and writing code units.
(range<Elem, false>): Define partial specialization for accessing
wide characters in potentially unaligned byte ranges.
(ucs2_span(const char16_t*, const char16_t*, ...))
(ucs4_span(const char16_t*, const char16_t*, ...)): Change parameters
to range<const char16_t, false> in order to avoid unaligned reads.
(__codecvt_utf16_base<char16_t>::do_out)
(__codecvt_utf16_base<char32_t>::do_out)
(__codecvt_utf16_base<wchar_t>::do_out): Use range specialization for
unaligned data to avoid unaligned writes.
(__codecvt_utf16_base<char16_t>::do_in)
(__codecvt_utf16_base<char32_t>::do_in)
(__codecvt_utf16_base<wchar_t>::do_in): Likewise for writes. Return
error if there are unprocessable trailing bytes.
(__codecvt_utf16_base<char16_t>::do_length)
(__codecvt_utf16_base<char32_t>::do_length)
(__codecvt_utf16_base<wchar_t>::do_length): Pass arguments of type
range<const char16_t, false> to span functions.
* testsuite/22_locale/codecvt/codecvt_utf16/misaligned.cc: New test.
PR libstdc++/80041 fix codecvt_utf16<wchar_t> to use UTF-16 not UTF-8
PR libstdc++/80041
* src/c++11/codecvt.cc (__codecvt_utf16_base<wchar_t>::do_out)
(__codecvt_utf16_base<wchar_t>::do_in): Convert char arguments to
char16_t to work with UTF-16 instead of UTF-8.
* testsuite/22_locale/codecvt/codecvt_utf16/80041.cc: New test.
Fix encoding() and max_length() values for codecvt facets
* src/c++11/codecvt.cc (codecvt<char16_t, char, mbstate_t>)
(codecvt<char32_t, char, mbstate_t>, __codecvt_utf8_base<char16_t>)
(__codecvt_utf8_base<char32_t>, __codecvt_utf8_base<wchar_t>)
(__codecvt_utf16_base<char16_t>, __codecvt_utf16_base<char32_t>)
(__codecvt_utf16_base<wchar_t>, __codecvt_utf8_utf16_base<char16_t>)
(__codecvt_utf8_utf16_base<char32_t>)
(__codecvt_utf8_utf16_base<wchar_t>): Fix do_encoding() and
do_max_length() return values.
* testsuite/22_locale/codecvt/codecvt_utf16/members.cc: New test.
* testsuite/22_locale/codecvt/codecvt_utf8/members.cc: New test.
* testsuite/22_locale/codecvt/codecvt_utf8_utf16/members.cc: New test.
PR libstdc++/79980
* include/bits/locale_conv.h (__do_str_codecvt): Set __count on
error path.
* src/c++11/codecvt.cc (operator&=, operator|=, operator~): Overloads
for manipulating codecvt_mode values.
(read_utf16_bom): Compare input to BOM constants instead of integral
constants that depend on endianness. Take mode parameter by
reference and adjust it, to distinguish between no BOM present and
UTF-16BE BOM present.
(ucs4_in, ucs2_span, ucs4_span): Adjust calls to read_utf16_bom.
(surrogates): New enumeration type.
(utf16_in, utf16_out): Add surrogates parameter to choose between
UTF-16 and UCS2 behaviour.
(utf16_span, ucs2_span): Use std::min not std::max.
(ucs2_out): Use std::min not std::max. Disallow surrogate pairs.
(ucs2_in): Likewise. Adjust calls to read_utf16_bom.
* testsuite/22_locale/codecvt/codecvt_utf16/79980.cc: New test.
* testsuite/22_locale/codecvt/codecvt_utf8/79980.cc: New test.
PR libstdc++/79511 fix endianness of UTF-16 data
PR libstdc++/79511
* src/c++11/codecvt.cc (write_utf16_code_point): Don't write 0xffff
as a surrogate pair.
(__codecvt_utf8_utf16_base<char32_t>::do_in): Use native endianness
for internal representation.
(__codecvt_utf8_utf16_base<wchar_t>::do_in): Likewise.
* testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc: New test.
re PR libstdc++/80034 (unqualified calls to std::distance in std::list::sort)
PR libstdc++/80034
* include/bits/list.tcc (merge(list&&)): Use const for the size_t
in the function and in the catch-block, qualify uses of std::distance.
(merge(list&&, _StrictWeakOrdering)): Likewise.
* testsuite/23_containers/list/operations/80034.cc: New.
Bill Schmidt [Wed, 22 Feb 2017 22:54:56 +0000 (22:54 +0000)]
backport: re PR target/79261 (vec_xxpermdi appears to have endian issues)
[gcc]
2017-02-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Backport from mainline
2017-02-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR target/79261
* config/rs6000/rs6000.c (rs6000_expand_ternop_builtin): Add
support for CODE_FOR_vsx_xxpermdi_v2d[fi]_be.
* config/rs6000/rs6000.md (reload_gpr_from_vsx<mode>): Call
generator for vsx_xxpermdi_<mode>_be.
* config/rs6000/vsx.md (vsx_xxpermdi_<mode>): Remove logic to
force big-endian semantics.
(vsx_xxpermdi_<mode>_be): New define_expand with same
implementation as previous version of vsx_xxpermdi_<mode>.
[gcc/testsuite]
2017-02-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Backport from mainline
2017-02-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR target/79261
* gcc.target/powerpc/vec-xxpermdi.c: New file.
Carl Love [Thu, 16 Feb 2017 20:59:20 +0000 (20:59 +0000)]
backport: re PR target/79545 (gcc[5/6]: RS6000, xvcvuxdsp and xvcvsxdsp RTL defines have wrong type)
gcc/ChangeLog:
2017-02-16 Carl Love <cel@us.ibm.com>
Backport from mainline commit r245460 on 2017-02-14
PR 79545
* config/rs6000/rs6000.c: Add case statement entry to make the xvcvuxdsp
built-in argument unsigned.
* config/rs6000/vsx.md: Fix the source and return operand types so they
match the instruction definitions from the ISA document. Fix typo
in the instruction generation for the (define_insn "vsx_xvcvuxdsp"
statement.
gcc/testsuite/ChangeLog:
2017-01-16 Carl Love <cel@us.ibm.com>
Backport from mainline commit r245460 on 2017-02-14
PR 79545
* gcc.target/powerpc/vsx-builtin-3.c: Add missing test case for the
xvcvsxdsp and xvcvuxdsp instructions.
Jonathan Wakely [Tue, 14 Feb 2017 21:17:34 +0000 (21:17 +0000)]
PR69321 fix any_cast<T>(any*) for non-copyable T
Backport from mainline
2017-01-20 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/69321
* include/experimental/any (__any_caster): Avoid instantiating
manager function for types that can't be stored in any.
* testsuite/experimental/any/misc/any_cast.cc: Likewise.
* testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error.
Jonathan Wakely [Tue, 14 Feb 2017 21:17:23 +0000 (21:17 +0000)]
PR78702 fix accessibility of locale::facet::__shim
Backport from mainline
2017-01-16 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/78702
* include/bits/locale_classes.h (locale::facet::__shim): Change from
private to protected.
* src/c++11/cxx11-shim_facets.cc (__shim_accessor): Define helper to
make locale::facet::__shim accessible.
Jonathan Wakely [Tue, 14 Feb 2017 21:17:11 +0000 (21:17 +0000)]
PR78273 fix count to work with partitioning function
Backport from mainline
2017-01-11 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/78273
* include/bits/stl_map.h (map::count<_Kt>(const _Kt&)): Don't assume
the heterogeneous comparison can only find one match.
* include/bits/stl_set.h (set::count<_Kt>(const _Kt&)): Likewise.
* testsuite/23_containers/map/operations/2.cc: Test count works with
comparison function that just partitions rather than sorting.
* testsuite/23_containers/set/operations/2.cc: Likewise.