1. 27 Feb, 2020 17 commits
    • libstdc++: Fix std::string error in Debug Mode · f32a3662
      This fixes a test failure with -std=gnu++98 -D_GLIBCXX_DEBUG:
      
      FAIL: 21_strings/basic_string/modifiers/insert/char/1.cc (test for excess errors)
      
      	* include/debug/string (__gnu_debug::basic_string::insert): Fix for
      	C++98 where the member function of the base class returns void.
      Jonathan Wakely committed
    • Fix broken type comparison assert · da5f369d
      In implementing Jason's suggested direction for 93933, the compiler
      exploded in a surprising way.  Turns out an assert had been passing
      NULLS to comptypes, and therefore not checking what it intended.
      
      Further comptypes, could silently accept such nulls under most
      circumstances.
      
      	* class.c (adjust_clone_args): Correct arg-checking assert.
      	* typeck.c (comptypes): Assert not nulls.
      Nathan Sidwell committed
    • libstdc++: Support N3644 "Null Forward Iterators" for testsuite iterators · e94f2542
      Comparing value-initialized forward_iterator_wrapper<T> objects fails an
      assertion, but should be valid in C++14 and later.
      
      	* testsuite/util/testsuite_iterators.h (forward_iterator_wrapper): Add
      	equality comparisons that support value-initialized iterators.
      Jonathan Wakely committed
    • tree-optimization/93508 - make VN translate through _chk and valueize length · e431546f
      Value-numbering failed to handle __builtin_{memcpy,memset,...}_chk
      variants when removing abstraction and also failed to use the
      value-numbering lattice when requiring the length argument of the
      call to be constant.
      
      2020-02-27  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/93508
      	* tree-ssa-sccvn.c (vn_reference_lookup_3): Handle _CHK like
      	non-_CHK variants.  Valueize their length arguments.
      
      	* gcc.dg/tree-ssa/ssa-fre-85.c: New testcase.
      Richard Biener committed
    • tree-optimization/93953 - avoid reference into hash-map · e840185b
      When possibly expanding a hash-map avoid keeping a reference to an
      entry.
      
      2020-02-27  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/93953
      	* tree-vect-slp.c (slp_copy_subtree): Avoid keeping a reference
      	to the hash-map entry.
      
      	* gcc.dg/pr93953.c: New testcase.
      Richard Biener committed
    • amdgcn: fix ICE on subreg of BI reg. · 82863a5c
      BImode usually only requires one bit, but instructions that write to VCC also
      clobber the reset of the DImode register pair, so gcn_class_max_nregs reports
      that two registers are needed for BImode.  Paradoxically, accessing VCC via
      SImode is therefore uses fewer registers than accessing via BImode.
      
      The LRA checking code takes this into account, but the DF liveness data also
      looks at the subreg, so it says (subreg:SI (reg:BI VCC) 0) only makes the low
      part live.  Both are "correct", but they disagree, which causes an ICE.
      
      This doesn't happen when writing conditions to VCC; it happens when accessing
      VCC_LO via a regular move to a regular SImode register.
      
      If we transform the subregs so that BImode is always the outer mode then it
      basically means the same thing, except that now both LRA and DF calculate nregs
      the same, and ICE goes away.
      
      As soon as LRA is done the subregs all evaporate anyway.
      
      2020-02-27  Andrew Stubbs  <ams@codesourcery.com>
      
      	gcc/
      	* config/gcn/gcn.md (mov<mode>): Add transformations for BI subregs.
      Andrew Stubbs committed
    • libstdc++: Make _GLIBCXX_CONCEPT_CHECKS more constexpr-friendly · eb8e6a30
      Although most of the old-style "concept checks" are only really usable
      with C++98 because they enforce the wrong things, this is a simple
      change that makes them a bit more useful for C++14 and up.
      
      	* include/bits/boost_concept_check.h (__function_requires): Add
      	_GLIBCXX14_CONSTEXPR.
      	* testsuite/25_algorithms/min/concept_checks.cc: New test.
      Jonathan Wakely committed
    • fix -fdebug-prefix-map without gas .file support · d1215304
      This applies file mapping when emitting the directory table
      directly instead of using the assemblers .file directive where
      we already correctly apply the map.  Notably the non-assembler
      path is used for the early debug emission for LTO.
      
      2020-02-27  Mark Williams  <mwilliams@fb.com>
      
      	* dwarf2out.c (file_name_acquire): Call remap_debug_filename.
      	* lto-opts.c (lto_write_options): Drop -fdebug-prefix-map,
      	-ffile-prefix-map and -fmacro-prefix-map.
      	* lto-streamer-out.c: Include file-prefix-map.h.
      	(lto_output_location): Remap the file part of locations.
      Richard Biener committed
    • gimplify: Don't optimize register const vars to static [PR93949] · 1956773c
      The following testcase is rejected, while it was accepted in 3.4 and earlier
      (before tree-ssa merge).
      The problem is that we decide to promote the const variable to TREE_STATIC,
      but TREE_STATIC DECL_REGISTER VAR_DECLs may only be the global register vars
      and so assemble_variable/make_decl_rtl diagnoses it.
      
      Either we do what the following patch does, where we could consider
      register as a hint the user doesn't want such optimization, because if
      something is forced static, it is not "register" anymore and register static
      is not valid in C either, or we could clear DECL_REGISTER instead, but would
      still need to punt at least on DECL_HARD_REGISTER cases.
      
      2020-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c/93949
      	* gimplify.c (gimplify_init_constructor): Don't promote readonly
      	DECL_REGISTER variables to TREE_STATIC.
      
      	* gcc.c-torture/compile/pr93949.c: New test.
      Jakub Jelinek committed
    • sccvn: Handle non-byte aligned offset or size for memset (, 123, ) [PR93945] · 5f9cd512
      The following is the last spot in vn_reference_lookup_3 that didn't allow
      non-byte aligned offsets or sizes.  To be precise, it did allow size that
      wasn't multiple of byte size and that caused a wrong-code issue on
      big-endian, as the pr93945.c testcase shows, so for GCC 9 we should add
      && multiple_p (ref->size, BITS_PER_UNIT) check instead.
      For the memset with SSA_NAME middle-argument, it still requires byte-aligned
      offset, as we'd otherwise need to rotate the value at runtime.
      
      2020-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/93582
      	PR tree-optimization/93945
      	* tree-ssa-sccvn.c (vn_reference_lookup_3): Handle memset with
      	non-zero INTEGER_CST second argument and ref->offset or ref->size
      	not a multiple of BITS_PER_UNIT.
      
      	* gcc.dg/tree-ssa/pr93582-9.c: New test.
      	* gcc.c-torture/execute/pr93945.c: New test.
      Jakub Jelinek committed
    • doc: Update description of BullFreeware · 4fd9efc8
      	* doc/install.texi (Binaries): Update description of BullFreeware.
      Jonathan Wakely committed
    • maintainer-scripts: Speed up git clone in gcc_release · 494e434c
      When doing the 8.4-rc1, I've noticed (probably also because of the dying
      disk on sourceware) that git clone is extremely slow, and furthermore when
      all of us have some local snapshots, it is a waste of resources to download
      everything again.  Especially for the -f runs when we'll need to wait until
      git tag -s asks us for a gpg password interactively.
      
      The following patch adds an option through which one can point the script
      at a local gcc .git directory from which it can --dissociate --reference ...
      during cloning to speed it up.
      
      2020-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	* gcc_release: Add support for -b local-git-repo argument.
      Jakub Jelinek committed
    • Document negative form of warning options enabled by default [PR90467]. · cf70bb0f
      2020-02-26  Sandra Loosemore  <sandra@codesourcery.com>
      
      	PR c++/90467
      
      	gcc/
      	* doc/invoke.texi (Option Summary): Re-alphabetize warnings in
      	C++ Language Options, Warning Options, and Static Analyzer
      	Options lists.  Document negative form of options enabled by
      	default.  Move some things around to more accurately sort
      	warnings by category.
      	(C++ Dialect Options, Warning Options, Static Analyzer
      	Options): Document negative form of options when enabled by
      	default.  Move some things around to more accurately sort
      	warnings by category.  Add some missing index entries.
      	Light copy-editing.
      Sandra Loosemore committed
    • c++: Fix ICE with invalid array bounds [PR93789] · 1231f71f
      r7-2111 introduced maybe_constant_value in cp_fully_fold.
      maybe_constant_value uses cxx_eval_outermost_constant_expr, which
      can clear TREE_CONSTANT:
      6510   else if (non_constant_p && TREE_CONSTANT (r))
      [...]
      6529       TREE_CONSTANT (r) = false;
      
      In this test the array size is '(long int) "h"'.  This used to be
      TREE_CONSTANT but given the change above, the flag will be cleared
      when we cp_fully_fold the array size in compute_array_index_type_loc.
      That means we don't emit an error in the
      10391   else if (TREE_CONSTANT (size)
      block in the same function, and we go on.  Then we compute ITYPE
      using cp_build_binary_op and use maybe_constant_value on it and
      suddenly we have something that's TREE_CONSTANT again.  And then we
      crash in reshape_init_array_1 in tree_to_uhwi, because what we have
      doesn't fit in an unsigned HWI.
      
      icc accepts this code, but since we used to reject it, I see no desire
      to make this work, so don't use the folded result when we've lost
      the TREE_CONSTANT flag while evaluating the size.
      
      2020-02-26  Marek Polacek  <polacek@redhat.com>
      
      	PR c++/93789 - ICE with invalid array bounds.
      	* decl.c (compute_array_index_type_loc): Don't use the folded
      	size when folding cleared TREE_CONSTANT.
      
      	* g++.dg/ext/vla22.C: New test.
      Marek Polacek committed
    • analyzer: fix ICE with -Wanalyzer-null-dereference [PR 93950] · 71b633aa
      PR analyzer/93950 reports an ICE when pruning the path of a
      -Wanalyzer-null-dereference diagnostic.
      
      The root cause is a bug in the state-tracking code, in which the
      variable of interest is tracked from the callee to a "nullptr" param
      at the caller, whereupon we have an INTEGER_CST "variable", and
      the attempt to look up its lvalue fails.
      
      This code could use a rewrite; in the meantime this patch extends
      the bulletproofing from g:8525d1f5
      for PR analyzer/93544 to all of the various places where var can
      be updated, fixing the ICE.
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/93950
      	* diagnostic-manager.cc
      	(diagnostic_manager::prune_for_sm_diagnostic): Assert that var is
      	either NULL or not a constant.  When updating var, bulletproof
      	against constant values.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/93950
      	* g++.dg/analyzer/pr93950.C: New test.
      David Malcolm committed
    • analyzer: fix ICE on unreachable calls [PR 93947] · 0ba70d1b
      PR analyzer/93947 reports an ICE at -O1 when attempting to analyze a
      call that has been optimized away as unreachable.
      
      The root cause is a NULL dereference due to the fndecl having a NULL
      cgraph_node: the cgraph_node was created by
      pass_build_cgraph_edges::execute, but was later removed by
      symbol_table::remove_unreachable_nodes before the analyzer pass.
      
      This patch fixes it by checking for NULL before handling the
      cgraph_node.
      
      The reproducer demonstrates a weakness in the analyzer's constraint
      handling, where region_model::apply_constraints_for_gswitch fails
      to spot when the cases fully cover the data type, and thus make the
      default impossible.  For now this is xfail-ed in the testcase.
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/93947
      	* region-model.cc (region_model::get_fndecl_for_call): Gracefully
      	fail for fn_decls that don't have a cgraph_node.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/93947
      	* gcc.dg/analyzer/torture/pr93947.c: New test.
      David Malcolm committed
    • Daily bump. · 89f759ac
      GCC Administrator committed
  2. 26 Feb, 2020 20 commits
    • PPC64, fix documentation for __builtin_crypto_vpmsum* builtin functions. · 15fc2e04
      PR target/91276 - Doc typos in __builtin_crypto_vpmsum*
      
      gcc/ChangeLog:
      
      2020-02-26  Carl Love  <cel@us.ibm.com>
      
      	PR target/91276
      	* doc/extend.texi (PowerPC AltiVec Built-in Functions available on
      	ISA 3.0): The builtin-function name __builtin_crypto_vpmsumb is only
      	for the vector unsigned short arguments.  It is also listed as the
      	name of the built-in for arguments vector unsigned short,
      	vector unsigned int and vector unsigned long long built-ins.  The
      	name of the builtins for these arguments should be:
      	__builtin_crypto_vpmsumh, __builtin_crypto_vpmsumw and
      	__builtin_crypto_vpmsumd respectively.
      
      Signed-off-by: Carl Love <carll@us.ibm.com>
      Carl Love committed
    • coroutines: Amend parameter handling to match n4849. · dc192bbd
      In n4849 and preceding versions, [class.copy.elision] (1.3)
      appears to confer additional permissions on coroutines to elide
      parameter copies.
      
      After considerable discussion on this topic by email and during
      the February 2020 WG21 meeting, it has been determined that there
      are no additional permissions applicable to coroutine parameter
      copy elision.
      
      The content of that clause in the standard is expected to be amended
      eventually to clarify this.  Other than this, the handling of
      parameter lifetimes is expected to be as per n4849:
      
       * A copy is made before the promise is constructed
       * If the promise CTOR uses the parms, then it should use the copy
         where appropriate.
       * The param copy lifetimes end after the promise is destroyed
         (during the coroutine frame destruction).
       * Otherwise, C++20 copy elision rules apply.
      
      (as an aside) In practice, we expect that copy elision can only occur
      when the coroutine body is fully inlined, possibly in conjunction with
      heap allocation elision.
      
      The patch:
       * Reorders the copying process to precede the promise CTOR and
          ensures the correct use.
       * Copies all params into the frame regardless of whether the coro
         body uses them (this is a bit unfortunate, and we should figure
         out an amendment for C++23).
      
      gcc/cp/ChangeLog:
      
      2020-02-26  Iain Sandoe  <iain@sandoe.co.uk>
      
      	* class.c (classtype_has_non_deleted_copy_ctor): New.
      	* coroutines.cc (struct param_info): Keep track of params
      	that are references, and cache the original type and whether
      	the DTOR is trivial.
      	(build_actor_fn): Handle param copies always, and adjust the
      	handling for references.
      	(register_param_uses): Only handle uses here.
      	(classtype_has_non_deleted_copy_ctor): New.
      	(morph_fn_to_coro): Adjust param copy handling to match n4849
      	by reordering ahead of the promise CTOR and always making a
      	frame copy, even if the param is unused in the coroutine body.
      	* cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
      
      gcc/testsuite/ChangeLog:
      
      2020-02-26  Iain Sandoe  <iain@sandoe.co.uk>
      
      	* g++.dg/coroutines/coro1-refs-and-ctors.h: New.
      	* g++.dg/coroutines/torture/func-params-07.C: New test.
      	* g++.dg/coroutines/torture/func-params-08.C: New test.
      Iain Sandoe committed
    • rs6000: Fix more testsuite fallout from rs6000_legitimate_address_p() fix. [PR93913] · 051b9873
      	PR target/93913
      	* gcc.target/powerpc/fold-vec-st-char.c (scan-assembler-times): Allow
      	stxv and stxvx instructions as well.
      	* gcc.target/powerpc/fold-vec-st-float.c: Likewise.
      	* gcc.target/powerpc/fold-vec-st-int.c: Likewise.
      	* gcc.target/powerpc/fold-vec-st-short.c: Likewise.
      Peter Bergner committed
    • c++: Some improvements to concept diagnostics · 44f6b7fb
      This patch improves our concept diagnostics in two ways.  First, it sets a more
      precise location for the constraint expressions built in
      finish_constraint_binary_op.  As a result, when a disjunction is unsatisfied we
      now print e.g.
      
      .../include/bits/range_access.h:467:2: note: neither operand of the disjunction is satisfied
        466 |  requires is_bounded_array_v<remove_reference_t<_Tp>> || __member_end<_Tp>
            |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        467 |  || __adl_end<_Tp>
            |  ^~~~~~~~~~~~~~~~~
      
      instead of
      
      .../include/bits/range_access.h:467:2: note: neither operand of the disjunction is satisfied
        467 |  || __adl_end<_Tp>
            |  ^~
      
      Second, this patch changes diagnose_atomic_constraint to print unsatisfied
      atomic constraint expressions with their template arguments.  So e.g. we now
      print
      
      cpp2a/concepts-pr67719.C:9:8: note: the expression ‘(... &&(C<Tx>)()) [with Tx = {int, long int, void}]’ evaluated to ‘false’
      
      instead of
      
      cpp2a/concepts-pr67719.C:9:8: note: the expression ‘(... &&(C<Tx>)())’ evaluated to ‘false’
      
      Tested on x86_64-pc-linux-gnu, and verified that all the diagnostics emitted in
      our concept tests are no worse with this patch.
      
      gcc/cp/ChangeLog:
      
      	* constraint.cc (finish_constraint_binary_op): Set expr's location range
      	to the range of its operands.
      	(satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
      	(diagnose_trait_expr): Take the instantiated parameter mapping MAP
      	instead of the corresponding template arguments ARGS and adjust body
      	accordingly.
      	(diagnose_requires_expr): Likewise.
      	(diagnose_atomic_constraint): Likewise.  When printing an atomic
      	constraint expression, print the instantiated parameter mapping
      	alongside it.
      	* cxx-pretty-print.cc (cxx_pretty_printer::expression)
      	[NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
      	(cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/concepts/diagnostic2.C: New test.
      	* g++.dg/concepts/diagnostic3.C: New test.
      Patrick Palka committed
    • c++: Fix value-init crash in template [PR93676] · 38e10026
      Since <https://gcc.gnu.org/ml/gcc-patches/2015-02/msg00556.html> we
      attempt to value-initialize in build_vec_init even when there's no
      initializer but the type has a constexpr default constructor.  But
      build_value_init doesn't work in templates, and build_vec_init
      creates a lot of garbage that would not be used anyway, so don't
      call it in a template.
      
      	PR c++/93676 - value-init crash in template.
      	* init.c (build_new_1): Don't call build_vec_init in a template.
      
      	* g++.dg/cpp0x/nsdmi-template19.C: New test.
      Marek Polacek committed
    • libstdc++: Fix use of inaccessible private member in split_view (PR93936) · 8ce13842
      We are calling _OuterIter::__current from _InnerIter::operator==, but the former
      is private within this non-member friend.  Fix this by calling
      _OuterIter::operator== instead, which does the right thing here.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/93936
      	* include/std/ranges (split_view::_InnerIter::operator==): Compare
      	the operands' _M_i rather than their _M_i.current().
      	* testsuite/std/ranges/adaptors/split.cc: Augment test.
      Patrick Palka committed
    • libstdc++: P1645R1 constexpr for <numeric> algorithms · fd335985
      This adds constexpr to 11 algorithms defined in <numeric> as per P1645R1.
      
      libstdc++-v3/ChangeLog:
      
      	P1645R1 constexpr for <numeric> algorithms
      	* include/bits/stl_numeric.h (iota, accumulate, inner_product,
      	partial_sum, adjacent_difference): Make conditionally constexpr for
      	C++20.
      	* include/std/numeric (__cpp_lib_constexpr_numeric): Define this feature
      	test macro.
      	(reduce, transform_reduce, exclusive_scan, inclusive_scan,
      	transform_exclusive_scan, transform_inclusive_scan): Make conditionally
      	constexpr for C++20.
      	* include/std/version (__cpp_lib_constexpr_numeric): Define.
      	* testsuite/26_numerics/accumulate/constexpr.cc: New test.
      	* testsuite/26_numerics/adjacent_difference/constexpr.cc: Likewise.
      	* testsuite/26_numerics/exclusive_scan/constexpr.cc: Likewise.
      	* testsuite/26_numerics/inclusive_scan/constexpr.cc: Likewise.
      	* testsuite/26_numerics/inner_product/constexpr.cc: Likewise.
      	* testsuite/26_numerics/iota/constexpr.cc: Likewise.
      	* testsuite/26_numerics/partial_sum/constexpr.cc: Likewise.
      	* testsuite/26_numerics/reduce/constexpr.cc: Likewise.
      	* testsuite/26_numerics/transform_exclusive_scan/constexpr.cc: Likewise.
      	* testsuite/26_numerics/transform_inclusive_scan/constexpr.cc: Likewise.
      	* testsuite/26_numerics/transform_reduce/constexpr.cc: Likewise.
      Patrick Palka committed
    • libstdc++ Two simplifications for lexicographical_compare · 113f0a63
      	* include/bits/ranges_algo.h (__lexicographical_compare_fn): Declare
      	variables in smaller scope and avoid calling ranges::distance when we
      	know they are pointers. Remove statically-unreachable use of
      	__builtin_unreachable().
      	* include/bits/stl_algobase.h (__lexicographical_compare::__lc):
      	Define inline.
      Jonathan Wakely committed
    • libstdc++: Add __maybe_const_t and __maybe_empty_t aliases · 8017d95c
      This introduces a couple of convenience alias templates to be used for
      some repeated patterns using std::conditional_t.
      
      	* include/std/ranges (__detail::__maybe_empty_t): Define new helper
      	alias.
      	(__detail::__maybe_const_t): Likewise.
      	(__adaptor::_RangeAdaptor): Use __maybe_empty_t.
      	(transform_view, take_view, take_while_view, elements_view): Use
      	__maybe_const_t.
      	(join_view, split_view): Use both.
      Jonathan Wakely committed
    • c++: Fix ICE with static_cast when converting from int[] [PR93862] · 4a305fa2
      This ICEs since my patch for P0388, which allowed conversions to arrays
      of unknown bound, but not the reverse, so these two static_casts are
      ill-formed.
      
      [expr.static.cast]/3 says that "cv1 T1" and "cv2 T2" have to be
      reference-compatible and the comment in build_static_cast_1 says it too
      but then we actually use reference_related_p...  Fixed thus.
      
      2020-02-26  Marek Polacek  <polacek@redhat.com>
      
      	PR c++/93862 - ICE with static_cast when converting from int[].
      	* call.c (reference_compatible_p): No longer static.
      	* cp-tree.h (reference_compatible_p): Declare.
      	* typeck.c (build_static_cast_1): Use reference_compatible_p instead
      	of reference_related_p.
      
      	* g++.dg/cpp0x/rv-cast7.C: New test.
      Marek Polacek committed
    • c++: Add test for DR 1423, Convertibility of nullptr to bool. · b9934ad8
      DR 1423, which supersedes DR 654, says that you can't copy-init
      a bool from a std::nullptr_t:
      
        bool b = nullptr;  // error
      
      Conversely, it works with direct-initialization which is more
      permissive than copy-initialization.
      
      No code changes necessary since we handle it right.
      
      2020-02-26  Marek Polacek  <polacek@redhat.com>
      
      	DR 1423, Convertibility of nullptr to bool.
      	* g++.dg/DRs/dr1423.C: New test.
      Marek Polacek committed
    • c++: Fix ICE with constexpr init and [[no_unique_address]] [PR93803] · d6ff2207
      Here we crash when constexpr-initializing a class member of empty class
      type with [[no_unique_address]].  Without the attribute we would have
      a ctor (that initializes bar) of the form
      
        { .D.2173 = { .x = {} } }
      
      but with the attribute reduced_constant_expression_p gets
      
        { .x = {} }
      
      That means that "idx != field" is true for the latter and we see that
      foo, the base class of bar, is an empty class, so we want to look at
      the next initializable field (since empty class fields may not have an
      initializer).  But in this case there are no more, therefore accessing
      DECL_CHAIN (field) crashes.  Long story short, we need to avoid a crash
      on a null field when we're initializing a class that only contains an
      empty base class.
      
      While poking into this I discovered c++/93898, but that's a different
      problem.
      
      2020-02-26  Marek Polacek  <polacek@redhat.com>
      
      	PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
      	* constexpr.c (reduced_constant_expression_p): Don't crash on a null
      	field.
      
      	* g++.dg/cpp2a/constexpr-init16.C: New test.
      	* g++.dg/cpp2a/constexpr-init17.C: New test.
      Marek Polacek committed
    • dump load permutations and refcount per SLP node · 759bd406
      This adjusts dumping as proved useful in debugging.
      
      2020-02-26  Richard Biener  <rguenther@suse.de>
      
      	* tree-vect-slp.c (vect_print_slp_tree): Also dump ref count
      	and load permutation.
      Richard Biener committed
    • optabs: Don't use scalar conversions for vectors [PR93843] · b6268016
      In this PR we had a conversion between two integer vectors that
      both had scalar integer modes.  We then tried to implement the
      conversion using the scalar optab for those modes, instead of
      doing the conversion elementwise.
      
      I wondered about letting through scalar modes for single-element
      vectors, but I don't have any evidence that that's useful/necessary,
      so it seemed better to keep things simple.
      
      2020-02-26  Richard Sandiford  <richard.sandiford@arm.com>
      
      gcc/
      	PR middle-end/93843
      	* optabs-tree.c (supportable_convert_operation): Reject types with
      	scalar modes.
      
      gcc/testsuite/
      	PR middle-end/93843
      	* gcc.dg/vect/pr93843-1.c: New test.
      	* gcc.dg/vect/pr93843-2.c: Likewise.
      Richard Sandiford committed
    • analyzer: improvements to logging/dumping · 67fa274c
      This patch adds various information to -fdump-analyzer and
      -fdump-analyzer-stderr to make it easier to track down
      problems with state explosions in the exploded_graph.
      
      It logs the number of unprocessed nodes in the worklist, for
      the case where the upper limit on exploded nodes is reached.
      
      It prints:
      [a] a bar chart showing the number of exploded nodes by function, and
      
      [b] bar charts for each function showing the number of exploded nodes
          per supernode/BB, and
      
      [c] bar charts for each function showing the number of excess exploded
          nodes per supernode/BB beyond the limit
          (--param=analyzer-max-enodes-per-program-point), where that limit
          was reached
      
      I've found these helpful in finding exactly where we fail to consolidate
      state, leading to state explosions and false negatives due to the
      thresholds being reached.
      
      The patch also adds a "superedge::dump" member function I found myself
      needing.
      
      gcc/ChangeLog:
      	* Makefile.in (ANALYZER_OBJS): Add analyzer/bar-chart.o.
      
      gcc/analyzer/ChangeLog:
      	* bar-chart.cc: New file.
      	* bar-chart.h: New file.
      	* engine.cc: Include "analyzer/bar-chart.h".
      	(stats::log): Only log the m_num_nodes kinds that are non-zero.
      	(stats::dump): Likewise when dumping.
      	(stats::get_total_enodes): New.
      	(exploded_graph::get_or_create_node): Increment the per-point-data
      	m_excess_enodes when hitting the per-program-point limit on
      	enodes.
      	(exploded_graph::print_bar_charts): New.
      	(exploded_graph::log_stats): Log the number of unprocessed enodes
      	in the worklist.  Call print_bar_charts.
      	(exploded_graph::dump_stats): Print the number of unprocessed
      	enodes in the worklist.
      	* exploded-graph.h (stats::get_total_enodes): New decl.
      	(struct per_program_point_data): Add field m_excess_enodes.
      	(exploded_graph::print_bar_charts): New decl.
      	* supergraph.cc (superedge::dump): New.
      	(superedge::dump): New.
      	* supergraph.h (supernode::get_function): New.
      	(superedge::dump): New decl.
      	(superedge::dump): New decl.
      David Malcolm committed
    • testsuite: Add a -O2 -fgimple testcase next to the -O2 -fno-tree-dse one [PR93820] · ce25177f
      2020-02-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/93820
      	* gcc.dg/pr93820-2.c: New test.
      Jakub Jelinek committed
    • store-merging: Fix coalesce_immediate_stores [PR93820] · 4d213bf6
      The following testcase is miscompiled in 8+.
      The problem is that check_no_overlap has a special case for INTEGER_CST
      marked stores (i.e. stores of constants), if both all currenly merged stores
      and the one under consideration for merging with them are marked that way,
      it anticipates that other INTEGER_CST marked stores that overlap with those
      and precede those (have smaller info->order) could be merged with those and
      doesn't punt for them.
      In PR86844 and PR87859 fixes I've then added quite large code that is
      performed after check_no_overlap and tries to find out if we need and can
      merge further INTEGER_CST marked stores, or need to punt.
      Unfortunately, that code is there only in the overlapping case code and
      the testcase below shows that we really need it even in the adjacent store
      case.  After sort_by_bitpos we have:
      bitpos	width	order	rhs_code
      96	32	3	INTEGER_CST
      128	32	1	INTEGER_CST
      128	128	2	INTEGER_CST
      192	32	0	MEM_REF
      Because of the missing PR86844/PR87859-ish code in the adjacent store
      case, we merge the adjacent (memory wise) stores 96/32/3 and 128/32/1,
      and then we consider the 128-bit store which is in program-order in between
      them, but in this case we punt, because the merging would extend the
      merged store region from bitpos 96 and 64-bits to bitpos 96 and 160-bits
      and that has an overlap with an incompatible store (the MEM_REF one).
      The problem is that we can't really punt this way, because the 128-bit
      store is in between those two we've merged already, so either we manage
      to merge even that one together with the others, or would need to avoid
      already merging the 96/32/3 and 128/32/1 stores together.
      Now, rather than copying around the PR86844/PR87859 code to the other spot,
      we can actually just use the overlapping code, merge_overlapping is really
      a superset of merge_into, so that is what the patch does.  If doing
      adjacent store merge for rhs_code other than INTEGER_CST, I believe the
      current code is already fine, check_no_overlap in that case doesn't make
      the exception and will punt if there is some earlier (smaller order)
      non-mergeable overlapping store.  There is just one case that could be
      problematic, if the merged_store has BIT_INSERT_EXPRs in them and the
      new store is a constant store (INTEGER_CST rhs_code), then check_no_overlap
      would do the exception and still would allow the special case.  But we
      really shouldn't have the special case in that case, so this patch also
      changes check_no_overlap to just have a bool whether we should have the
      special case or not.
      
      Note, as I said in the PR, for GCC11 we could consider performing some kind
      of cheap DSE during the store merging (perhaps guarded with flag_tree_dse).
      And another thing to consider is only consider as problematic non-mergeable
      stores that not only have order smaller than last_order as currently, but
      also have order larger than first_order, as in this testcase if we actually
      ignored (not merged with anything at all) the 192/32/0 store, because it is
      not in between the other stores we'd merge, it would be fine to merge the
      other 3 stores, though of course the testcase can be easily adjusted by
      putting the 192/32 store after the 128/32 store and then this patch would be
      still needed.  Though, I think I'd need more time thinking this over.
      
      2020-02-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/93820
      	* gimple-ssa-store-merging.c (check_no_overlap): Change RHS_CODE
      	argument to ALL_INTEGER_CST_P boolean.
      	(imm_store_chain_info::try_coalesce_bswap): Adjust caller.
      	(imm_store_chain_info::coalesce_immediate_stores): Likewise.  Handle
      	adjacent INTEGER_CST store into merged_store->only_constants like
      	overlapping one.
      
      	* gcc.dg/pr93820.c: New test.
      Jakub Jelinek committed
    • c++: Fix rejects-valid bug in cxx_eval_outermost_constant_expr [PR93905] · 5de338f0
      Add testcase for a bug that has been just on the 8 branch.
      
      2020-02-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/93905
      	* g++.dg/cpp0x/pr93905.C: New test.
      Jakub Jelinek committed
    • Daily bump. · 07a0e380
      GCC Administrator committed
  3. 25 Feb, 2020 3 commits
    • typo fix: Fix probablity, becuse, sucessor and destinarion typos [PR93912] · 9c3da8cc
      2020-02-25  Jakub Jelinek  <jakub@redhat.com>
      
      	PR other/93912
      	* config/sh/sh.c (expand_cbranchdi4): Fix comment typo, probablity
      	-> probability.
      	* cfghooks.c (verify_flow_info): Likewise.
      	* predict.c (combine_predictions_for_bb): Likewise.
      	* bb-reorder.c (connect_better_edge_p): Likewise.  Fix comment typo,
      	sucessor -> successor.
      	(find_traces_1_round): Fix comment typo, destinarion -> destination.
      	* omp-expand.c (expand_oacc_for): Fix comment typo, sucessors ->
      	successors.
      	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Fix dump
      	message typo, sucessors -> successors.
      c/
      	* gimple-parser.c (c_parser_gimple_parse_bb_spec_edge_probability):
      	Rename last argument from probablity to probability.
      Jakub Jelinek committed
    • Correct an attribute access example. · 68f8763d
      gcc/ChangeLog:
      	* doc/extend.texi (attribute access): Correct an example.
      Martin Sebor committed
    • aarch64: Add bfloat16 vldn/vstn intrinsics · e603cd43
      This patch adds the load/store bfloat16 intrinsics to the AArch64 back-end.
      ACLE documents are at https://developer.arm.com/docs/101028/latest
      ISA documents are at https://developer.arm.com/docs/ddi0596/latest
      
      2020-02-25  Mihail Ionescu  <mihail.ionescu@arm.com>
      
      gcc/
      	* config/aarch64/aarch64-builtins.c (aarch64_scalar_builtin_types):
      	Add simd_bf.
      	(aarch64_init_simd_builtin_scalar_types): Register simd_bf.
      	(VAR15, VAR16): New.
      	* config/aarch64/iterators.md (VALLDIF): Enable for V4BF and V8BF.
      	(VD): Enable for V4BF.
      	(VDC): Likewise.
      	(VQ): Enable for V8BF.
      	(VQ2): Likewise.
      	(VQ_NO2E): Likewise.
      	(VDBL, Vdbl): Add V4BF.
      	(V_INT_EQUIV, v_int_equiv): Add V4BF and V8BF.
      	* config/aarch64/arm_neon.h (bfloat16x4x2_t): New typedef.
      	(bfloat16x8x2_t): Likewise.
      	(bfloat16x4x3_t): Likewise.
      	(bfloat16x8x3_t): Likewise.
      	(bfloat16x4x4_t): Likewise.
      	(bfloat16x8x4_t): Likewise.
      	(vcombine_bf16): New.
      	(vld1_bf16, vld1_bf16_x2): New.
      	(vld1_bf16_x3, vld1_bf16_x4): New.
      	(vld1q_bf16, vld1q_bf16_x2): New.
      	(vld1q_bf16_x3, vld1q_bf16_x4): New.
      	(vld1_lane_bf16): New.
      	(vld1q_lane_bf16): New.
      	(vld1_dup_bf16): New.
      	(vld1q_dup_bf16): New.
      	(vld2_bf16): New.
      	(vld2q_bf16): New.
      	(vld2_dup_bf16): New.
      	(vld2q_dup_bf16): New.
      	(vld3_bf16): New.
      	(vld3q_bf16): New.
      	(vld3_dup_bf16): New.
      	(vld3q_dup_bf16): New.
      	(vld4_bf16): New.
      	(vld4q_bf16): New.
      	(vld4_dup_bf16): New.
      	(vld4q_dup_bf16): New.
      	(vst1_bf16, vst1_bf16_x2): New.
      	(vst1_bf16_x3, vst1_bf16_x4): New.
      	(vst1q_bf16, vst1q_bf16_x2): New.
      	(vst1q_bf16_x3, vst1q_bf16_x4): New.
      	(vst1_lane_bf16): New.
      	(vst1q_lane_bf16): New.
      	(vst2_bf16): New.
      	(vst2q_bf16): New.
      	(vst3_bf16): New.
      	(vst3q_bf16): New.
      	(vst4_bf16): New.
      	(vst4q_bf16): New.
      
      gcc/testsuite/
      	* gcc.target/aarch64/advsimd-intrinsics/bf16_vstn.c: New test.
      	* gcc.target/aarch64/advsimd-intrinsics/bf16_vldn.c: New test.
      Mihail Ionescu committed