1. 31 Aug, 2019 9 commits
  2. 30 Aug, 2019 23 commits
    • RISC-V: Disable -msave-restore for shared libraries. · a169f358
      This was noticed while trying to test -msave-restore support.  The
      save/restore routines use the alternate return register t0/x5 which is
      clobbered by the PLT header, so we can't use them in shared libraries.
      This patch disables -msave-restore when -fpic (and -mplt), and emits a
      warning if the user explicitly turned on -msave-restore.
      
      	gcc/
      	* config/riscv/riscv.c (riscv_option_override): If -msave-restore
      	and -fpic and -mplt then disable -msave-restore and warn.
      
      From-SVN: r275231
      Jim Wilson committed
    • compile, runtime: permit anonymous and empty fields in C header · 4a140826
          
          Permit putting structs with anonymous and empty fields in the C header
          file runtime.inc that is used to build the C runtime code.  This is
          required for upcoming 1.13 support, as the m struct has picked up an
          anonymous field.
          
          Doing this lets the C header contain all the type descriptor structs,
          so start using those in the C code.  This cuts the number of copies of
          type descriptor definitions from 3 to 2.
          
          Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192343
      
      From-SVN: r275227
      Ian Lance Taylor committed
    • Fix ChangeLog · aff0632d
      From-SVN: r275223
      Jonathan Wakely committed
    • PR middle-end/91599 - GCC does not say where warning is happening · 648af168
      gcc/ChangeLog:
      
      	PR middle-end/91599
      	* tree-ssa-strlen.c (handle_store): Use a fallback location if
      	the statement doesn't have one.
      	* gimple-pretty-print.c (percent_G_format): Same.
      
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/91599
      	* gcc.dg/Wstringop-overflow-16.c: New test.
      
      From-SVN: r275211
      Martin Sebor committed
    • PR middle-end/91584 - Bogus warning from -Warray-bounds during string assignment · 5d69df7e
      gcc/ChangeLog:
      
      	PR middle-end/91584
      	* tree-vrp.c (vrp_prop::check_mem_ref): Normalize type domain bounds
      	before using them to validate MEM_REF offset.
      
      gcc/testsuite/ChangeLog:
      	* gfortran.dg/char_array_constructor_4.f90: New test.
      
      From-SVN: r275210
      Martin Sebor committed
    • Optimize std::to_chars · 7259a9d5
      Bunch of micro optimizations for std::to_chars:
      * For base == 8 replacing the lookup in __digits table with arithmetic
      computations leads to a same CPU cycles for a loop (exchanges two movzx
      with 3 bit ops). However this saves 129 bytes of data and totally avoids
      a chance of cache misses on __digits.
      * For base == 16 replacing the lookup in __digits table with
      arithmetic computations leads to a few additional instructions, but
      totally avoids a chance of cache misses on __digits (- ~9 cache misses
      for worst case) and saves 513 bytes of const data.
      * Replacing __first[pos] and __first[pos - 1] with __first[1] and
      __first[0] on final iterations saves ~2% of code size.
      * Removing trailing '\0' from arrays of digits allows the linker to
      merge the symbols (so that "0123456789abcdefghijklmnopqrstuvwxyz" and
      "0123456789abcdef" could share the same address). This improves data
      locality and reduces binary sizes.
      * Using __detail::__to_chars_len_2 instead of a generic
      __detail::__to_chars_len makes the operation O(1) instead of O(N). It
      also makes the code two times shorter.
      
      In sum: this significantly reduces the size of a binary (for about 4KBs
      only for base-8 conversion), deals with latency (CPU cache misses)
      without changing the iterations count and without adding costly
      instructions into the loops.
      
      2019-08-30  Antony Polukhin  <antoshkka@gmail.com>
      
      	* include/std/charconv (__detail::__to_chars_8)
      	__detail::__to_chars_16): Replace array of precomputed digits with
      	arithmetic operations to avoid CPU cache misses. Remove zero
      	termination from array of digits to allow symbol merge with generic
      	implementation of __detail::__to_chars. Replace final offsets with
      	constants. Use __detail::__to_chars_len_2 instead of a generic
      	__detail::__to_chars_len.
      	(__detail::__to_chars): Remove zero termination from array of digits.
      	(__detail::__to_chars_2): Leading digit is always '1'.
      
      From-SVN: r275205
      Antony Polukhin committed
    • Fix errors in new test · 1ecaf589
      	* testsuite/23_containers/vector/cons/89164_c++17.cc: Fix errors.
      
      From-SVN: r275204
      Jonathan Wakely committed
    • decl.c (maybe_saturate_size): New function. · 875bdbe2
      	* gcc-interface/decl.c (maybe_saturate_size): New function.
      	(gnat_to_gnu_entity): Invoke it on the Esize of types before sending
      	it for back-annotations.
      	* gcc-interface/trans.c: Fix typo.
      
      From-SVN: r275200
      Eric Botcazou committed
    • baseline_symbols.txt: Update. · f76cf133
      	* config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update.
      
      From-SVN: r275199
      Uros Bizjak committed
    • ada-tree.h (DECL_FORCED_BY_REF_P): New macro. · 1edbeb15
      	* gcc-interface/ada-tree.h (DECL_FORCED_BY_REF_P): New macro.
      	* gcc-interface/decl.c (gnat_to_gnu_param): Set it on parameters
      	whose mechanism was forced to by-reference.
      	* gcc-interface/trans.c (Call_to_gnu): Do not issue a warning about a
      	misaligned actual parameter if it is based on a CONSTRUCTOR.  Remove
       	obsolete warning for users of Starlet.  Issue a warning if a temporary
      	is make around the call for a parameter with DECL_FORCED_BY_REF_P set.
      	(addressable_p): Return true for REAL_CST and ADDR_EXPR.
      
      From-SVN: r275198
      Eric Botcazou committed
    • trans.c (gnat_to_gnu): Do not set the location on an expression used for a tag. · 5e017b1e
      	* gcc-interface/trans.c (gnat_to_gnu): Do not set the location on an
      	expression used for a tag.
      
      From-SVN: r275197
      Eric Botcazou committed
    • gigi.h (aggregate_type_contains_array_p): Declare. · 0c2837b5
      	* gcc-interface/gigi.h (aggregate_type_contains_array_p): Declare.
      	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: For an
      	extension, test Has_Record_Rep_Clause instead of Has_Specified_Layout.
      	(adjust_packed): Return 0 if the type of the field is an aggregate
      	type that contains (or is) a self-referential array.
      	(type_has_variable_size): Delete.
      	* gcc-interface/utils.c (inish_record_type): Constify a variable.
      	(aggregate_type_contains_array_p): Add parameter SELF_REFERENTIAL.
      	<RECORD_TYPE>: Pass it in the recursive call.
      	<ARRAY_TYPE>: If it is true, return true only if the array type is
      	self-referential.
      	(create_field_decl): Streamline the setting of the alignment on the
      	field.  Pass false to aggregate_type_contains_array_p.
      
      From-SVN: r275196
      Eric Botcazou committed
    • * gcc.target/mips/r10k-cache-barrier-9.c: Suppress warnings. · c85dbadc
      From-SVN: r275195
      Jeff Law committed
    • trans.c (lvalue_required_p): Adjust GNU_TYPE in the recursive call. · 7f6dd102
      	* gcc-interface/trans.c (lvalue_required_p) <N_Slice>: Adjust GNU_TYPE
      	in the recursive call.
      	<N_Selected_Component>: Likewise.
      
      From-SVN: r275191
      Eric Botcazou committed
    • utils.c (build_template): Deal with parameters passed by pointer to component of… · e5969b73
      utils.c (build_template): Deal with parameters passed by pointer to component of multi-dimensional arrays.
      
      	* gcc-interface/utils.c (build_template): Deal with parameters
      	passed by pointer to component of multi-dimensional arrays.
      
      From-SVN: r275190
      Eric Botcazou committed
    • decl.c (annotate_value): Inline the call also if List_Representation_Info is greater than 3. · 37cf9302
      	* gcc-interface/decl.c (annotate_value) <CALL_EXPR>: Inline the call
      	also if List_Representation_Info is greater than 3.
      
      From-SVN: r275188
      Eric Botcazou committed
    • * doc/invoke.texi (-Wvolatile): Use @code for volatile. · 81e753d9
      From-SVN: r275178
      Marek Polacek committed
    • PR libstdc++/89164 enforce constraints for uninitialized algos · 61f5cb23
      The memmove optimizations for std::uninitialized_copy/fill/_n will
      compile even if the type is not copy constructible, because std::copy
      doesn't require copy construction to work. But the uninitialized
      algorithms do require it.
      
      This adds explicit static assertions to ensure we don't allow ill-formed
      initializations.
      
      	PR libstdc++/89164
      	* include/bits/stl_algobase.h (__copy_move): Give descriptive names
      	to template parameters.
      	* include/bits/stl_uninitialized.h (uninitialized_copy)
      	(uninitialized_fill, uninitialized_fill_n): Add static assertions to
      	diagnose invalid uses.
      	* testsuite/20_util/specialized_algorithms/uninitialized_copy/1.cc:
      	Adjust expected error.
      	* testsuite/20_util/specialized_algorithms/uninitialized_copy/89164.cc:
      	New test.
      	* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/
      	89164.cc: New test.
      	* testsuite/20_util/specialized_algorithms/uninitialized_fill/89164.cc:
      	New test.
      	* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/
      	89164.cc: New test.
      	* testsuite/23_containers/vector/cons/89164.cc: New test.
      	* testsuite/23_containers/vector/cons/89164_c++17.cc: New test.
      
      From-SVN: r275177
      Jonathan Wakely committed
    • gigi.h (gigi_checking_assert): New macro. · 815b5368
      	* gcc-interface/gigi.h (gigi_checking_assert): New macro.
      	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Type>:
      	Remove redundant test and adjust comments.  Minor tweaks.
      	* gcc-interface/trans.c (Call_to_gnu): Do not generate range checks,
      	instead assert that the Do_Range_Check flag is not set.  Adjust call
      	to convert_with_check.
      	(gnat_to_gnu): Likewise.
      	(assoc_to_constructor): Likewise.
      	(pos_to_constructor): Likewise.  Remove GNAT_COMPONENT_TYPE parameter.
      	(emit_range_check): Delete.
      	(convert_with_check): Remove RANGE_P parameter and adjust.  Do a single
      	overflow check for modular types.
      
      From-SVN: r275174
      Eric Botcazou committed
    • arm.md (unaligned_loaddi, [...]): New unspec insn patterns. · 3eefaaa9
      2019-08-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              * config/arm/arm.md (unaligned_loaddi,
              unaligned_storedi): New unspec insn patterns.
              * config/arm/neon.md (unaligned_storev8qi): Likewise.
              * config/arm/arm.c (gen_cpymem_ldrd_strd): Use unaligned_loaddi
              and unaligned_storedi for 4-byte aligned memory.
              (arm_block_set_aligned_vect): Use unaligned_storev8qi for
              4-byte aligned memory.
      
      From-SVN: r275063
      Bernd Edlinger committed
    • [PR 91579] Avoid creating redundant PHI nodes in tail-call pass · bb4d170d
      2019-08-30  Martin Jambor  <mjambor@suse.cz>
      
      	tree-optimization/91579
      	* tree-tailcall.c (tailr_arg_needs_copy): New variable.
      	(find_tail_calls): Allocate tailr_arg_needs_copy and set its bits as
      	appropriate.
      	(arg_needs_copy_p): Removed.
      	(eliminate_tail_call): Test tailr_arg_needs_copy instead of calling
      	arg_needs_copy_p.
      	(tree_optimize_tail_calls_1): Likewise.  Free tailr_arg_needs_copy.
      
      	testsuite/
      	* gcc.dg/tree-ssa/pr91579.c: New test.
      
      From-SVN: r275062
      Martin Jambor committed
    • Daily bump. · ffb738a2
      From-SVN: r275059
      GCC Administrator committed
  3. 29 Aug, 2019 8 commits