- 20 Feb, 2020 17 commits
-
-
shufps moves two of the four packed single-precision floating-point values from *destination* operand (first operand) into the low quadword of the destination operand. Match source operand to the destination. PR target/93828 * config/i386/mmx.md (*vec_extractv2sf_1): Match source operand to destination operand for shufps alternative. (*vec_extractv2si_1): Ditto. testsuite/ChangeLog: PR target/93828 * g++.target/i386/pr93828.C: New test.
Uros Bizjak committed -
This fixes a dangling-reference issue with views::split and other multi-argument adaptors that may take its extra arguments by reference. When creating the _RangeAdaptorClosure in _RangeAdaptor::operator(), we currently capture all provided arguments by value. When we then use the _RangeAdaptorClosure and call it with a range, as in e.g. v = views::split(p)(range), we forward the range and the captures to the underlying adaptor routine. But then when the temporary _RangeAdaptorClosure goes out of scope, the by-value captures get destroyed and the references to these captures in the resulting view become dangling. This patch fixes this problem by capturing lvalue references by reference in _RangeAdaptorClosure::operator(), and then forwarding the captures appropriately to the underlying adaptor routine. libstdc++-v3/ChangeLog: * include/std/ranges (views::__adaptor::__maybe_refwrap): New utility function. (views::__adaptor::_RangeAdaptor::operator()): Add comments. Use __maybe_refwrap to capture lvalue references by reference, and then use unwrap_reference_t to forward the by-reference captures as references. * testsuite/std/ranges/adaptors/split.cc: Augment test. * testsuite/std/ranges/adaptors/split_neg.cc: New test.
Patrick Palka committed -
We are forwarding the second argument of views::iota using the wrong type, causing compile errors when calling views::iota with a value and bound of different types, like in the test case below. libstdc++-v3/ChangeLog: * include/std/ranges (iota_view): Forward declare _Sentinel. (iota_view::_Iterator): Befriend _Sentinel. (iota_view::_Sentinel::_M_equal): New member function. (iota_view::_Sentinel::operator==): Use it. (views::_Iota::operator()): Forward __f using the correct type. * testsuite/std/ranges/access/ssize.cc (test06): Don't call views::iota with integers of different signedness, to appease iota_view's deduction guide. * testsuite/std/ranges/iota/iota_view.cc: Augment test.
Patrick Palka committed -
Previous push didn't get the ChangeLog entries or the actual fix. Push those now. gcc/ PR target/93658 * config/rs6000/rs6000.c (rs6000_legitimate_address_p): Handle VSX vector modes. gcc/testsuite/ PR target/93658 * gcc.target/powerpc/pr93658.c: New test.
Peter Bergner committed -
2020-02-20 Tobias Burnus <tobias@codesourcery.com> PR fortran/93825 * openmp.c (resolve_oacc_loop_blocks): Move call to resolve_oacc_nested_loops from here ... (resolve_oacc_loop): ... to here. PR fortran/93825 * gfortran.dg/goacc/tile-3.f90: New.
Tobias Burnus committed -
Fix rs6000_legitimate_address_p(), which erroneously marks a valid Altivec address as being invalid, which causes LRA's process_address() to go into an infinite loop spilling the same address over and over again. gcc/ PR target/93658 * config/rs6000/rs6000.c (rs6000_legitimate_address_p): Handle VSX vector modes. gcc/testsuite/ PR target/93658 * gcc.target/powerpc/pr93658.c: New test.
Peter Bergner committed -
This changes how arrays of unknown bound and/or incomplete element type are handled. * include/bits/range_access.h (ranges::begin): Reject array of incomplete type. (ranges::end, ranges::size): Require arrays to be bounded. (ranges::data): Require lvalue or borrowed_range. (ranges::iterator_t): Remove constraint. * testsuite/std/ranges/access/begin.cc: Do not check array of incomplete type. * testsuite/std/ranges/access/begin_neg.cc: New test. * testsuite/std/ranges/access/end_neg.cc: Adjust expected error. * testsuite/std/ranges/access/size_neg.cc: Adjust expected error. * testsuite/std/ranges/access/ssize.cc: Do not check array of incomplete type.
Jonathan Wakely committed -
Another piece of P1614R2 for C++20. This also adds tests for operator< in C++11, which was present but untested. * include/std/system_error (error_category::operator<=>) (operator<=>(const error_code&, const error_code&)) (operator<=>(const error_condition&, const error_condition&)): Define for C++20. * testsuite/19_diagnostics/error_category/operators/less.cc: New test. * testsuite/19_diagnostics/error_category/operators/three_way.cc: New test. * testsuite/19_diagnostics/error_code/operators/equal.cc: Remove incorrect comment. * testsuite/19_diagnostics/error_code/operators/less.cc: New test. * testsuite/19_diagnostics/error_code/operators/not_equal.cc: Remove incorrect comment. * testsuite/19_diagnostics/error_code/operators/three_way.cc: New test. * testsuite/19_diagnostics/error_condition/operators/equal.cc: Remove incorrect comment. * testsuite/19_diagnostics/error_condition/operators/less.cc: New test. * testsuite/19_diagnostics/error_condition/operators/not_equal.cc: Remove incorrect comment. * testsuite/19_diagnostics/error_condition/operators/three_way.cc: New test.
Jonathan Wakely committed -
This function can be synthesized by the compiler now. * libsupc++/typeinfo (type_info::operator!=): Remove for C++20.
Jonathan Wakely committed -
* include/std/thread (thread::id::operator<=>): Define for C++20. * testsuite/30_threads/thread/id/70294.cc: Do not take addresses of functions in namespace std. * testsuite/30_threads/thread/id/operators_c++20.cc: New test.
Jonathan Wakely committed -
PR translation/93841 * config/or1k/or1k.opt: Remove superfluous word. * doc/invoke.texi: Likewise.
Martin Liska committed -
PR translation/93838 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
Martin Liska committed -
PR translation/93831 * config/darwin.c (darwin_override_options): Change 64b to 64-bit mode.
Martin Liska committed -
PR translation/93830 * common/config/avr/avr-common.c: Remote trailing "|".
Martin Liska committed -
* de.po: Update.
Joseph Myers committed -
GCC Administrator committed
-
In order to detect modifying constant objects in constexpr evaluation, which is UB, in r10-2655 I added code that sets TREE_READONLY on CONSTRUCTORs of const-qualified objects after they have been fully constructed. But I never made sure that what we're setting the flag on actually is a CONSTRUCTOR. Consequently, as this test case shows, we could set TREE_READONLY on a VAR_DECL that in fact wasn't constant, causing problems later. Fixed by setting the flag on CONSTRUCTORs only, and only when the evaluation produced something constant. 2020-02-19 Marek Polacek <polacek@redhat.com> PR c++/93169 - wrong-code with a non-constexpr constructor. * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY on constant CONSTRUCTORs. * g++.dg/cpp0x/constexpr-93169.C: New test.
Marek Polacek committed
-
- 19 Feb, 2020 23 commits
-
-
gcc/testsuite/ChangeLog: * gcc.dg/strlenopt-81.c: Align arrays to let strictly aligned targets optimize away calls as expected.
Martin Sebor committed -
libstdc++-v3/ChangeLog: * testsuite/std/ranges/adaptors/split.cc (test03): Don't include the null terminator of the underlying string as part of the test_range. (main): Call test03.
Patrick Palka committed -
* include/bits/stl_iterator.h (common_iterator): Add copyable<I> requirement (LWG 3385). * testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: Adjust expected declaration.
Jonathan Wakely committed -
* include/std/ranges (take_while_view, drop_view, drop_while_view) (elements_view:_Iterator): Initialize data members (LWG 3364).
Jonathan Wakely committed -
This also removes a useless condition that was supposed to be removed by the P1959R0 changes, but left in when that was implemented. * libsupc++/compare (three_way_comparable): Remove always-false check that should have been removed with weak_equality (P1959R0). (three_way_comparable_with): Likewise. Reorder requirements (LWG 3360).
Jonathan Wakely committed -
* include/std/concepts (__detail::__partially_ordered_with): Move here from <compare>. (totally_ordered, totally_ordered_with): Use __partially_ordered_with to simplify definition (LWG 3331). * libsupc++/compare (__detail::__partially_ordered_with): Move to <concepts>.
Jonathan Wakely committed -
* include/std/concepts (totally_ordered_with): Remove redundant requirement (LWG 3329).
Jonathan Wakely committed -
* include/std/ranges (__detail::__convertible_to_non_slicing): New helper concept. (__detail::__pair_like_convertible_to): Remove. (__detail::__pair_like_convertible_from): Add requirements for non-slicing conversions. (subrange): Constrain constructors with __convertible_to_non_slicing. Remove constructors from pair-like types. Add new deduction guide. * testsuite/std/ranges/subrange/lwg3282_neg.cc: New test.
Jonathan Wakely committed -
* include/bits/iterator_concepts.h (iter_move): Add declaration to prevent unqualified lookup finding a suitable declaration (LWG 3247).
Jonathan Wakely committed -
* gcc.dg/gimplefe-41.c: Add -msse2 additional options for x86 targets. * gcc.dg/ipa/ipa-sra-19.c: Ditto.
Uros Bizjak committed -
2020-02-19 Bernd Edlinger <bernd.edlinger@hotmail.de> * collect2.c (maybe_run_lto_and_relink): Fix typo in comment.
Bernd Edlinger committed -
* include/std/memory_resource (polymorphic_allocator::allocate) (polymorphic_allocator::allocate_object): Change type of exception to bad_array_new_length (LWG 3237). * testsuite/20_util/polymorphic_allocator/lwg3237.cc: New test.
Jonathan Wakely committed -
We already defined the traits in <type_traits> as now required by LWG 3348, but the macro was missing. This adds it. * include/std/type_traits (__cpp_lib_unwrap_ref): Define (LWG 3348). * include/std/version (__cpp_lib_unwrap_ref): Likewise. * testsuite/20_util/unwrap_reference/1.cc: Check macro. * testsuite/20_util/unwrap_reference/3.cc: New test.
Jonathan Wakely committed -
* include/std/numeric (midpoint(T8, T*)): Do not check for complete type during overload resolution, use static assert instead (LWG 3200). * testsuite/26_numerics/midpoint/pointer.cc: Do not test with incomplete type. * testsuite/26_numerics/midpoint/pointer_neg.cc: New test.
Jonathan Wakely committed -
The 23_containers/span/deduction.cc test was already passing, but only because I had previously implemented the original proposed resolution of 3255. As pointed out in 3255 that original P/R was incorrect because it broke construction from array xvalues. This reverts the incorrect part of 3255 (and adds tests for the case it broke), and implements the resolution of 3369 instead. * include/std/span (span(T (&)[N])): Use non-deduced context to prevent first parameter from interfering with class template argument deduction (LWG 3369). * testsuite/23_containers/span/deduction.cc: Add missing 'const'. * testsuite/23_containers/span/lwg3255.cc: Check for construction from rvalues.
Jonathan Wakely committed -
* include/std/span (span::const_iterator, span::const_reverse_iterator) (span::cbegin(), span::cend(), span::crbegin(), span::crend()): Remove (LWG 3320). * testsuite/23_containers/span/everything.cc: Replace uses of cbegin and cend. * testsuite/20_util/specialized_algorithms/destroy/constrained.cc: Likewise. * testsuite/20_util/specialized_algorithms/uninitialized_copy/ constrained.cc: Likewise. * testsuite/20_util/specialized_algorithms/ uninitialized_default_construct/constrained.cc: Likewise. * testsuite/20_util/specialized_algorithms/uninitialized_fill/ constrained.cc: Likewise. * testsuite/20_util/specialized_algorithms/uninitialized_move/ constrained.cc: Likewise. * testsuite/20_util/specialized_algorithms/ uninitialized_value_construct/constrained.cc: Likewise.
Jonathan Wakely committed -
This PR is a regression caused by r256644, which added support for alias checks involving variable strides. One of the changes in that commit was to split the access size out of the segment length. The PR shows that I hadn't done that correctly for the handling of negative strides in vect_compile_time_alias. The old code was: const_length_a = (-wi::to_poly_wide (segment_length_a)).force_uhwi (); offset_a = (offset_a + vect_get_scalar_dr_size (a)) - const_length_a; where vect_get_scalar_dr_size (a) was cancelling out the subtraction of the access size inherent in "- const_length_a". Taking the access size out of the segment length meant that the addition was no longer needed/correct. 2020-02-19 Richard Sandiford <richard.sandiford@arm.com> gcc/ PR tree-optimization/93767 * tree-vect-data-refs.c (vect_compile_time_alias): Remove the access-size bias from the offset calculations for negative strides. gcc/testsuite/ PR tree-optimization/93767 * gcc.dg/vect/pr93767.c: New test.
Richard Sandiford committed -
* include/bits/range_access.h (range_size_t): Define alias template. * include/std/ranges (all_view): Rename to views::all_t (LWG 3335). * testsuite/std/ranges/adaptors/filter.cc: Adjust to new name.
Jonathan Wakely committed -
* include/std/ranges (filter_view, transform_view, take_view) (join_view, split_view, reverse_view): Remove commented-out converting constructors (LWG 3280).
Jonathan Wakely committed -
* include/std/memory (uninitialized_construct_using_allocator): Use std::construct_at (LWG 3321).
Jonathan Wakely committed -
* include/std/memory_resource (polymorphic_allocator::allocate_bytes) (polymorphic_allocator::allocate_object) (polymorphic_allocator::new_object): Add nodiscard attribute (LWG3304).
Jonathan Wakely committed -
* include/bits/range_access.h (enable_safe_range): Rename to enable_borrowed_range. (__detail::__maybe_safe_range): Rename to __maybe_borrowed_range. (safe_range): Rename to borrowed_range. * include/bits/ranges_algo.h: Adjust to use new names. * include/bits/ranges_algobase.h: Likewise. * include/bits/ranges_uninitialized.h: Likewise. * include/std/ranges: Likewise. (safe_iterator_t): Rename to borrowed_iterator_t. (safe_subrange_t): Rename to borrowed_subrange_t. * include/std/span: Adjust to use new names. * include/std/string_view: Likewise. * include/experimental/string_view: Likewise. * testsuite/std/ranges/access/begin.cc: Likewise. * testsuite/std/ranges/access/cbegin.cc: Likewise. * testsuite/std/ranges/access/cdata.cc: Likewise. * testsuite/std/ranges/access/cend.cc: Likewise. * testsuite/std/ranges/access/crbegin.cc: Likewise. * testsuite/std/ranges/access/crend.cc: Likewise. * testsuite/std/ranges/access/data.cc: Likewise. * testsuite/std/ranges/access/end.cc: Likewise. * testsuite/std/ranges/access/rbegin.cc: Likewise. * testsuite/std/ranges/access/rend.cc: Likewise. * testsuite/std/ranges/safe_range.cc: Likewise. * testsuite/std/ranges/safe_range_types.cc: Likewise. * testsuite/util/testsuite_iterators.h: Likewise.
Jonathan Wakely committed -
* include/std/ranges (tuple_element<0, const subrange<I, S, K>>) (tuple_element<1, const subrange<I, S, K>>): Add partial specializations (LWG 3398). * testsuite/std/ranges/subrange/tuple_like.cc: New test.
Jonathan Wakely committed
-