1. 11 Dec, 2019 28 commits
  2. 10 Dec, 2019 12 commits
    • libstdc++: Correct noexcept-specifiers on span constructors · cff87282
      As discussed at https://github.com/cplusplus/draft/issues/3534 two
      std::span constructors specify incorrect conditions for throwing
      exceptions. This patch makes those constructors have correct
      noexcept-specifiers that accurately reflect what can actually throw.
      
      	(span(ContiguousIterator, Sentinel)): Add conditional noexcept.
      	* include/std/span (span(ContiguousIterator, size_type)): Change
      	noexcept to be unconditionally true.
      	* testsuite/23_containers/span/nothrow_cons.cc: New test.
      
      From-SVN: r279206
      Jonathan Wakely committed
    • re PR tree-optimization/92891 (ice in decompose, at wide-int.h:984) · a6ae300f
      	PR tree-optimization/92891
      	* builtins.c (gimple_call_alloc_size): Convert size to sizetype
      	before returning it.
      
      	* gcc.c-torture/compile/pr92891.c: New test.
      
      From-SVN: r279205
      Jakub Jelinek committed
    • re PR rtl-optimization/92796 (ICE in lra_assign, at lra-assigns.c:1646 on powerpc64le-linux-gnu) · 7436a1c6
      2019-12-10  Vladimir Makarov  <vmakarov@redhat.com>
      
      	PR rtl-optimization/92796
      	* lra-int.h (lra_risky_transformations_p): Rename to
      	check_and_force_assignment_correctness_p.
      	* lra-assigns.c: Ditto.
      	(lra_assign): Reset check_and_force_assignment_correctness_p.
      	* lra-constraints.c (lra_risky_transformations_p): Rename to
      	check_and_force_assignment_correctness_p.
      	(lra_constraints): Set up check_and_force_assignment_correctness_p
      	only for the 1st sub-pass.
      	* lra-eliminations.c (process_insn_for_elimination): Set up
      	check_and_force_assignment_correctness_p if the insn chnaged its
      	code.
      
      2019-12-10  Vladimir Makarov  <vmakarov@redhat.com>
      
      	PR rtl-optimization/92796
      	* gcc.target/powerpc/pr92796.c: New test.
      
      From-SVN: r279204
      Vladimir Makarov committed
    • re PR fortran/91643 (ICE in gfc_trans_create_temp_array, at fortran/trans-array.c:1265) · 0cc063af
      2019-12-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
          PR fortran/91643
          * trans-array.c (gfc_conv_array_parameter): Do not repack
          an assumed rank dummy argument.
      
      2019-12-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
          PR fortran/91643
          * gfortran.dg/assumed_rank_18.f90: New test.
      
      From-SVN: r279203
      Thomas Koenig committed
    • libstdc++: Rework std::copy/copy_backward/move/move_backward/fill/fill_n algos · 6004c17b
      Enhance those algos overloads to generalize existing optimization for
      __gnu_debug::_Safe_iterator w/o _GLIBCXX_DEBUG mode and for std::deque
       iterators.
      
      Also extend __copy_move_a2 ostreambuf_iterator overloads to std::vector and
      std::deque iterators.
      
      	* include/bits/stl_algobase.h
      	(__copy_move_a1<>(_II, _II, _OI)): New.
      	(__copy_move_a1<>(_Deque_iterator<>, _Deque_iterator<>, _OI)): New.
      	(__copy_move_a1<>(_Deque_iterator<>, _Deque_iterator<>,
      	_Deque_iterator<>)): New.
      	(__copy_move_a1<>(_II, _II, _Deque_iterator<>)): New.
      	(__copy_move_a<>(_II, _II, _OI)): Adapt, call __copy_move_a1<>.
      	(__copy_move_a<>(const _Safe_iterator<>&, const _Safe_iterator<>&,
      	_OI)): New.
      	(__copy_move_a<>(const _Safe_iterator<>&, const _Safe_iterator<>&,
      	 const _Safe_iterator<>&)): New.
      	(__copy_move_a<>(_II, _II, const _Safe_iterator<>&)): New.
      	(copy, move): Adapt, call __copy_move_a.
      	(__copy_move_backward_a1<>(_II, _II, _OI)): New,
      	call __copy_move_backward_a2.
      	(__copy_move_backward_a1<>(_Deque_iterator<>, _Deque_iterator<>, _OI)): New.
      	(__copy_move_backward_a1<>(_Deque_iterator<>, _Deque_iterator<>,
      	_Deque_iterator<>)): New.
      	(__copy_move_backward_a1<>(_II, _II, _Deque_iterator<>)): New.
      	(__copy_move_backward_a<>(_II, _II, _OI)): Adapt, call
      	__copy_move_backward_a1<>.
      	(__copy_move_backward_a<>(const _Safe_iterator<>&, const _Safe_iterator<>&,
      	_OI)): New.
      	(__copy_move_backward_a<>(const _Safe_iterator<>&, const _Safe_iterator<>&,
      	 const _Safe_iterator<>&)): New.
      	(__copy_move_backward_a<>(_II, _II, const _Safe_iterator<>&)): New.
      	(copy_backward, move_backward): Adapt, call __copy_move_backward_a<>.
      	(__fill_a): Rename into...
      	(__fill_a1): ... this.
      	(__fill_a1(__normal_iterator<>, __normal_iterator<>, const _Tp&)): New.
      	(__fill_a1(const _Deque_iterator<>&, const _Deque_iterator<>&, _VTp)):
      	New.
      	(__fill_a(_FIte, _FIte, const _Tp&)): New, call __fill_a1.
      	(__fill_a(const _Safe_iterator<>&, const _Safe_iterator<>&,
      	const _Tp&)): New.
      	(fill): Adapt, remove __niter_base usage.
      	(__fill_n_a): Rename into...
      	(__fill_n_a1): ...this.
      	(__fill_n_a(const _Safe_iterator<>&, _Size, const _Tp&,
      	input_iterator_tag)): New.
      	(__fill_n_a(_OI, _Size, const _Tp&, output_iterator_tag)): New, call
      	__fill_n_a1.
      	(__fill_n_a(_OI, _Size, const _Tp&, random_access_iterator_tag)): New,
      	call __fill_a.
      	(__equal_aux): Rename into...
      	(__equal_aux1): ...this.
      	(__equal_aux1(_Deque_iterator<>, _Deque_iterator<>, _OI)): New.
      	(__equal_aux1(_Deque_iterator<>, _Deque_iterator<>,
      	_Deque_iterator<>)): New.
      	(__equal_aux1(_II, _II, _Deque_iterator<>)): New.
      	(__equal_aux(_II1, _II1, _II2)): New, call __equal_aux1.
      	(__equal_aux(const _Safe_iterator<>&, const _Safe_iterator<>&,
      	_OI)): New.
      	(__equal_aux(const _Safe_iterator<>&, const _Safe_iterator<>&,
      	 const _Safe_iterator<>&)): New.
      	(__equal_aux(_II, _II, const _Safe_iterator<>&)): New.
      	(equal(_II1, _II1, _II2)): Adapt.
      	* include/bits/stl_deque.h
      	(fill, copy, copy_backward, move, move_backward): Remove.
      	* include/bits/deque.tcc: Include <bits/stl_algobase.h>.
      	(__fill_a1): New.
      	(__copy_move_dit): New.
      	(__copy_move_a1): New, use latter.
      	(__copy_move_a1(_II, _II, _Deque_iterator<>)): New.
      	(__copy_move_backward_dit): New.
      	(__copy_move_backward_a1): New, use latter.
      	(__copy_move_backward_a1(_II, _II, _Deque_iterator<>)): New.
      	(__equal_dit): New.
      	(__equal_aux1): New, use latter.
      	(__equal_aux1(_II, _II, _Deque_iterator<>)): New.
      	* include/std/numeric (__is_random_access_iter): Move...
      	* include/bits/stl_iterator_base_types.h (__is_random_access_iter): ...
      	here. Provide pre-C++11 definition.
      	* include/debug/debug.h (_Safe_iterator<>): New declaration.
      	* include/debug/safe_iterator.h (_Safe_iterator<>::_M_can_advance): Add
      	__strict parameter.
      	* include/debug/safe_iterator.tcc: Include <bits/stl_algobase.h>.
      	(_Safe_iterator<>::_M_can_advance): Adapt.
      	(std::__copy_move_a, std::__copy_move_backward_a, __fill_a): New.
      	(__fill_n_a, __equal_aux): New.
      	* include/debug/stl_iterator.h (__niter_base): Remove.
      	* include/debug/vector (__niter_base): Remove.
      	* testsuite/performance/25_algorithms/copy_backward_deque_iterators.cc:
      	Include <vector> and <list>. Add benches.
      	* testsuite/performance/25_algorithms/copy_deque_iterators.cc: Likewise.
      	* testsuite/performance/25_algorithms/equal_deque_iterators.cc: Likewise.
      	* testsuite/25_algorithms/copy/debug/1_neg.cc: New.
      	* testsuite/25_algorithms/copy/deque_iterators/2.cc: New.
      	* testsuite/25_algorithms/copy/deque_iterators/31.cc: New.
      	* testsuite/25_algorithms/copy/deque_iterators/32.cc: New.
      	* testsuite/25_algorithms/copy/deque_iterators/33.cc: New.
      	* testsuite/25_algorithms/copy/deque_iterators/41.cc: New.
      	* testsuite/25_algorithms/copy/deque_iterators/42.cc: New.
      	* testsuite/25_algorithms/copy/deque_iterators/43.cc: New.
      	* testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc (test02):
      	New.
      	* testsuite/25_algorithms/copy_backward/deque_iterators/2.cc: New.
      	* testsuite/25_algorithms/equal/deque_iterators/1.cc: New.
      	* testsuite/25_algorithms/fill/deque_iterators/1.cc: New.
      	* testsuite/25_algorithms/move/deque_iterators/2.cc: New.
      	* testsuite/25_algorithms/move_backward/deque_iterators/2.cc: New.
      
      From-SVN: r279201
      François Dumont committed
    • re PR rtl-optimization/92882 (ICE in regstat_bb_compute_calls_crossed, at… · 5e72bcc1
      re PR rtl-optimization/92882 (ICE in regstat_bb_compute_calls_crossed, at regstat.c:327 since r279124)
      
      	PR rtl-optimization/92882
      	* regstat.c (regstat_bb_compute_calls_crossed): Don't check
      	INSN_UID against DF_INSN_SIZE or use DF_INSN_INFO_GET unless
      	NONDEBUG_INSN_P.
      
      	* gfortran.dg/pr92882.f: New test.
      
      From-SVN: r279196
      Jakub Jelinek committed
    • re PR ipa/92883 (ICE in compare_values_warnv) · 27f418b8
      	PR ipa/92883
      	* ipa-cp.c (propagate_vr_across_jump_function): Pass jvr rather
      	than *jfunc->m_vr to intersect.  Formatting fix.
      
      	* gcc.dg/ipa/pr92883.c: New test.
      
      From-SVN: r279194
      Jakub Jelinek committed
    • re PR middle-end/92825 (Unnecesary stack protection in Firefox's LightPixel.) · 6b24e342
      	PR middle-end/92825
      	* cfgexpand.c (add_stack_protection_conflicts): Change return type
      	from void to bool, return true if at least one stack_vars[i].decl
      	is addressable.
      	(record_or_union_type_has_array_p, stack_protect_decl_p): Remove.
      	(expand_used_vars): Don't call stack_protect_decl_p, instead for
      	-fstack-protector-strong set gen_stack_protect_signal to true
      	if add_stack_protection_conflicts returned true.  Formatting fixes.
      	* doc/invoke.texi (-fstack-protector-strong): Clarify that optimized
      	out variables or variables not living on the stack don't count.
      	(-fstack-protector): Likewise.  Clarify it affects >= 8 byte arrays
      	rather than > 8 byte.
      
      	* gcc.target/i386/pr92825.c: New test.
      
      From-SVN: r279193
      Jakub Jelinek committed
    • * ipa-param-manipulation.c · 6b6a8065
      	(ipa_param_body_adjustments::register_replacement): Fix comment typo
      	- accross -> across.
      	* ipa-sra.c (propagate_used_across_scc_edge, ipa_sra_analysis):
      	Likewise.
      	(param_splitting_across_edge): Fix typo in dump message - accross
      	-> across.
      
      From-SVN: r279188
      Jakub Jelinek committed
    • PR c++/92847 - C++20 comparison ambiguity with class template. · eff66cd2
      This testcase demonstrates that looking at cand->template_decl is not a good
      starting place for finding the most general template, as it is only set for
      primary templates.
      
      	* call.c (cand_parms_match): Handle all templated functions.
      
      From-SVN: r279185
      Jason Merrill committed
    • Fix C++20 structural type vs. private base. · 09b661ce
      In my patch to implement C++20 "structural type" I tried to set the access
      flags on the artificial base fields appropriately, but failed.  I was
      copying TREE_PRIVATE from the binfo, but TREE_PRIVATE on binfo is just a
      temporary cache for dfs_access_in_type; we really need to get the
      inheritance access information from BINFO_BASE_ACCESSES.
      
      	* class.c (build_base_field_1): Take access parameter.
      	(build_base_field): Likewise.
      	(build_base_fields, layout_virtual_bases): Pass it.
      	* tree.c (structural_type_p): Improve private base diagnostic.
      
      From-SVN: r279184
      Jason Merrill committed
    • PR c++/92560 - ICE with decltype and rewritten operator. · 1fb81d83
      A call as the immediate operand of decltype is handled differently; we don't
      create an object of the return type as we do normally.  But in the case of a
      rewritten operator, we're adding another call as a wrapper, so the inner
      call doesn't get the special handling.
      
      	* call.c (build_new_op_1): Clear tf_decltype on inner call.
      
      From-SVN: r279183
      Jason Merrill committed