1. 25 Jul, 2018 15 commits
    • Regenerate .pot files. · 44f916dc
      gcc/po:
      	* gcc.pot: Regenerate.
      
      libcpp/po:
      	* cpplib.pot: Regenerate.
      
      From-SVN: r262972
      Joseph Myers committed
    • [ARC] Improve instruction selection for fp moves. · a9637757
      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
      Claudiu Zissulescu committed
    • [ARC] Fix uncache attribute. · 3e4a5f54
      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
      Claudiu Zissulescu committed
    • [ARC] Add more additional register names · 8f176ba2
      gcc/
        Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.h (ADDITIONAL_REGISTER_NAMES): Add additional
      	register names.
      
      From-SVN: r262969
      Claudiu Zissulescu committed
    • optinfo-emit-json.cc: fix trivial memory leak · ee50ba77
      gcc/ChangeLog:
      	* optinfo-emit-json.cc (class optrecord_json_writer): Convert
      	field "m_scopes" from vec to auto_vec.
      
      From-SVN: r262967
      David Malcolm committed
    • Fix wrong declaration. · e8e3751c
      2018-07-25  Martin Liska  <mliska@suse.cz>
      
      	* config/powerpcspe/powerpcspe-protos.h (rs6000_loop_align): Fix
              return type.
      
      From-SVN: r262966
      Martin Liska committed
    • re PR lto/86654 (ICE in gen_member_die, at dwarf2out.c:24933) · 9c13689e
      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
      Richard Biener committed
    • Add new src/c++17 directory to list in acinclude.m4 · a9d49e96
      	* acinclude.m4 (glibcxx_SUBDIRS): Add src/c++17.
      	* src/Makefile.am: Add comment.
      	* src/c++17/Makefile.in: Regenerate.
      
      From-SVN: r262964
      Jonathan Wakely committed
    • Move std::unique_lock definition to a separate header · 1fba0606
      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
      Jonathan Wakely committed
    • Add PR number · 1978cc78
      From-SVN: r262962
      Richard Sandiford committed
    • Fix ceil_log2(0) (PR 86644) · e8dce850
      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
      Richard Sandiford committed
    • Limit dump_flag enum values range (PR middle-end/86645). · de6c8d7f
      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
      Martin Liska committed
    • Explain asan parameters in params.def (PR sanitizer/79635). · 5a0e1270
      2018-07-25  Martin Liska  <mliska@suse.cz>
      
              PR sanitizer/79635
      	* params.def: Explain ASan abbreviation and provide
              a documentation link.
      
      From-SVN: r262959
      Martin Liska committed
    • PR tree-optimization/86622 - incorrect strlen of array of array plus variable offset · bfb9bd47
      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
      Martin Sebor committed
    • Daily bump. · ae752f02
      From-SVN: r262957
      GCC Administrator committed
  2. 24 Jul, 2018 13 commits
    • Add initial version of C++17 <memory_resource> header · dfaa3c47
      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
      Jonathan Wakely committed
    • PR libstdc++/86658 fix __niter_wrap to not copy invalid iterators · e874029d
      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
      Jonathan Wakely committed
    • Avoid &LOOP_VINFO_MASKS for bb vectorisation (PR 86618) · ed623edb
      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
      Richard Sandiford committed
    • Fix segfault in -fsave-optimization-record (PR tree-optimization/86636) · dad2580c
      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
      David Malcolm committed
    • [GCC][AARCH64] Canonicalize aarch64 widening simd plus insns · 8da03df5
      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
      Matthew Malcomson committed
    • re PR middle-end/86627 (Signed 128-bit division by 2 no longer expanded to RTL) · ebac3c02
      	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
      Jakub Jelinek committed
    • Minor refactoring in <bit> header · 337dc307
      	* 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
      Jonathan Wakely committed
    • match.pd: Add BIT_FIELD_REF canonicalizations. · 6ec96dcb
      2018-07-24  Richard Biener  <rguenther@suse.de>
      
      	* match.pd: Add BIT_FIELD_REF canonicalizations.
      
      From-SVN: r262946
      Richard Biener committed
    • Reorder conditions in uses-allocator construction helper · 4f3c75ba
      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
      Jonathan Wakely committed
    • Make __resource_adaptor_imp usable with C++17 memory_resource · 7a4be380
      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
      Jonathan Wakely committed
    • PR libstdc++/70966 fix lifetime bug for default resource · 0568ade6
      	PR libstdc++/70966
      	* include/experimental/memory_resource (__get_default_resource): Use
      	placement new to create an object with dynamic storage duration.
      
      From-SVN: r262943
      Jonathan Wakely committed
    • re PR testsuite/86649 (g++.dg/tree-ssa/pr19476-1.C fails starting with r262928) · ffb164c7
      	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
      Jakub Jelinek committed
    • Daily bump. · 97988334
      From-SVN: r262940
      GCC Administrator committed
  3. 23 Jul, 2018 10 commits
    • inclhack.def (aix_unistd): New. · 5b3d96f2
      * inclhack.def (aix_unistd): New.
      * fixincl.x: Regenerate.
      * tests/base/unistd.h [AIX_UNISTD_CHECK]: New test.
      
      From-SVN: r262936
      David Edelsohn committed
    • PR libstdc++/70940 optimize pmr::resource_adaptor for allocators using malloc · 2d6c8eea
      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
      Jonathan Wakely committed
    • re PR target/86591 (gcc.target/powerpc/builtins-1.c fails starting with r261904) · 651a7953
      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
      Carl Love committed
    • re PR c/86617 (Volatile qualifier is ignored sometimes for unsigned char) · 1544db9a
      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
      Bernd Edlinger committed
    • gimple-fold.c (gimple_fold_builtin_printf): Don't create a not NUL terminated STRING_CST object. · a353fec4
      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
      Bernd Edlinger committed
    • 2018-07-23 Bernd Edlinger <bernd.edlinger@hotmail.de> · 723f415e
              hsa-dump.c (dump_hsa_symbol): Avoid out of scope access to buf.
      
      From-SVN: r262931
      Bernd Edlinger committed
    • rs6000: Improve vsx_init_v4si · 9fede15c
      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
      Segher Boessenkool committed
    • rs6000: Generate rl*imi for memory some more · 268e16e8
      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
      Segher Boessenkool committed
    • re PR c++/86569 (-Wnonnull-compare affects code generation since r233684) · 315aa691
      	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
      Jakub Jelinek committed
    • Daily bump. · d9690d23
      From-SVN: r262927
      GCC Administrator committed
  4. 22 Jul, 2018 2 commits