Commit Graph

163663 Commits

Author SHA1 Message Date
David Edelsohn 464c1bd834 * async.h (ASYNC_IO): Revert _AIX test.
From-SVN: r263821
2018-08-23 15:33:45 -04:00
Jonathan Wakely 763ef11bff Fix failure when -fno-rtti test is run in C++17 or later
* testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource):
	Only define when RTTI is enabled.

From-SVN: r263820
2018-08-23 20:27:54 +01:00
Prathamesh Kulkarni 429ca5b480 tree-vect-data-refs.c (vect_grouped_store_supported): Fix typo "permutaion".
2018-08-23  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	* tree-vect-data-refs.c (vect_grouped_store_supported): Fix typo
	"permutaion".

From-SVN: r263819
2018-08-23 18:22:10 +00:00
Giuliano Belinassi 35574a7b41 Fix typo 'exapnded' to 'expanded'
2018-08-23  Giuliano Belinassi  <giuliano.belinassi@usp.br>

gcc/
	* genmatch.c (parser::parse_operation): Fix typo 'exapnded'
	to 'expanded'.

gcc/ada/
	* exp_unst.ads: Fix typo 'exapnded' to 'expanded'.

From-SVN: r263818
2018-08-23 17:01:09 +00:00
Alexander Monakov 47a5f7dda5 scev: dump final value replacement expressions
* tree-scalar-evolution.c (final_value_replacement_loop): Dump
	full GENERIC expression used for replacement.

From-SVN: r263817
2018-08-23 19:01:12 +03:00
Jonathan Wakely 568d5ee44d Define debug mode function for C++98
This function is declared unconditionally but was only defined for C++11
and later, leading to linker errors when the testsuite was run with
-std=gnu++98 -D_GLIBCXX_DEBUG added to the flags.

	* include/debug/vector (__niter_base): Define for C++98.

From-SVN: r263816
2018-08-23 16:23:31 +01:00
Jonathan Wakely c07870270a Fix C++98 tests to not use C++11 features.
* testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc:
	Fix C++98 test to not use C++11 features.
	* testsuite/25_algorithms/fill_n/2.cc: Likewise.

From-SVN: r263815
2018-08-23 16:10:45 +01:00
Jonathan Wakely 6de2ce26bc Fix comments in testsuite script
* scripts/check_compile: Fix comments.

From-SVN: r263814
2018-08-23 16:10:35 +01:00
Aldy Hernandez 6285219422 tree-vrp.c (abs_extent_range): Remove.
* tree-vrp.c (abs_extent_range): Remove.
	(extract_range_into_wide_ints): Pass wide ints by reference.
	(extract_range_from_binary_expr_1): Rewrite the *DIV_EXPR code.
	Pass wide ints by reference in all calls to
	extract_range_into_wide_ints.
	* wide-int-range.cc (wide_int_range_div): New.
	* wide-int-range.h (wide_int_range_div): New.
	(wide_int_range_includes_zero_p): New.
	(wide_int_range_zero_p): New.

From-SVN: r263813
2018-08-23 13:25:36 +00:00
Matthew Malcomson 488461d862 [AARCH64] use "arch_enabled" attribute for aarch64.
arm.md has some attributes "arch" and "arch_enabled" to aid enabling
and disabling insn alternatives based on the architecture being
targeted.  This patch introduces a similar attribute in the aarch64
backend.  The new attribute will be used to enable a new alternative
for the atomic_store insn in a future patch, but is an atomic change
in itself.

The new attribute has values "any", "fp", "fp16", "simd", and "sve".
These attribute values have been taken from the pre-existing
attributes "fp", "fp16", "simd", and "sve".

The standalone "fp" attribute has been reintroduced in terms of the
"arch" attribute as it's needed for the xgene1.md scheduling file --
the use in this file can't be changed to check for `(eq_attr "arch"
"fp")` as the file is reused by the arm.md machine description whose
'arch' attribute doesn't have an 'fp' value.

2018-08-23  Matthew Malcomson  <matthew.malcomson@arm.com>

	* config/aarch64/aarch64.md (arches): New enum.
	(arch): New enum attr.
	(arch_enabled): New attr.
	(enabled): Now uses arch_enabled only.
	(simd, sve, fp16): Removed attribute.
	(fp): Attr now defined in terms of 'arch'.
	(*mov<mode>_aarch64, *movsi_aarch64, *movdi_aarch64, *movti_aarch64,
	*movhf_aarch64, <optab><fcvt_target><GPF:mode>2,
	<FCVT_F2FIXED:fcvt_fixed_insn><GPF:mode>3,
	<FCVT_FIXED2F:fcvt_fixed_insn><GPI:mode>3): Merge 'fp' and 'simd'
	attributes into 'arch'.
	(*movsf_aarch64, *movdf_aarch64, *movtf_aarch64, *add<mode>3_aarch64,
	subdi3, neg<mode>2, <optab><mode>3, one_cmpl<mode>2,
	*<NLOGICAL:optab>_one_cmpl<mode>3, *xor_one_cmpl<mode>3,
	*aarch64_ashl_sisd_or_int_<mode>3, *aarch64_lshr_sisd_or_int_<mode>3,
	*aarch64_ashr_sisd_or_int_<mode>3, *aarch64_sisd_ushl): Convert use of
	'simd' attribute into 'arch'.
	(load_pair_sw_<SX:mode><SX2:mode>, load_pair_dw_<DX:mode><DX2:mode>,
	store_pair_sw_<SX:mode><SX2:mode>, store_pair_dw_<DX:mode><DX2:mode>):
	Convert use of 'fp' attribute to 'arch'.
	* config/aarch64/aarch64-simd.md (move_lo_quad_internal_<mode>,
	move_lo_quad_internal_<mode>): (different modes) Merge 'fp' and 'simd'
	into 'arch'.
	(move_lo_quad_internal_be_<mode>, move_lo_quad_internal_be_<mode>):
	(different modes) Merge 'fp' and 'simd' into 'arch'.
	(*aarch64_combinez<mode>, *aarch64_combinez_be<mode>): Merge 'fp' and
	'simd' into 'arch'.

From-SVN: r263811
2018-08-23 12:43:17 +00:00
Segher Boessenkool 84ea73e1bb Fix recent bug in canonicalize_comparison (PR87026)
The new code testing which way a comparison is best expressed creates
a pseudoregister (by hand) and creates some insns with that.  Such
insns will no longer recog() when pseudo-registers are no longer
aloowed (after reload).  But we have an ifcvt pass after reload (ce3).

This patch simply returns if we cannot create pseudos.


	PR rtl-optimization/87026
	* expmed.c (canonicalize_comparison): If we can no longer create
	pseudoregisters, don't.

From-SVN: r263810
2018-08-23 14:40:14 +02:00
Jonathan Wakely 21bf6b2a93 Fix C++11-ism in C++98 member function
* include/debug/string (insert(__const_iterator, _InIter, _InIter)):
	[!_GLIBCXX_USE_CXX11_ABI]: Replace use of C++11-only cbegin() with
	begin(), for C++98 compatibility.

From-SVN: r263809
2018-08-23 12:21:17 +01:00
Jonathan Wakely 3eb1eda1c8 Fix testsuite failures for __gnu_debug::string with old ABI
The __gnu_debug string (mostly) implements the C++11 API, but when it
wraps the old COW string many of the member functions in the base class
have the wrong parameter types or return types. This makes the
__gnu_debug::string type adapt itself to the base class API. This
actually makes the debug string slightly more conforming than the
underlying string type when using the old ABI.

	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
	(basic_string::__const_iterator): Change access to protected.
	[!_GLIBCXX_USE_CXX11_ABI] (basic_string::__const_iterator): Define
	as typedef for iterator.
	* include/debug/string (__const_iterator): Use typedef from base.
	(insert(const_iterator, _CharT))
	(replace(const_iterator, const_iterator, const basic_string&))
	(replace(const_iterator, const_iterator, const _CharT*, size_type))
	(replace(const_iterator, const_iterator, const CharT*))
	(replace(const_iterator, const_iterator, size_type, _CharT))
	(replace(const_iterator, const_iterator, _InputIter, _InputIter))
	(replace(const_iterator, const_iterator, initializer_list<_CharT>)):
	Change const_iterator parameters to __const_iterator.
	(insert(iterator, size_type, _CharT)): Add C++98 overload.
	(insert(const_iterator, _InputIterator, _InputIterator)): Change
	const_iterator parameter to __const_iterator.
	[!_GLIBCXX_USE_CXX11_ABI]: Add workaround for incorrect return type
	of base's member function.
	(insert(const_iterator, size_type, _CharT)) [!_GLIBCXX_USE_CXX11_ABI]:
	Likewise.
	(insert(const_iterator, initializer_list<_CharT>))
	[!_GLIBCXX_USE_CXX11_ABI]: Likewise.
	* testsuite/21_strings/basic_string/init-list.cc: Remove effective
	target directive.

From-SVN: r263808
2018-08-23 11:51:52 +01:00
Nathan Sidwell 832c74d935 [libiberty patch] Fix PGO bootstrap
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01386.html
	PR driver/87056
	* pex-unix.c (pex_unix_exec_child): Duplicate bad_fn into local
	scopes to avoid potential clobber.

Co-Authored-By: Martin Liska <mliska@suse.cz>

From-SVN: r263807
2018-08-23 10:21:21 +00:00
Richard Earnshaw ebdb6f2377 PR target/86951 arm - Handle speculation barriers on pre-armv7 CPUs
The AArch32 instruction sets prior to Armv7 do not define the ISB and
DSB instructions that are needed to form a speculation barrier.  While
I do not know of any instances of cores based on those instruction
sets being vulnerable to speculative side channel attacks it is
possible to run code built for those ISAs on more recent hardware
where they would become vulnerable.

This patch works around this by using a library call added to libgcc.
That code can then take any platform-specific actions necessary to
ensure safety.

For the moment I've only handled two cases: the library code being
built for armv7 or later anyway and running on Linux.

On Linux we can handle this by calling the kernel function that will
flush a small amount of cache.  Such a sequence ends with a ISB+DSB
sequence if running on an Armv7 or later CPU.

gcc:

	PR target/86951
	* config/arm/arm-protos.h (arm_emit_speculation_barrier): New
	prototype.
	* config/arm/arm.c (speculation_barrier_libfunc): New static
	variable.
	(arm_init_libfuncs): Initialize it.
	(arm_emit_speculation_barrier): New function.
	* config/arm/arm.md (speculation_barrier): Call
	arm_emit_speculation_barrier for architectures that do not have 
	DSB or ISB.
	(speculation_barrier_insn): Only match on Armv7 or later.

libgcc:

	PR target/86951
	* config/arm/lib1funcs.asm (speculation_barrier): New function.
	* config/arm/t-arm (LIB1ASMFUNCS): Add it to list of functions
	to build.

From-SVN: r263806
2018-08-23 09:47:34 +00:00
Richard Biener 60d91c7fae re PR ipa/87024 (ICE in fold_stmt_1)
2018-08-23  Richard Biener  <rguenther@suse.de>

	PR middle-end/87024
	* tree-inline.c (copy_bb): Drop unused __builtin_va_arg_pack_len
	calls.

	* gcc.dg/pr87024.c: New testcase.

From-SVN: r263805
2018-08-23 09:29:45 +00:00
Richard Sandiford e25c95ef2a [AArch64] Improve SVE handling of single-vector permutes
aarch64_vectorize_vec_perm_const was failing to set one_vector_p
if the permute had only a single input.  This in turn was hiding
a problem in the SVE TBL handling: it accepted single-vector
variable-length permutes, but sent them through the general
two-vector aarch64_expand_sve_vec_perm, which is only set up
to handle constant-length permutes.

2018-08-23  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/aarch64.c (aarch64_evpc_sve_tbl): Fix handling
	of single-vector TBLs.
	(aarch64_vectorize_vec_perm_const): Set one_vector_p when only
	one input is given.

gcc/testsuite/
	* gcc.dg/vect/no-vfa-vect-depend-2.c: Remove XFAIL.
	* gcc.dg/vect/no-vfa-vect-depend-3.c: Likewise.
	* gcc.dg/vect/pr65947-13.c: Update for vect_fold_extract_last.
	* gcc.dg/vect/pr80631-2.c: Likewise.

From-SVN: r263804
2018-08-23 08:57:17 +00:00
Richard Sandiford 4ec8bb6748 Fix aarch64_evpc_tbl guard (PR 85910)
This patch fixes a typo in aarch64_expand_vec_perm_const_1 that I
introduced as part of the SVE changes.  I don't know of any cases in
which it has any practical effect, since we'll eventually try to use
TBL as a variable permute instead.  Having the code is still an
important part of defining the interface properly and so we shouldn't
simply drop it.

2018-08-23  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR target/85910
	* config/aarch64/aarch64.c (aarch64_expand_vec_perm_const_1): Fix
	aarch64_evpc_tbl guard.

From-SVN: r263803
2018-08-23 08:51:38 +00:00
Janne Blomqvist 9c44db9f23 Signed zero for {max,min}val intrinsics
The Fortran standard specifies (e.g. F2018 7.4.3.2) that intrinsic
procedures shall treat positive and negative real zero as equivalent,
unless it is explicitly specified otherwise.  For {max,min}val there
is no such explicit mention.  Thus, remove code to handle signed
zeros.

2018-08-23  Janne Blomqvist  <blomqvist.janne@gmail.com>

	* trans-intrinsic.c (gfc_conv_intrinsic_minmaxval): Delete
	HONOR_SIGNED_ZEROS checks.

From-SVN: r263802
2018-08-23 11:35:17 +03:00
Jonathan Wakely 0aa2934aaa Remove C++14-isms from C++11 tests
* testsuite/20_util/reference_wrapper/lwg2993.cc: Fix C++11 test to
	not use C++14 feature.
	* testsuite/23_containers/list/68222_neg.cc: Likewise.

From-SVN: r263801
2018-08-23 09:26:22 +01:00
Jonathan Wakely 75224273c3 Skip tests that depend on the cxx11 std::string
* testsuite/21_strings/basic_string/init-list.cc:
	Require cxx11-abi.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
	Likewise.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
	Likewise.

From-SVN: r263800
2018-08-23 09:26:16 +01:00
Paul Thomas 6ab6c0c3bb re PR fortran/86863 ([OOP][F2008] type-bound module procedure name not recognized)
2017-08-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/86863
	* resolve.c (resolve_typebound_call): If the TBP is not marked
	as a subroutine, check the specific symbol.

2017-08-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/86863
	* gfortran.dg/submodule_32.f08: New test.

From-SVN: r263799
2018-08-23 06:27:54 +00:00
GCC Administrator ba7a2ad8bd Daily bump.
From-SVN: r263798
2018-08-23 00:17:18 +00:00
Bernd Edlinger 36d2d101fa tree-ssa-dse.c (compute_trims): Avoid folding away undefined behaviour.
* tree-ssa-dse.c (compute_trims): Avoid folding away undefined
	behaviour.

From-SVN: r263793
2018-08-22 17:43:44 -06:00
Jonathan Wakely f73a5316b6 Fix tests that fail in C++98 mode
* testsuite/23_containers/deque/capacity/max_size.cc: Fix test for
	C++98 mode.
	* testsuite/23_containers/deque/modifiers/assign/1.cc: Likewise.
	* testsuite/23_containers/list/modifiers/assign/1.cc: Likewise.
	* testsuite/23_containers/vector/bool/modifiers/assign/1.cc: Likewise.
	* testsuite/23_containers/vector/capacity/max_size.cc: Likewise.
	* testsuite/23_containers/vector/modifiers/assign/1.cc: Likewise.

From-SVN: r263792
2018-08-23 00:43:43 +01:00
Jonathan Wakely 1bc7a28f94 PR libstdc++/87061 remove pmr type aliases for COW strings
The pmr aliases for basic_string and match_results are incompatible with
the gcc4-compatible ABI because the Copy-On-Write basic_string class
doesn't support C++11 allocators.

	PR libstdc++/87061
	* include/experimental/regex [!_GLIBCXX_USE_CXX11_ABI]
	(experimental::pmr::match_results, experimental::pmr::cmatch)
	(experimental::pmr::smatch, experimental::pmr::wcmatch)
	(experimental::pmr::wsmatch): Do not declare for gcc4-compatible ABI,
	because COW strings don't support C++11 allocator model.
	* include/experimental/string [!_GLIBCXX_USE_CXX11_ABI]
	(experimental::pmr::basic_string, experimental::pmr::string)
	(experimental::pmr::u16string, experimental::pmr::u32string)
	(experimental::pmr::wstring): Likewise.
	* include/std/regex [!_GLIBCXX_USE_CXX11_ABI] (pmr::match_results)
	(pmr::cmatch, pmr::smatch, pmr::wcmatch, pmr::wsmatch): Likewise.
	* include/std/string [!_GLIBCXX_USE_CXX11_ABI] (pmr::basic_string)
	(pmr::string, pmr::u16string, pmr::u32string, pmr::wstring): Likewise.
	* testsuite/21_strings/basic_string/types/pmr_typedefs.cc: Require
	cxx11-abi.
	* testsuite/28_regex/match_results/pmr_typedefs.cc: Likewise.

From-SVN: r263791
2018-08-22 23:54:33 +01:00
Jonathan Wakely af55b3af33 PR libstdc++/78448 limit vector::max_size and deque::max_size
The container requirements imply that max_size() can't exceed the
maximum value of the container's difference_type. Enforce this for
std::vector and std::deque, and add checks to ensure the container
doesn't grow larger than that.

	PR libstdc++/78448
	* include/bits/deque.tcc (deque::_M_range_initialize): Use
	_S_check_init_len to check size.
	(deque::_M_push_back_aux, deque::_M_push_front_aux): Throw length
	error if size would exceed max_size().
	* include/bits/stl_deque.h (_Deque_base::size_type): Remove typedef.
	(_Deque_base(_Deque_base&&, const allocator_type&, size_t)): Use
	size_t instead of size_type.
	(deq(size_type, const allocator_type&)
	(deq(size_type, const value_type&, const allocator_type&)
	(deque::_M_initialize_dispatch): Use _S_check_init_len to check size.
	(deque::max_size): Call _S_max_size.
	(deque::_S_check_init_len, deque::_S_max_size): New functions.
	* include/bits/stl_vector.h (vector(size_type, const allocator_type&))
	(vector(size_type, const value_type&, const allocator_type&))
	(vector::_M_initialize_dispatch, vector::_M_range_initialize): Use
	_S_check_init_len to check size.
	(vector::max_size): Call _S_max_size.
	(vector::_M_check_len): Prevent max from being expanded as a
	function-like macro.
	(vector::_S_check_init_len, vector::_S_max_size): New functions.
	* include/bits/vector.tcc (vector::_M_assign_aux): Use
	_S_check_init_len to check size.
	* testsuite/23_containers/deque/capacity/max_size.cc: New test.
	* testsuite/23_containers/vector/capacity/max_size.cc: New test.

From-SVN: r263789
2018-08-22 23:22:40 +01:00
Thomas Koenig 2532f0f5e6 gfortran.texi: Mention that asynchronous I/O does not work on systems which lack condition...
2018-08-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* gfortran.texi: Mention that asynchronous I/O does
	not work on systems which lack condition variables, such
	as AIX.

2018-08-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* async.h: Set ASYNC_IO to zero if _AIX is defined.
	(struct adv_cond): If ASYNC_IO is zero, the struct has no members.
	(async_unit): If ASYNC_IO is zero, remove unneeded members.

From-SVN: r263788
2018-08-22 21:29:49 +00:00
Janus Weil bcddf743dd re PR fortran/86935 (Bad locus in ASSOCIATE statement)
fix PR 86935

2018-08-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/86935
	* match.c (gfc_match_associate): Improve diagnostics for the ASSOCIATE
	statement.

2018-08-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/86935
	* gfortran.dg/associate_3.f90: Update error message.
	* gfortran.dg/associate_39.f90: New test case.

From-SVN: r263787
2018-08-22 21:31:40 +02:00
François Dumont e9afbed0d6 re PR libstdc++/68222 (_Safe_iterator provides operators the wrapped iterator can't actually support)
2018-08-22  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/68222
	* include/debug/safe_iterator.h
	(_Safe_iterator<_It, _Sq, _Cat>): Add category template parameter.
	(_Safe_iterator<>::_Const_iterator): Remove.
	(_Safe_iterator<>::_IsConstant): New.
	(_Safe_iterator<>::_OtherIterator): New.
	(_Safe_iterator<_It, _Sq, _Cat>::_Safe_iterator<_MutIte>(
	const _Safe_iterator<_MutIte, _Sq, _Cat>&)): Add _IsConstant::__value in
	__gnu_cxx::__enable_if condition.
	(_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_to): New.
	(_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_from_begin): New.
	(_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_to_end): New.
	(_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>): New.
	(_Safe_iterator<_It, _Sq, _Cat>::operator--()): Move...
	(_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>
	::operator--()): ...here.
	(_Safe_iterator<_It, _Sq, _Cat>::operator--(int)): Move...
	(_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>
	::operator--(int)): ...here.
	(_Safe_iterator<_It, _Sq, _Cat>::_M_decrementable()): Move...
	(_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>
	::_M_decrementable()): ...here.
	(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>): New.
	(_Safe_iterator<_It, _Sq, _Cat>::operator[](const difference_type&)):
	Move...
	(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>
	::operator[](const difference_type&)): ...here.
	(_Safe_iterator<_It, _Sq, _Cat>::operator+=(const difference_type&)):
	Move...
	(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>
	::operator+=(const difference_type&)): ...here.
	(_Safe_iterator<_It, _Sq, _Cat>::operator+(const difference_type&)):
	Move...
	(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>
	::operator+(const difference_type&)): ...here.
	(_Safe_iterator<_It, _Sq, _Cat>::operator-=(const difference_type&)):
	Move...
	(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>
	::operator-=(const difference_type&)): ...here.
	(_Safe_iterator<_It, _Sq, _Cat>::operator-(const difference_type&)):
	Move...
	(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>
	::operator-(const difference_type&)): ...here.
	(operator<(const _Safe_iterator<>&, const _Safe_iterator<>&)):
	Constraint to random access iterators.
	(operator<=(const _Safe_iterator<>&, const _Safe_iterator<>&)):
	Likewise.
	(operator>(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise.
	(operator>=(const _Safe_iterator<>&, const _Safe_iterator<>&)):
	Likewise.
	(operator-(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise.
	(operator+(const difference_type&, const _Safe_iterator<>&)): Likewise.
	(__check_dereferenceable(const _Safe_iterator<>&)): Remove.
	(__get_distance): Remove.
	(__get_distance_from_begin): Remove.
	(__get_distance_to_end): Remove.
	(struct __is_safe_random_iterator<_Safe_iterator<>>): Remove partial
	specialization.
	(__base(const _Safe_iterator<>&, std::input_iterator_tag)): Remove.
	(__base(const _Safe_iterator<>&, std::random_access_iterator_tag)): Remove.
	(__base(const _Safe_iterator<>&)): Constraint to random access iterator.
	* include/debug/safe_iterator.tcc
	(_Safe_iterator<>::_M_get_distance_from_begin()): New.
	(_Safe_iterator<>::_M_get_distance_to_end()): New.
	(_Safe_iterator<>::_M_get_distance_to(const _Safe_iterator<>&)): New.
	(_Safe_iterator<_It, _Seq, std::random_access_iterator_tag>
	::_M_valid_range): New.
	* include/debug/safe_local_iterator.h
	(_Safe_local_iterator<>::_Const_local_iterator): Remove.
	(_Safe_local_iterator<>::_IsConstant): New.
	(_Safe_local_iterator<>::_OtherIterator): New.
	(_Safe_local_iterator<_It, _Cont>::_Safe_local_iterator<_MutIte, _Cont>(
	const _Safe_local_iterator<_MutIte, _Seq>&)): Add _IsConstant::__value
	in __gnu_cxx::__enable_if condition. If singular compare base iterator
	with _MutIte rather than _It.
	(_Safe_local_iterator<>::_S_constant): Make constexpr.
	(_Safe_local_iterator<>::_M_get_distance_to): New.
	(__check_dereferenceable(const _Safe_local_iterator<>&)): Remove.
	(__get_distance(const _Safe_local_iterator<>&,
	const _Safe_local_iterator<>&, std::input_iterator_tag)): Remove.
	(__valid_range(const _Safe_local_iterator<>&,
	const _Safe_local_iterator<>&)): New.
	* include/debug/safe_local_iterator.tcc
	(_Safe_local_iterator<>::_M_get_distance_to): New.
	* include/debug/deque (std::__debug::deque<>): Add
	::__gnu_debug::_Safe_iterator<> friend declaration.
	* include/debug/forward_list (std::__debug::forward_list<>): Likewise.
	* include/debug/list (std::__debug::list<>): Likewise.
	* include/debug/map.h (std::__debug::map<>): Likewise.
	* include/debug/multimap.h (std::__debug::multimap<>): Likewise.
	* include/debug/set.h (std::__debug::set<>): Likewise.
	* include/debug/multiset.h (std::__debug::multiset<>): Likewise.
	* include/debug/string (std::__debug::basic_string<>): Likewise.
	* include/debug/unordered_map (std::__debug::unordered_map<>): Likewise
	and add ::__gnu_debug::_Safe_local_iterator<> friend declaration.
	(std::__debug::unordered_multimap<>): Likewise.
	* include/debug/unordered_set (std::__debug::unordered_set<>): Likewise.
	(std::__debug::unordered_multiset<>): Likewise.
	* include/debug/formatter.h: Adapt.
	* include/debug/helper_functions.h
	(__gnu_debug::_Safe_local_iterator<>): Add declaration.
	(__get_distance<_Ite>(_Ite, _Ite, std::random_access_iterator_tag):
	Pass parameter by copy.
	(__get_distance<_Ite>(_Ite, _Ite, std::input_iterator_tag): Likewise.
	(__get_distance<_Ite>(_Ite, _Ite): Likewise.
	(__valid_range_aux<_Integral>): Pass _Integral by copy.
	(__valid_range<_InputIterator>): Pass _InputIterator by copy.
	(__valid_range<>(const _Safe_iterator<>&,
	const _Safe_iterator<>&, typename _Distance_traits<>::__type&)):
	Declare.
	(__valid_range(const _Safe_local_iterator<>&,
	const _Safe_local_iterator<>&, typename _Distance_traits<>::__type&)):
	Declare.
	(__valid_range<>(const _Safe_iterator<>&, const _Safe_iterator<>&)):
	Declare.
	(__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&)):
	Declare.
	(__can_advance): Adapt.
	(struct __is_safe_random_iterator<>): Remove.
	(struct _SIter_base<>): Remove.
	* include/debug/functions.h: Include <bits/stl_iterator.h>.
	(__check_dereferenceable): Remove.
	(__foreign_iterator_aux4, __foreign_iterator_aux3): Adapt.
	(__foreign_iterator_aux2, __foreign_iterator_aux): Adapt.
	(__foreign_iterator): Adapt.
	* include/debug/stl_iterator.h
	(__is_safe_random_iterator<std::reverse_iterator<>>): Remove.
	(__base(const std::reverse_iterator<_Safe_iterator<_It, _Sq>)):
	Constraint for random access iterators.
	(__niter_base): Adapt.
	* testsuite/util/testsuite_containers.h:
	Include <bits/boost_concept_check.h>.
	(iterator_concept_checks<_It, _Mutable, _Category>): New.
	(citerator<_Cont>::forward_members::forward_members()): Instantiate
	latter for container iterator and const_iterator.
	* testsuite/23_containers/list/68222_neg.cc: New.
	* testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adapt
	line number.
	* testsuite/23_containers/unordered_set/debug/debug_functions.cc:
	(test01): Remove.
	* testsuite/23_containers/vector/debug/debug_functions.cc (test01):
	Remove.

From-SVN: r263786
2018-08-22 18:51:25 +00:00
Andrew Benson 66f32b0e21 module.c (load_generic_interfaces): Move call to find_symbol() so that only occurs if actually needed.
2018-08-22  Andrew Benson  <abensonca@gmail.com>

        * module.c (load_generic_interfaces): Move call to find_symbol()
        so that only occurs if actually needed.

From-SVN: r263784
2018-08-22 17:47:53 +00:00
Andrew Benson fe26fd66b0 Update write after approval list
2018-08-22  Andrew Benson  <abensonca@gmail.com>

        * MAINTAINERS: Add self to write after approval list.

From-SVN: r263783
2018-08-22 17:40:55 +00:00
Janus Weil 00cad178a3 re PR fortran/86888 ([F08] allocatable components of indirectly recursive type)
fix PR 86888

2018-08-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/86888
	* decl.c (gfc_match_data_decl): Allow allocatable components of
	indirectly recursive type.
	* resolve.c (resolve_component): Remove two errors messages ...
	(resolve_fl_derived): ... and replace them by a new one.

2018-08-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/86888
	* gfortran.dg/alloc_comp_basics_6.f90: Update an error message and add
	an additional case.
	* gfortran.dg/alloc_comp_basics_7.f90: New test case.
	* gfortran.dg/class_17.f03: Update error message.
	* gfortran.dg/class_55.f90: Ditto.
	* gfortran.dg/dtio_11.f90: Update error messages.
	* gfortran.dg/implicit_actual.f90: Add an error message.
	* gfortran.dg/typebound_proc_12.f90: Update error message.

From-SVN: r263782
2018-08-22 19:10:00 +02:00
Martin Sebor b56b07639b PR middle-end/87052 - STRING_CST printing incomplete in Gimple dumps
gcc/testsuite/ChangeLog:

	PR middle-end/87052
	* gcc.dg/pr87052.c: New test.
	* gcc.dg/tree-ssa/dump-3.c: Adjust.

gcc/ChangeLog:

	PR middle-end/87052
	* tree-pretty-print.c (pretty_print_string): Add argument.
	(dump_generic_node): Call to pretty_print_string with string size.

From-SVN: r263781
2018-08-22 10:42:56 -06:00
Segher Boessenkool ecc643a81e [ fix changelog ]
2018-08-22  Segher Boessenkool  <segher@kernel.crashing.org>

	PR rtl-optimization/86771
	* combine.c (try_combine): Do not allow splitting a resulting PARALLEL
	of two SETs into those two SETs, one to be placed at i2, if that SETs
	destination is modified between i2 and i3.

From-SVN: r263780
2018-08-22 18:04:09 +02:00
Szabolcs Nagy 3543c89f5f Change AArch64 specific FMAX/FMIN tests into generic MAX_EXPR/MIN_EXPR tests
gfortran now always uses MAX_EXPR/MIN_EXPR for MAX/MIN intrinsics, so the
AArch64 specific FMAX/FMIN tests are no longer valid.

2018-08-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* gfortran.dg/max_fmax_aarch64.f90: Rename to...
	* gfortran.dg/max_expr.f90: ...this.
	* gfortran.dg/min_fmin_aarch64.f90: Rename to...
	* gfortran.dg/min_expr.f90: ...this.

From-SVN: r263778
2018-08-22 15:12:05 +00:00
Segher Boessenkool 90cb08ca01 combine: Do another check before splitting a parallel (PR86771)
When combine splits a resulting parallel into its two SETs, it has to
place one at i2, and the other stays at i3.  This does not work if the
destination of the SET that will be placed at i2 is modified between
i2 and i3.  This patch fixes it.


	* combine.c (try_combine): Do not allow splitting a resulting PARALLEL
	of two SETs into those two SETs, one to be placed at i2, if that SETs
	destination is modified between i2 and i3.

From-SVN: r263776
2018-08-22 15:41:05 +02:00
Richard Sandiford 18bc19a7aa [2/2] Fix bogus inner induction (PR 86725)
This patch is the second part of the fix for PR 86725.  The problem
in the original test is that for:

  outer1:
    x_1 = PHI <x_4(outer2), ...>;
    ...

  inner:
    x_2 = PHI <x_1(outer1), x_3(...)>;
    ...
    x_3 = ...;
    ...

  outer2:
    x_4 = PHI <x_3(inner)>;
    ...

there are corner cases in which it is possible to classify the
inner phi as an induction but not the outer phi.  The -4.c test
is a more direct example.

After failing to classify x_1 as an induction, we go on to
classify it as a double reduction (which is basically true).
But we still classified the inner phi as an induction rather
than as part of a reduction, leading to an ICE when trying
to vectorise the outer phi.

We analyse the phis for outer loops first, so the simplest
fix is not to classify the phi as an induction if outer loop
analysis said that it should be a reduction.

The -2.c test is from the original PR.  The -3.c test is a
version in which "wo" really is used a reduction; this was
already correctly rejected, but for the wrong reason ("inner-loop
induction only used outside of the outer vectorized loop").
The -4.c test is another way of tickling the original problem
without relying on the undefinedness of signed overflow.
The -5.c test shows an (uninteresting) example in which the
patch prevents a spurious failure to vectorise the outer loop.

2018-08-22  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR tree-optimization/86725
	* tree-vect-loop.c (vect_inner_phi_in_double_reduction_p): New
	function.
	(vect_analyze_scalar_cycles_1): Check it.

gcc/testsuite/
	PR tree-optimization/86725
	* gcc.dg/vect/no-scevccp-pr86725-2.c: New test.
	* gcc.dg/vect/no-scevccp-pr86725-3.c: Likewise.
	* gcc.dg/vect/no-scevccp-pr86725-4.c: Likewise.
	* gcc.dg/vect/no-scevccp-pr86725-5.c: Likewise.

From-SVN: r263774
2018-08-22 13:02:48 +00:00
Richard Sandiford 3a4da26602 [1/2] Fix bogus double reduction (PR 86725)
This patch is the first part of the fix for PR 86725.  We would
treat x_1 in:

    outer1:
      x_1 = PHI <x_4(outer2), ...>;
      ...

    inner:
      x_2 = ...x_1...;
      ...
      x_3 = ...;
      ...

    outer2:
      x_4 = PHI <x_3(inner)>;
      ...

as a double reduction without checking what kind of statement x_2 is.
In practice it has to be a phi, since for other x_2, x_1 would simply
be a loop invariant that gets used for every inner loop iteration.

The idea with doing this patch first is that, by checking x_2 really
is a phi, we can hand off the validation of the rest of the reduction
to the phi analysis in the inner loop.

The test case is a variant of the one in the PR.

2018-08-22  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR tree-optimization/86725
	* tree-vect-loop.c (vect_is_simple_reduction): When treating
	an outer loop phi as a double reduction, make sure that the
	single user of the phi result is an inner loop phi.

gcc/testsuite/
	PR tree-optimization/86725
	* gcc.dg/vect/no-scevccp-pr86725-1.c: New test.

From-SVN: r263773
2018-08-22 13:02:39 +00:00
Richard Sandiford 203942b8af Make the vectoriser drop to strided accesses for stores with gaps
We could vectorise:

     for (...)
       {
         a[0] = ...;
         a[1] = ...;
         a[2] = ...;
         a[3] = ...;
         a += stride;
       }

(including the case when stride == 8) but not:

     for (...)
       {
         a[0] = ...;
         a[1] = ...;
         a[2] = ...;
         a[3] = ...;
         a += 8;
       }

(where the stride is always 8).  The former was treated as a "grouped
and strided" store, while the latter was treated as a grouped store
with gaps, which we don't support.

This patch makes us treat groups of stores with gaps at the end as
strided groups too.  I tried to go through all uses of STMT_VINFO_STRIDED_P
and all vector uses of DR_STEP to see whether there were any hard-baked
assumptions, but couldn't see any.  I wondered whether we should relax:

  /* We do not have to consider dependences between accesses that belong
     to the same group, unless the stride could be smaller than the
     group size.  */
  if (DR_GROUP_FIRST_ELEMENT (stmtinfo_a)
      && (DR_GROUP_FIRST_ELEMENT (stmtinfo_a)
          == DR_GROUP_FIRST_ELEMENT (stmtinfo_b))
      && !STMT_VINFO_STRIDED_P (stmtinfo_a))
    return false;

for cases in which the step is constant and the absolute step is known
to be greater than the group size, but data dependence analysis should
already return chrec_known for those cases.

The new test is a version of vect-avg-15.c with the variable step
replaced by a constant one.

A natural follow-on would be to do the same for groups with gaps in
the middle:

          /* Check that the distance between two accesses is equal to the type
             size. Otherwise, we have gaps.  */
          diff = (TREE_INT_CST_LOW (DR_INIT (data_ref))
                  - TREE_INT_CST_LOW (prev_init)) / type_size;
          if (diff != 1)
            {
              [...]
              if (DR_IS_WRITE (data_ref))
                {
                  if (dump_enabled_p ())
                    dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
                                     "interleaved store with gaps\n");
                  return false;
                }

But I think we should do that separately and see what the fallout
from this change is first.

2018-08-22  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-data-refs.c (vect_analyze_group_access_1): Convert
	grouped stores with gaps to a strided group.

gcc/testsuite/
	* gcc.dg/vect/vect-avg-16.c: New test.
	* gcc.dg/vect/slp-37.c: Expect the loop to be vectorized.
	* gcc.dg/vect/vect-strided-u8-i8-gap4.c,
	* gcc.dg/vect/vect-strided-u8-i8-gap4-big-array.c: Likewise for
	the second loop in main1.

From-SVN: r263772
2018-08-22 12:59:08 +00:00
Richard Sandiford 3ad3b3ac8c Only test STMT_VINFO_STRIDED_P for the first statement in a group
get_load_store_type & co were testing STMT_VINFO_STRIDED_P on individual
statements in a group instead of the first.  This has no effect on
its own, but is needed by a later patch.

2018-08-22  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-stmts.c (get_group_load_store_type)
	(get_load_store_type): Only test STMT_VINFO_STRIDED_P for the
	first statement in a group.

From-SVN: r263771
2018-08-22 12:58:53 +00:00
Iain Sandoe 257d10b524 Udate Darwin's LTO specs to match what's in gcc/gcc.c
gcc/
	* config/darwin.h (LINK_COMMAND_SPEC_A): Sync LTO options with
	the sequence used in gcc/gcc.c.

From-SVN: r263770
2018-08-22 12:31:23 +00:00
Iain Sandoe f0dbdef35e stringify __USER_LABEL_PREFIX__ in pr85248 testcase.
gcc/testsuite

	* gcc.dg/lto/pr85248_0.c (test_alias):
	Stringify __USER_LABEL_PREFIX__.
	(test_noreturn): Likewise.

From-SVN: r263769
2018-08-22 12:22:07 +00:00
Iain Sandoe 26e0e97b71 Make the gcc-ar,nm, strip tools respond correctly to --help and --version
when there's no plugin built.

gcc/

	PR other/704
	* gcc-ar.c (main): Don’t try to invoke the plug-in if we’re not
	building it.

From-SVN: r263768
2018-08-22 12:12:46 +00:00
Jonathan Wakely 7c1dcf5012 PR libstdc++/77854 document size_type for containers
PR libstdc++/77854
	* doc/xml/manual/status_cxx1998.xml: Document size_type and
	difference_type for containers.
	* doc/html/*: Regenerate.

From-SVN: r263767
2018-08-22 13:11:17 +01:00
Iain Sandoe 88350fd97e commit missed change from r263764
From-SVN: r263766
2018-08-22 12:05:45 +00:00
Iain Sandoe a49c064e40 Move Darwin10 unwinder fix to a crt shim.
gcc/
	* config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Adjust to use the
	Darwin10-specific unwinder-shim.
	* config/darwin12.h (LINK_GCC_C_SEQUENCE_SPEC): Remove.
	* config/rs6000/darwin.h (DARWIN_CRT1_SPEC, DARWIN_DYLIB1_SPEC): 
	New to cater for Darwin10 Rosetta.

libgcc/
	* config/unwind-dw2-fde-darwin.c
	(_darwin10_Unwind_FindEnclosingFunction): move from here ...
	* config/darwin10-unwind-find-enc-func.c: … to here.
	* config/t-darwin: Build Darwin10 unwinder shim crt.
	* libgcc/config.host: Add the Darwin10 unwinder shim.

From-SVN: r263765
2018-08-22 11:58:43 +00:00
Iain Sandoe 36bd86fa51 Allw for Darwin to operate with an assembler supporting gotoff in data.
gcc/

	* config/i386/i386.c (ix86_output_addr_diff_elt): Move the MACH-O
	specific test before the one for HAVE_AS_GOTOFF_IN_DATA.

From-SVN: r263764
2018-08-22 11:42:53 +00:00
Iain Sandoe 333a29f9e8 Fix FDE labels for Darwin
gcc/

	PR bootstrap/81033
	PR target/81733
	PR target/52795
	* gcc/dwarf2out.c (FUNC_SECOND_SECT_LABEL): New.
	(dwarf2out_switch_text_section): Generate a local label for the second
	function sub-section and apply it as the second FDE start label.
	* gcc/final.c (final_scan_insn_1): Emit second FDE label after the second
	sub-section start.

From-SVN: r263763
2018-08-22 11:37:02 +00:00
Richard Biener acc2580750 re PR tree-optimization/86988 (ICE: tree check: expected integer_cst, have var_decl in get_len, at tree.h:5563)
2018-08-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/86988
	* tree-vrp.c (vrp_prop::check_mem_ref): Bail out on VLAs.

	* g++.dg/pr86988.C: New testcase.

From-SVN: r263762
2018-08-22 11:01:58 +00:00