Commit Graph

162924 Commits

Author SHA1 Message Date
Jonathan Wakely 16d0ab7f44 Add missing header for std::max_align_t
* include/experimental/memory_resource: Include <cstddef> header.

From-SVN: r262977
2018-07-25 18:24:49 +01:00
Jakub Jelinek cf7fb52d95 cp-tree.h (enum cp_tree_index): Add CPTI_{ABI_TAG,ALIGNED,BEGIN,END,GET,TUPLE_{ELEMENT,SIZE}}_IDENTIFIER and...
* cp-tree.h (enum cp_tree_index): Add
	CPTI_{ABI_TAG,ALIGNED,BEGIN,END,GET,TUPLE_{ELEMENT,SIZE}}_IDENTIFIER
	and CPTI_{GNU,TYPE,VALUE,FUN,CLOSURE}_IDENTIFIER.
	(abi_tag_identifier, aligned_identifier, begin_identifier,
	end_identifier, get__identifier, gnu_identifier,
	tuple_element_identifier, tuple_size_identifier, type_identifier,
	value_identifier, fun_identifier, closure_identifier): Define.
	* decl.c (initialize_predefined_identifiers): Initialize the above
	identifiers.
	(get_tuple_size): Use tuple_size_identifier instead of
	get_identifier ("tuple_size") and value_identifier instead of
	get_identifier ("value").
	(get_tuple_element_type): Use tuple_element_identifier instead of
	get_identifier ("tuple_element") and type_identifier instead of
	get_identifier ("type").
	(get_tuple_decomp_init): Use get__identifier instead of
	get_identifier ("get").
	* lambda.c (maybe_add_lambda_conv_op): Use fun_identifier instead of
	get_identifier ("_FUN").
	* parser.c (cp_parser_lambda_declarator_opt): Use closure_identifier
	instead of get_identifier ("__closure").
	(cp_parser_std_attribute): Use gnu_identifier instead of
	get_identifier ("gnu").
	(cp_parser_std_attribute_spec): Likewise.  Use aligned_identifier
	instead of get_identifier ("aligned").
	* class.c (check_abi_tags, inherit_targ_abi_tags): Use
	abi_tag_identifier instead of get_identifier ("abi_tag").

From-SVN: r262976
2018-07-25 18:47:18 +02:00
Jakub Jelinek 213f5e8acc re PR c++/85515 (Bogus suggestions from "GCC's leaky abstractions")
PR c++/85515
	* cp-tree.h (enum cp_tree_index): Add
	CPTI_FOR_{RANGE,BEGIN,END}{,_}_IDENTIFIER.
	(for_range__identifier, for_begin__identifier, for_end__identifier,
	for_range_identifier, for_begin_identifier, for_end_identifier):
	Define.
	* decl.c (initialize_predefined_identifiers): Initialize
	for_{range,begin,end}{,_}_identifier.
	* parser.c (build_range_temp): Use for_range__identifier instead of
	get_identifier ("__for_range").
	(cp_convert_range_for): Use for_begin__identifier and
	for_end__identifier instead of get_identifier ("__for_begin") and
	get_identifier ("__for_end").
	* semantics.c (finish_for_stmt): Rename "__for_{range,begin,end} "
	local symbols to "__for_{range,begin,end}".

	* g++.dg/pr85515-2.C: Add expected dg-error.
	* g++.dg/cpp0x/range-for36.C: New test.

From-SVN: r262975
2018-07-25 18:46:34 +02:00
Claudiu Zissulescu c44fa4a666 [ARC] Update default optimizations for size.
Update the list of default optimizations used for size compilations.

gcc/
2018-07-10  Claudiu Zissulescu  <claziss@synopsys.com>

	* common/config/arc/arc-common.c (arc_option_optimization_table):
	Update default optimizations for size.

From-SVN: r262973
2018-07-25 16:31:34 +02:00
Joseph Myers 44f916dcce Regenerate .pot files.
gcc/po:
	* gcc.pot: Regenerate.

libcpp/po:
	* cpplib.pot: Regenerate.

From-SVN: r262972
2018-07-25 15:31:18 +01:00
Claudiu Zissulescu a96377575b [ARC] Improve instruction selection for fp moves.
Improve selection of short instruction for fp-moves.

gcc/
2018-05-17  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.md (movsf_insn): Add short instruction selection.
	* config/arc/constraints.md (CfZ): New constraint.
	* config/arc/fpu.md (addssf3_fpu): Use CfZ constraint.
	(subsf3_fpu): Likewise.
	(cmpsf_fpu): Likewise.
	(cmpsf_fpu_uneq): Likewise.

From-SVN: r262971
2018-07-25 16:31:16 +02:00
Claudiu Zissulescu 3e4a5f5485 [ARC] Fix uncache attribute.
gcc/
2018-05-09  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (compact_memory_operand_p): Check for uncached
	accesses as well.
	(arc_is_uncached_mem_p): uncached applies to both the variable and
	the pointer.

testsuite/
2018-05-09  Claudiu Zissulescu  <claziss@synopsys.com>

	* gcc.target/arc/uncached-1.c: New test.
	* gcc.target/arc/uncached-2.c: Likewise.

From-SVN: r262970
2018-07-25 16:31:04 +02:00
Claudiu Zissulescu 8f176ba232 [ARC] Add more additional register names
gcc/
  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.h (ADDITIONAL_REGISTER_NAMES): Add additional
	register names.

From-SVN: r262969
2018-07-25 16:30:52 +02:00
David Malcolm ee50ba7793 optinfo-emit-json.cc: fix trivial memory leak
gcc/ChangeLog:
	* optinfo-emit-json.cc (class optrecord_json_writer): Convert
	field "m_scopes" from vec to auto_vec.

From-SVN: r262967
2018-07-25 14:18:22 +00:00
Martin Liska e8e3751cd8 Fix wrong declaration.
2018-07-25  Martin Liska  <mliska@suse.cz>

	* config/powerpcspe/powerpcspe-protos.h (rs6000_loop_align): Fix
        return type.

From-SVN: r262966
2018-07-25 12:16:48 +00:00
Richard Biener 9c13689e64 re PR lto/86654 (ICE in gen_member_die, at dwarf2out.c:24933)
2018-07-25  Richard Biener  <rguenther@suse.de>

	PR debug/86654
	* dwarf2out.c (dwarf2out_decl): Do not handle nested functions
	special wrt context_die late.
	(gen_subprogram_die): Re-use DIEs in local scope.

From-SVN: r262965
2018-07-25 12:10:13 +00:00
Jonathan Wakely a9d49e9681 Add new src/c++17 directory to list in acinclude.m4
* acinclude.m4 (glibcxx_SUBDIRS): Add src/c++17.
	* src/Makefile.am: Add comment.
	* src/c++17/Makefile.in: Regenerate.

From-SVN: r262964
2018-07-25 12:01:39 +01:00
Jonathan Wakely 1fba0606b8 Move std::unique_lock definition to a separate header
This will allow std::mutex and std::lock_guard to be used elsewhere in
the library without pulling in the whole of <chrono>.

Previously the whole of <bits/std_mutex.h> was conditional on the
_GLIBCXX_USE_C99_STDINT_TR1 macro, but only the std::unique_lock members
that use <chrono> facilities should depend on that. std::mutex only
needs to depend on _GLIBCXX_HAS_GTHREADS and std::lock_guard can be
defined unconditionally.

Some parts of <bits/std_mutex.h> and <mutex> are based on code in
<ext/concurrence.h> which dates from 2003. However, the std::unique_lock
implementation was added in 2008 by r135007, without using any earlier
code. Therefore the new header file has copyright years 2008-2018.

	* include/Makefile.am: Add new <bits/unique_lock.h> header.
	* include/Makefile.in: Regenerate.
	* include/bits/std_mutex.h [!_GLIBCXX_USE_C99_STDINT_TR1] (mutex)
	(lock_guard): Define independent of _GLIBCXX_USE_C99_STDINT_TR1.
	(unique_lock): Move definition to ...
	* include/bits/unique_lock.h: New header.
	[!_GLIBCXX_USE_C99_STDINT_TR1] (unique_lock): Define unconditionally.
	[_GLIBCXX_USE_C99_STDINT_TR1] (unique_lock(mutex_type&, time_point))
	(unique_lock(mutex_type&, duration), unique_lock::try_lock_until)
	(unique_lock::try_lock_for): Define only when <chrono> is usable.
	* include/std/condition_variable: Include <bits/unique_lock.h>.
	* include/std/mutex: Likewise.

From-SVN: r262963
2018-07-25 11:40:12 +01:00
Richard Sandiford 1978cc78c8 Add PR number
From-SVN: r262962
2018-07-25 08:42:38 +00:00
Richard Sandiford e8dce850a7 Fix ceil_log2(0) (PR 86644)
This PR shows a pathological case in which we try SLP vectorisation on
dead code.  We record that 0 bits of the result are enough to satisfy
all users (which is true), and that led to precision being 0 in:

static unsigned int
vect_element_precision (unsigned int precision)
{
  precision = 1 << ceil_log2 (precision);
  return MAX (precision, BITS_PER_UNIT);
}

ceil_log2 (0) returned 64 rather than 0, leading to 1 << 64, which is UB.

2018-07-25  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* hwint.c (ceil_log2): Fix comment.  Return 0 for 0.

From-SVN: r262961
2018-07-25 08:41:35 +00:00
Martin Liska de6c8d7f72 Limit dump_flag enum values range (PR middle-end/86645).
2018-07-25  Martin Liska  <mliska@suse.cz>

        PR middle-end/86645
	* dumpfile.c: And excluded values with TDF_ALL_VALUES.
	* dumpfile.h (enum dump_flag): Defince TDF_ALL_VALUES.

From-SVN: r262960
2018-07-25 08:04:15 +00:00
Martin Liska 5a0e12709d Explain asan parameters in params.def (PR sanitizer/79635).
2018-07-25  Martin Liska  <mliska@suse.cz>

        PR sanitizer/79635
	* params.def: Explain ASan abbreviation and provide
        a documentation link.

From-SVN: r262959
2018-07-25 08:02:53 +00:00
Martin Sebor bfb9bd47b2 PR tree-optimization/86622 - incorrect strlen of array of array plus variable offset
PR tree-optimization/86622 - incorrect strlen of array of array plus variable offset
PR tree-optimization/86532 - Wrong code due to a wrong strlen folding starting with r262522

gcc/ChangeLog:

	PR tree-optimization/86622
	PR tree-optimization/86532
	* builtins.h (string_length): Declare.
	* builtins.c (c_strlen): Correct handling of non-constant offsets.	
	(check_access): Be prepared for non-constant length ranges.
	(string_length): Make extern.
	* expr.c (string_constant): Only handle the minor non-constant
	array index.  Use string_constant to compute the length of
	a generic string constant.

gcc/testsuite/ChangeLog:

	PR tree-optimization/86622
	PR tree-optimization/86532
	* gcc.c-torture/execute/strlen-2.c: New test.
	* gcc.c-torture/execute/strlen-3.c: New test.
	* gcc.c-torture/execute/strlen-4.c: New test.

From-SVN: r262958
2018-07-24 20:11:31 -06:00
GCC Administrator ae752f020f Daily bump.
From-SVN: r262957
2018-07-25 00:16:34 +00:00
Jonathan Wakely dfaa3c47cc Add initial version of C++17 <memory_resource> header
This is missing the synchronized_pool_resource and
unsynchronized_pool_resource classes but is otherwise complete.

This is a new implementation, not based on the existing code in
<experimental/memory_resource>, but memory_resource and
polymorphic_allocator ended up looking almost the same anyway.

The constant_init kluge in src/c++17/memory_resource.cc is apparently
due to Richard Smith and ensures that the objects are constructed during
constant initialiation phase and not destroyed (because the
constant_init destructor doesn't destroy the union member and the
storage is not reused).

	* config/abi/pre/gnu.ver: Export new symbols.
	* configure: Regenerate.
	* include/Makefile.am: Add new <memory_resource> header.
	* include/Makefile.in: Regenerate.
	* include/precompiled/stdc++.h: Include <memory_resource> for C++17.
	* include/std/memory_resource: New header.
	(memory_resource, polymorphic_allocator, new_delete_resource)
	(null_memory_resource, set_default_resource, get_default_resource)
	(pool_options, monotonic_buffer_resource): Define.
	* src/Makefile.am: Add c++17 directory.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.am: Fix comment.
	* src/c++17/Makefile.am: Add makefile for new sub-directory.
	* src/c++17/Makefile.in: Generate.
	* src/c++17/memory_resource.cc: New.
	(newdel_res_t, null_res_t, constant_init, newdel_res, null_res)
	(default_res, new_delete_resource, null_memory_resource)
	(set_default_resource, get_default_resource): Define.
	* testsuite/20_util/memory_resource/1.cc: New test.
	* testsuite/20_util/memory_resource/2.cc: New test.
	* testsuite/20_util/monotonic_buffer_resource/1.cc: New test.
	* testsuite/20_util/monotonic_buffer_resource/allocate.cc: New test.
	* testsuite/20_util/monotonic_buffer_resource/deallocate.cc: New test.
	* testsuite/20_util/monotonic_buffer_resource/release.cc: New test.
	* testsuite/20_util/monotonic_buffer_resource/upstream_resource.cc:
	New test.
	* testsuite/20_util/polymorphic_allocator/1.cc: New test.
	* testsuite/20_util/polymorphic_allocator/resource.cc: New test.
	* testsuite/20_util/polymorphic_allocator/select.cc: New test.
	* testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource):
	Define concrete memory resource for testing.
	(__gnu_test::default_resource_mgr): Define RAII helper for changing
	default resource.

From-SVN: r262953
2018-07-24 22:09:55 +01:00
Jonathan Wakely e874029dd9 PR libstdc++/86658 fix __niter_wrap to not copy invalid iterators
An output iterator passed as the unused first argument to __niter_wrap
might have already been invalidated, so don't copy it.

	PR libstdc++/86658
	* include/bits/stl_algobase.h (__niter_wrap<_Iterator>): Pass unused
	parameter by reference, to avoid copying invalid iterators.
	* testsuite/25_algorithms/copy/86658.cc: New test.

From-SVN: r262952
2018-07-24 21:49:10 +01:00
Richard Sandiford ed623edb47 Avoid &LOOP_VINFO_MASKS for bb vectorisation (PR 86618)
r262589 introduced another instance of the bug fixed in r258131.

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

gcc/
	PR tree-optimization/86618
	* tree-vect-stmts.c (vectorizable_call): Don't take the address
	of LOOP_VINFO_MASKS (loop_vinfo) when loop_vinfo is null.

From-SVN: r262951
2018-07-24 18:08:19 +00:00
David Malcolm dad2580c83 Fix segfault in -fsave-optimization-record (PR tree-optimization/86636)
There are various ways that it's possible for a gimple statement to
have an UNKNOWN_LOCATION, and for that UNKNOWN_LOCATION to be wrapped
in an ad-hoc location to capture inlining information.

For such a location, LOCATION_FILE (loc) is NULL.

Various places in -fsave-optimization-record were checking for
  loc != UNKNOWN_LOCATION
and were passing LOCATION_FILE (loc) to code that assumed a non-NULL
filename, thus leading to segfaults for the above cases.

This patch updates the tests to use
  LOCATION_LOCUS (loc) != UNKNOWN_LOCATION
instead, to look through ad-hoc location wrappers, fixing the segfaults.

It also adds various assertions to the affected code.

gcc/ChangeLog:
	PR tree-optimization/86636
	* json.cc (json::object::set): Fix comment.  Add assertions.
	(json::array::append): Move here from json.h.  Add comment and an
	assertion.
	(json::string::string): Likewise.
	* json.h (json::array::append): Move to json.cc.
	(json::string::string): Likewise.
	* optinfo-emit-json.cc
	(optrecord_json_writer::impl_location_to_json): Assert that we
	aren't attempting to write out UNKNOWN_LOCATION, or an ad-hoc
	wrapper around it.  Expand the location once, rather than three
	times.
	(optrecord_json_writer::inlining_chain_to_json): Fix the check for
	UNKNOWN_LOCATION, to use LOCATION_LOCUS to look through ad-hoc
	wrappers.
	(optrecord_json_writer::optinfo_to_json): Likewise, in four
	places.  Fix some overlong lines.

gcc/testsuite/ChangeLog:
	PR tree-optimization/86636
	* gcc.c-torture/compile/pr86636.c: New test.

From-SVN: r262950
2018-07-24 16:06:58 +00:00
Matthew Malcomson 8da03df567 [GCC][AARCH64] Canonicalize aarch64 widening simd plus insns
Committed on behalf of matthew.malcomson@arm.com

2018-07-24  Matthew Malcomson  <matthew.malcomson@arm.com>

	* config/aarch64/aarch64-simd.md
	(aarch64_<ANY_EXTEND:su><ADDSUB:optab>w<mode>): Split into...
	(aarch64_<ANY_EXTEND:su>subw<mode>): ... This...
	(aarch64_<ANY_EXTEND:su>addw<mode>): ... And this.
	(aarch64_<ANY_EXTEND:su><ADDSUB:optab>w<mode>_internal): Split into...
	(aarch64_<ANY_EXTEND:su>subw<mode>_internal): ... This...
	(aarch64_<ANY_EXTEND:su>addw<mode>_internal): ... And this.
	(aarch64_<ANY_EXTEND:su><ADDSUB:optab>w2<mode>_internal): Split into...
	(aarch64_<ANY_EXTEND:su>subw2<mode>_internal): ... This...
	(aarch64_<ANY_EXTEND:su>addw2<mode>_internal): ... And this.

	* gcc.target/aarch64/vect-su-add-sub.c: New.

From-SVN: r262949
2018-07-24 15:37:52 +00:00
Jakub Jelinek ebac3c0236 re PR middle-end/86627 (Signed 128-bit division by 2 no longer expanded to RTL)
PR middle-end/86627
	* expmed.c (expand_divmod): Punt if d == HOST_WIDE_INT_MIN
	and size > HOST_BITS_PER_WIDE_INT.  For size > HOST_BITS_PER_WIDE_INT
	and abs_d == d, do the power of two handling if profitable.

	* gcc.target/i386/pr86627.c: New test.

From-SVN: r262948
2018-07-24 16:23:18 +02:00
Jonathan Wakely 337dc30754 Minor refactoring in <bit> header
* include/std/bit (__countl_zero, __countr_zero, __popcount): Use
	local variables for number of digits instead of type aliases.
	(__log2p1): Remove redundant branch also checked in __countl_zero.

From-SVN: r262947
2018-07-24 14:51:50 +01:00
Richard Biener 6ec96dcb6b match.pd: Add BIT_FIELD_REF canonicalizations.
2018-07-24  Richard Biener  <rguenther@suse.de>

	* match.pd: Add BIT_FIELD_REF canonicalizations.

From-SVN: r262946
2018-07-24 13:29:07 +00:00
Jonathan Wakely 4f3c75ba3a Reorder conditions in uses-allocator construction helper
The erased_type condition is only true for code using the Library
Fundamentals TS, so assume it's less common and only check it after
checking for convertibility.

This does mean for types using erased_type the more expensive
convertibility check is done first, but such types are rare.

	* include/bits/uses_allocator.h (__is_erased_or_convertible): Reorder
	conditions. Add comments.
	* testsuite/20_util/uses_allocator/69293_neg.cc: Adjust dg-error line.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.
	* testsuite/20_util/scoped_allocator/69293_neg.cc: Likewise.

From-SVN: r262945
2018-07-24 14:03:25 +01:00
Jonathan Wakely 7a4be38049 Make __resource_adaptor_imp usable with C++17 memory_resource
By making the memory_resource base class a template parameter the
__resource_adaptor_imp can be used to adapt an allocator into a
std::pmr::memory_resource instead of experimental::pmr::memory_resource.

	* include/experimental/memory_resource: Adjust comments and
	whitespace.
	(__resource_adaptor_imp): Add second template parameter for type of
	memory resource base class.
	(memory_resource): Define default constructor, destructor, copy
	constructor and copy assignment operator as defaulted.

From-SVN: r262944
2018-07-24 14:03:20 +01:00
Jonathan Wakely 0568ade6f8 PR libstdc++/70966 fix lifetime bug for default resource
PR libstdc++/70966
	* include/experimental/memory_resource (__get_default_resource): Use
	placement new to create an object with dynamic storage duration.

From-SVN: r262943
2018-07-24 14:03:11 +01:00
Jakub Jelinek ffb164c7df re PR testsuite/86649 (g++.dg/tree-ssa/pr19476-1.C fails starting with r262928)
PR testsuite/86649
	* g++.dg/tree-ssa-/pr19476-1.C: Check dom2 dump instead of ccp1.
	* g++.dg/tree-ssa-/pr19476-5.C: Likewise.
	* g++.dg/tree-ssa-/pr19476-6.C: New test.
	* g++.dg/tree-ssa-/pr19476-7.C: New test.

From-SVN: r262942
2018-07-24 12:24:00 +02:00
GCC Administrator 9798833467 Daily bump.
From-SVN: r262940
2018-07-24 00:16:33 +00:00
David Edelsohn 5b3d96f24f inclhack.def (aix_unistd): New.
* inclhack.def (aix_unistd): New.
* fixincl.x: Regenerate.
* tests/base/unistd.h [AIX_UNISTD_CHECK]: New test.

From-SVN: r262936
2018-07-23 16:51:50 -04:00
Jonathan Wakely 2d6c8eea1d PR libstdc++/70940 optimize pmr::resource_adaptor for allocators using malloc
pmr::resource_adaptor can avoid allocating an oversized buffer and doing
manual alignment within that buffer when the wrapped allocator is known
to always meet the requested alignment. Specifically, if the allocator
is known to use malloc or new directly, then we can call the allocator
directly for any fundamental alignment.

	PR libstdc++/70940
	* include/experimental/memory_resource
	(__resource_adaptor_common::_AlignMgr::_M_unadjust): Add assertion.
	(__resource_adaptor_common::__guaranteed_alignment): New helper to
	give maximum alignment an allocator guarantees. Specialize for known
	allocators using new and malloc.
	(__resource_adaptor_imp::do_allocate): Use __guaranteed_alignment.
	(__resource_adaptor_imp::do_deallocate): Likewise.
	* testsuite/experimental/memory_resource/new_delete_resource.cc:
	Check that new and delete are called with expected sizes.

From-SVN: r262935
2018-07-23 20:40:28 +01:00
Carl Love 651a79532c re PR target/86591 (gcc.target/powerpc/builtins-1.c fails starting with r261904)
gcc/testsuite/ChangeLog:

2018-07-23  Carl Love  <cel@us.ibm.com>

	PR 86591
	* gcc.target/powerpc/altivec-1-runnable.c: Move vector double tests to
	file altivec-2-runnable.c.
	* gcc.target/powerpc/altivec-2-runnable.c: Add vector double tests.
	* gcc.target/powerpc/buitlins-1.c: Remove dg-final check for xxlor.
	Update dg-final test for __divdi3 and __udivdi3 instructions. Update
	comments for instruction generated by vec_mergeh, vec_perm, vec_round,
	vec_cts, vec_ctu, vec_cpsgn tests.

From-SVN: r262934
2018-07-23 16:16:41 +00:00
Bernd Edlinger 1544db9a61 re PR c/86617 (Volatile qualifier is ignored sometimes for unsigned char)
gcc:
2018-07-23  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c/86617
        * genmatch.c (dt_operand::gen_match_op): Avoid folding volatile values.

testsuite:
2018-07-23  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c/86617
        * gcc.dg/pr86617.c: New test.

From-SVN: r262933
2018-07-23 13:23:51 +00:00
Bernd Edlinger a353fec45a gimple-fold.c (gimple_fold_builtin_printf): Don't create a not NUL terminated STRING_CST object.
2018-07-23  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * gimple-fold.c (gimple_fold_builtin_printf): Don't create a not NUL
        terminated STRING_CST object.

From-SVN: r262932
2018-07-23 13:20:38 +00:00
Bernd Edlinger 723f415edc 2018-07-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
hsa-dump.c (dump_hsa_symbol): Avoid out of scope access to buf.

From-SVN: r262931
2018-07-23 12:48:48 +00:00
Segher Boessenkool 9fede15c4d rs6000: Improve vsx_init_v4si
This changes vsx_init_v4si to be an expander.  That way, no special
cases are needed anymore for special arguments: the normal RTL passes
can deal with it.


	* config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Adjust.
	* config/rs6000/rs6000-protos.h (rs6000_split_v4si_init): Delete.
	* config/rs6000/rs6000.c (rs6000_expand_vector_init): Always force
	the elements into a register.
	(rs6000_split_v4si_init_di_reg): Delete.
	(rs6000_split_v4si_init): Delete.
	* config/rs6000/vsx.md (unspec): Delete UNSPEC_VSX_VEC_INIT.
	(vsx_init_v4si): Rewrite as a define_expand.

From-SVN: r262930
2018-07-23 13:27:38 +02:00
Segher Boessenkool 268e16e89b rs6000: Generate rl*imi for memory some more
An rl<wd>imi instruction is often written like "(a << 8) | (b & 255)".
If "b" now is a byte in memory, combine will combine the load with the
masking (with 255 in the example), since that is a single instruction;
and then the rl*imi isn't combined from the remaining pieces.

This patch adds a splitter to make combine handle this case.


	* config/rs6000/rs6000.md (splitters for rldimi and rlwimi with the
	zero_extend argument from memory): New.

From-SVN: r262929
2018-07-23 13:25:28 +02:00
Jakub Jelinek 315aa691f4 re PR c++/86569 (-Wnonnull-compare affects code generation since r233684)
PR c++/86569
	* cp-gimplify.c (cp_fold): Don't fold comparisons into other kind
	of expressions other than INTEGER_CST regardless of TREE_NO_WARNING
	or warn_nonnull_compare.

	* g++.dg/warn/Wnonnull-compare-9.C: New test.

From-SVN: r262928
2018-07-23 09:48:56 +02:00
GCC Administrator d9690d237c Daily bump.
From-SVN: r262927
2018-07-23 00:16:33 +00:00
Martin Sebor ef856020de PR bootstrap/86621 - 'alloca' bound is unknown in tree-vect-slp.c:1437:16
gcc/ChangeLog:
	* gcc/gimple-ssa-warn-alloca.c (alloca_call_type_by_arg): Avoid
	diagnosing calls with unknown arguments unless -Walloca-larger-than
	is restricted to less than PTRDIFF_MAX bytes.

From-SVN: r262923
2018-07-22 15:09:32 -06:00
Gerald Pfeifer 5037f87ef9 * doc/gcov.texi (Invoking Gcov): Editorial changes.
From-SVN: r262922
2018-07-22 08:39:57 +00:00
GCC Administrator cf1499d2ad Daily bump.
From-SVN: r262921
2018-07-22 00:16:18 +00:00
GCC Administrator 42c4eafee9 Daily bump.
From-SVN: r262917
2018-07-21 00:16:31 +00:00
David Malcolm 181463c271 libcpp: remove redundant parameter from rich_location::set_range
gcc/c-family/ChangeLog:
	* c-common.c (c_cpp_error): Remove redundant "line_table"
	parameter from call to rich_location::set_range.
	(maybe_suggest_missing_token_insertion): Likewise.

gcc/ChangeLog:
	* pretty-print.c (text_info::set_location): Remove redundant
	"line_table" parameter from call to rich_location::set_range.

libcpp/ChangeLog:
	* include/line-map.h (rich_location::set_range): Remove redundant
	line_maps * parameter.
	* line-map.c (rich_location::set_range): Likewise.

From-SVN: r262913
2018-07-20 21:39:14 +00:00
Martin Sebor 0d7f906520 PR middle-end/82063 - issues with arguments enabled by -Wall
gcc/c-family/ChangeLog:
	* gcc/c-family/c.opt (-Warray-bounds): Remove redundant -Wall.

From-SVN: r262912
2018-07-20 15:19:49 -06:00
Martin Sebor cb4df8efb5 re PR middle-end/82063 (issues with arguments enabled by -Wall)
PR middle-end/82063

gcc/testsuite/ChangeLog:

	* gcc/testsuite/c-c++-common/pr68833-1.c: Adjust.

From-SVN: r262911
2018-07-20 15:18:31 -06:00
Martin Sebor 00abf86c47 PR middle-end/82063 - issues with arguments enabled by -Wall
gcc/ada/ChangeLog:

	PR middle-end/82063
	* gcc-interface/misc.c (gnat_handle_option): Change function argument
	to HOST_WIDE_INT.

gcc/brig/ChangeLog:

	PR middle-end/82063
	* brig/brig-lang.c (brig_langhook_handle_option): Change function
	argument to HOST_WIDE_INT.

gcc/c-family/ChangeLog:

	PR middle-end/82063
	* c-common.h (c_common_handle_option): Change function argument
	to HOST_WIDE_INT.
	* c-opts.c (c_common_init_options): Same.
	(c_common_handle_option): Same.  Remove special handling of
	OPT_Walloca_larger_than_ and OPT_Wvla_larger_than_.
	* c.opt (-Walloc-size-larger-than, -Walloca-larger-than): Change
	options to take a HOST_WIDE_INT argument and accept a byte-size
	suffix.  Initialize.
	(-Wvla-larger-than): Same.
	(-Wno-alloc-size-larger-than, -Wno-alloca-larger-than): New.
	(-Wno-vla-larger-than): Same.

gcc/fortran/ChangeLog:

	PR middle-end/82063
	* gfortran.h (gfc_handle_option): Change function argument
	to HOST_WIDE_INT.
	* options.c (gfc_handle_option): Same.

gcc/go/ChangeLog:

	PR middle-end/82063
	* go-lang.c (go_langhook_handle_option): Change function argument
	to HOST_WIDE_INT.

gcc/lto/ChangeLog:

	PR middle-end/82063
	* lto-lang.c (lto_handle_option): Change function argument
	to HOST_WIDE_INT.

gcc/testsuite/ChangeLog:

	PR middle-end/82063
	* gcc/testsuite/c-c++-common/pr68657-1.c: Adjust.
	* gcc/testsuite/c-c++-common/pr68657-2.c: Same.
	* gcc/testsuite/c-c++-common/pr68657-3.c: Same.
	* gcc.dg/Walloc-size-larger-than-16.c: Same.
	* gcc.dg/Walloca-larger-than.c: New test.
	* gcc.dg/Walloca-larger-than-2.c: New test.
	* gcc.dg/Wframe-larger-than-2.c: New test.
	* gcc.dg/Wlarger-than3.c: New test.
	* gcc.dg/Wvla-larger-than-3.c: New test.
	* gcc.dg/pr42611.c: Adjust.
	* gnat.dg/frame_overflow.adb: Same.

gcc/ChangeLog:

	PR middle-end/82063
	* builtins.c (expand_builtin_alloca): Adjust.
	* calls.c (alloc_max_size): Simplify.
	* cgraphunit.c (cgraph_node::expand): Adjust.
	* common.opt (larger_than_size, warn_frame_larger_than): Remove
	variables.
	(frame_larger_than_size): Same.
	(-Wframe-larger-than, -Wlarger-than, -Wstack-usage): Change options
	to take a HOST_WIDE_INT argument and accept a byte-size suffix.
	Initialize.
	* doc/invoke.texi (GCC Command Options): Document option arguments.
	Explain byte-size arguments and suffixes.
	(-Wvla-larger-than, -Wno-alloc-size-larger-than): Update.
	(-Wno-alloca-larger-than, -Wno-vla-larger-than): Same.
	(-Wframe-larger-than, -Wlarger-than, -Wstack-usage): Same.
	* doc/options.texi (UInteger): Expand.
	(Host_Wide_Int, ByteSize): Document new properties.
	* final.c (final_start_function_1): Include sizes in an error message.
	* function.c (frame_offset_overflow): Same.
	* gimple-ssa-warn-alloca.c (pass_walloca::gate): Adjust.
	(alloca_call_type_by_arg): Change function argument to HOST_WIDE_INT.
	Diagnose unbounded alloca calls only for limits of less than
	PTRDIFF_MAX.
	(alloca_call_type): Adjust.  Diagnose possibly out-of-bounds alloca
	calls and VLA size only for limits of less than	PTRDIFF_MAX.  Same
	for alloca(0).
	(pass_walloca::execute): Adjust.  Diagnose alloca calls in loops
	only for limits of less than PTRDIFF_MAX.
	* langhooks-def.h (lhd_handle_option): Change function argument
	to HOST_WIDE_INT.
	* langhooks.c (lhd_handle_option): Same.
	* langhooks.h (handle_option): Same.
	* opt-functions.awk (switch_bit_fields): Handle Host_Wide_Int and
	ByteSize flags.
	(var_type, var_type_struct): Same.
	(var_set): Handle ByteSize flag.
	* optc-gen.awk: Add comments to output to ease debugging.  Make
	use of HOST_WIDE_INT where appropriate.
	* opts-gen-save.awk:  Use %lx to format unsigned long.
	* opth-gen.awk: Change function argument to HOST_WIDE_INT.
	* opts-common.c (integral_argument): Return HOST_WIDE_INT and add
	arguments.  Parse bytes-size suffixes.
	(enum_arg_to_value): Change function argument to HOST_WIDE_INT.
	(enum_value_to_arg): Same.
	(decode_cmdline_option): Handle cl_host_wide_int.  Adjust.
	(handle_option): Adjust.
	(generate_option): Change function argument to HOST_WIDE_INT.
	(cmdline_handle_error): Adjust.
	(read_cmdline_option): Change function argument to HOST_WIDE_INT.
	(set_option): Change function argument to HOST_WIDE_INT.
	(option_enabled): Handle cl_host_wide_int.
	(get_option_state): Handle CLVC_SIZE.
	(control_warning_option): Same.
	* opts.c (common_handle_option): Change function argument to
	HOST_WIDE_INT.  Remove handling of OPT_Walloca_larger_than_ and
	OPT_Wvla_larger_than_.
	* opts.h (enum cl_var_type): Add an enumerator.
	* stor-layout.c (layout_decl): Print a more meaningful warning.
	* toplev.c (output_stack_usage): Adjust.

From-SVN: r262910
2018-07-20 14:51:20 -06:00