1. 31 Oct, 2018 7 commits
    • re PR d/87788 (Support D on x86_64-apple-darwin*) · 260eedb9
      ChangeLog:
      
      2018-10-31  Iain Buclaw  <ibuclaw@gdcproject.org>
      
      	PR bootstrap/87788
      	PR d/87799
      	* configure: Rebuild.
      	* configure.ac: Disable D on systems where it is known not to work.
      
      libphobos/ChangeLog:
      
      2018-10-31  Iain Buclaw  <ibuclaw@gdcproject.org>
      
      	PR bootstrap/87789
      	PR d/87818
      	PR d/87819
      	* configure.tgt: New file.
      
      From-SVN: r265658
      Iain Buclaw committed
    • aarch64: Improve cas generation · d400fda3
      Do not zero-extend the input to the cas for subword operations;
      instead, use the appropriate zero-extending compare insns.
      Correct the predicates and constraints for immediate expected operand.
      
      	* config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): New.
      	(aarch64_split_compare_and_swap): Use it.
      	(aarch64_expand_compare_and_swap): Likewise.  Remove convert_modes;
      	test oldval against the proper predicate.
      	* config/aarch64/atomics.md (@atomic_compare_and_swap<ALLI>):
      	Use nonmemory_operand for expected.
      	(cas_short_expected_pred): New.
      	(@aarch64_compare_and_swap<SHORT>): Use it; use "rn" not "rI" to match.
      	(@aarch64_compare_and_swap<GPI>): Use "rn" not "rI" for expected.
      	* config/aarch64/predicates.md (aarch64_plushi_immediate): New.
      	(aarch64_plushi_operand): New.
      
      From-SVN: r265657
      Richard Henderson committed
    • aarch64: Simplify LSE cas generation · 77f33f44
      The cas insn is a single insn, and if expanded properly need not
      be split after reload.  Use the proper inputs for the insn.
      
      	* config/aarch64/aarch64.c (aarch64_expand_compare_and_swap):
      	Force oldval into the rval register for TARGET_LSE; emit the compare
      	during initial expansion so that it may be deleted if unused.
      	(aarch64_gen_atomic_cas): Remove.
      	* config/aarch64/atomics.md (@aarch64_compare_and_swap<SHORT>_lse):
      	Change =&r to +r for operand 0; use match_dup for operand 2;
      	remove is_weak and mod_f operands as unused.  Drop the split
      	and merge with...
      	(@aarch64_atomic_cas<SHORT>): ... this pattern's output; remove.
      	(@aarch64_compare_and_swap<GPI>_lse): Similarly.
      	(@aarch64_atomic_cas<GPI>): Similarly.
      
      From-SVN: r265656
      Richard Henderson committed
    • re PR testsuite/87802 (g++.dg/vect/slp-pr87105.cc fails starting with r265522) · 187cea94
      2018-10-31  Richard Biener  <rguenther@suse.de>
      
      	PR testsuite/87802
      	* g++.dg/vect/slp-pr87105.cc: XFAIL for strict alignment targets.
      
      From-SVN: r265655
      Richard Biener committed
    • tree-eh.c (replace_trapping_overflow): Simplify ABS_EXPR case using ABSU_EXPR. · 1a71493d
      2018-10-31  Richard Biener  <rguenther@suse.de>
      
      	* tree-eh.c (replace_trapping_overflow): Simplify ABS_EXPR case
      	using ABSU_EXPR.
      
      From-SVN: r265654
      Richard Biener committed
    • Add pipeline description for Qualcomm Saphira core. · 2e9d500e
      From-SVN: r265653
      Sameera Deshpande committed
    • Daily bump. · 8f4103c5
      From-SVN: r265652
      GCC Administrator committed
  2. 30 Oct, 2018 23 commits
    • re PR fortran/85896 (ICE in gfc_convert_constant(): Unexpected type) · 0a8949a3
      2018-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR fortran/85896
      	* simplify.c (simplify_min_max): Do not convert the type of the
      	return expression.
      
      2018-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR fortran/85896
      	* gfortran.dg/min_max_type.f90: New test.
      
      From-SVN: r265649
      Thomas Koenig committed
    • PR middle-end/87041 - -Wformat reading through null pointer on unreachable code · 91e3ec29
      gcc/ChangeLog:
      
      	PR middle-end/87041
      	* gimple-ssa-sprintf.c (format_directive): Use %G to include
      	inlining context.
      	(sprintf_dom_walker::compute_format_length):
      	Avoid setting POSUNDER4K here.
      	(get_destination_size): Handle null argument values.
      	(get_user_idx_format): New function.
      	(sprintf_dom_walker::handle_gimple_call): Handle all printf-like
      	functions, including user-defined with attribute format printf.
      	Use %G to include inlining context.
      	Set POSUNDER4K here.
      
      gcc/c-family/ChangeLog:
      
      	PR middle-end/87041
      	* c-format.c (check_format_types): Avoid diagnosing null pointer
      	arguments to printf-family of functions.
      
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/87041
      	* gcc.c-torture/execute/fprintf-2.c: New test.
      	* gcc.c-torture/execute/printf-2.c: Same.
      	* gcc.c-torture/execute/user-printf.c: Same.
      	* gcc.dg/tree-ssa/builtin-fprintf-warn-1.c: Same.
      	* gcc.dg/tree-ssa/builtin-printf-2.c: Same.
      	* gcc.dg/tree-ssa/builtin-printf-warn-1.c: Same.
      	* gcc.dg/tree-ssa/user-printf-warn-1.c: Same.
      
      From-SVN: r265648
      Martin Sebor committed
    • * params.def (lto-partitions): Bump from 32 to 128. · 448af20a
      From-SVN: r265647
      Jan Hubicka committed
    • Implement P0892R2, explicit(bool). · b5ff4f5c
      	* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_explicit_bool.
      
      	* call.c (add_template_candidate_real): Return if the declaration is
      	explicit and we're only looking for non-converting constructor.
      	* cp-tree.h (lang_decl_fn): Add has_dependent_explicit_spec_p bit.
      	(DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P): New macro.
      	(cp_decl_specifier_seq): Add explicit_specifier field.
      	(build_explicit_specifier, store_explicit_specifier): Declare.
      	* decl.c (grokdeclarator): Call store_explicit_specifier.
      	(build_explicit_specifier): New function.
      	* parser.c (cp_parser_function_specifier_opt) <case RID_EXPLICIT>:
      	Parse C++20 explicit(bool).
      	* pt.c (store_explicit_specifier, lookup_explicit_specifier): New.
      	(tsubst_function_decl): Handle explicit(dependent-expr).
      
      	* g++.dg/cpp2a/explicit1.C: New test.
      	* g++.dg/cpp2a/explicit10.C: New test.
      	* g++.dg/cpp2a/explicit11.C: New test.
      	* g++.dg/cpp2a/explicit12.C: New test.
      	* g++.dg/cpp2a/explicit13.C: New test.
      	* g++.dg/cpp2a/explicit2.C: New test.
      	* g++.dg/cpp2a/explicit3.C: New test.
      	* g++.dg/cpp2a/explicit4.C: New test.
      	* g++.dg/cpp2a/explicit5.C: New test.
      	* g++.dg/cpp2a/explicit6.C: New test.
      	* g++.dg/cpp2a/explicit7.C: New test.
      	* g++.dg/cpp2a/explicit8.C: New test.
      	* g++.dg/cpp2a/explicit9.C: New test.
      
      	* testsuite/20_util/any/cons/explicit.cc: Adjust dg-error.
      	* testsuite/20_util/pair/cons/explicit_construct.cc: Likewise.
      	* testsuite/20_util/tuple/cons/explicit_construct.cc: Likewise.
      
      From-SVN: r265641
      Marek Polacek committed
    • xfail ira-shrink-wrap-prep tests (PR87708) · 8d42623b
      After r265398, the ira-shrinkwrap-prep-[12].c tests fail on all
      targets, because the IRA feature tested can only move hard registers
      down, and we no longer have hard registers for the function parameters
      at this stage.
      
      
      gcc/testsuite/
      	PR rtl-optimization/87708
      	gcc.dg/ira-shrinkwrap-prep-1.c: xfail test.
      	gcc.dg/ira-shrinkwrap-prep-2.c: xfail test.
      
      From-SVN: r265639
      Segher Boessenkool committed
    • * tree.c · 3487ab63
      	(free_lang_data_d, add_tree_to_fld_list, fld_worklist_push): Move
      	head in file.
      	(free_lang_data_in_type): Forward declare.
      	(fld_type_variant_equal_p): New function.
      	(fld_type_variant): New function
      	(fld_incomplete_types): New hash.
      	(fld_incomplete_type_of): New function
      	(fld_simplfied-type): New function.
      	(free_lang_data_in_decl): Add fld parameter; simplify type of FIELD_DECL
      	(free_lang_data): Allocate and free fld_incomplete_type; update call
      	of free_lang_data_in_decl.
      
      From-SVN: r265638
      Jan Hubicka committed
    • decl.c (grokdeclarator): Use declarator->id_loc in diagnostic about flexible array members. · 190facef
      /cp
      2018-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* decl.c (grokdeclarator): Use declarator->id_loc in diagnostic
      	about flexible array members.
      
      /testsuite
      2018-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/cpp1z/has-unique-obj-representations1.C: Test location too.
      	* g++.dg/ext/flexarray-mangle-2.C: Likewise.
      	* g++.dg/ext/flexarray-mangle.C: Likewise.
      	* g++.dg/ext/flexarray-subst.C: Likewise.
      	* g++.dg/ext/flexary10.C: Likewise.
      	* g++.dg/ext/flexary11.C: Likewise.
      	* g++.dg/ext/flexary14.C: Likewise.
      	* g++.dg/ext/flexary16.C: Likewise.
      	* g++.dg/ext/flexary26.C: Likewise.
      	* g++.dg/ext/flexary27.C: Likewise.
      	* g++.dg/ext/flexary7.C: Likewise.
      	* g++.dg/ext/pr71290.C: Likewise.
      
      From-SVN: r265636
      Paolo Carlini committed
    • * gcov.c (output_lines): Remove duplicate line. · 6a6e0926
      From-SVN: r265634
      Eric Botcazou committed
    • rs6000.md (bswapdi2): Force address into register if not in indexed or indirect form. · 320314db
      2018-10-30  Aaron Sawdey  <acsawdey@linux.ibm.com>
      
      	* config/rs6000/rs6000.md (bswapdi2): Force address into register
      	if not in indexed or indirect form.
      	(bswapdi2_load): Change predicate to indexed_or_indirect_operand.
      	(bswapdi2_store): Ditto.
      	* config/rs6000/rs6000.c (rs6000_force_indexed_or_indirect_mem): New
      	helper function.
      	* config/rs6000/rs6000-protos.h (rs6000_force_indexed_or_indirect_mem):
      	Prototype for helper function.
      
      From-SVN: r265632
      Aaron Sawdey committed
    • extend.texi (optimize): Clarify/expand attribute documentation. · d2bfc447
      gcc/ChangeLog:
      
      	* doc/extend.texi (optimize): Clarify/expand attribute documentation.
      	(target, pragma GCC optimize, pragma GCC target): Ditto.
      
      From-SVN: r265631
      Martin Sebor committed
    • Add PR marker · a2e0398a
      From-SVN: r265628
      Jeff Law committed
    • method-serial.cc: Mark varible as potentially unused to silence warning. · 1f82422a
             * method-serial.cc: Mark varible as potentially unused
              to silence warning.
      
      From-SVN: r265627
      Nicholas Krause committed
    • PR libstdc++/87809 avoid invalid expressions in exception specifications · 0321d9fa
      If the allocator isn't default constructible then checking if the
      default constructor throws in an exception specification makes the
      declaration invalid. Use the type trait instead.
      
      	PR libstdc++/87809
      	* include/bits/forward_list.h (_Fwd_list_impl::_Fwd_list_impl()): Use
      	trait in exception-specification instead of possibly invalid
      	expression.
      	* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl()):
      	Likewise.
      	* include/bits/stl_list.h (_List_impl::_List_impl()): Likewise.
      	* include/bits/stl_vector.h (_Vector_impl::_Vector_impl()): Likewise.
      	* testsuite/23_containers/forward_list/cons/87809.cc: New test.
      	* testsuite/23_containers/list/cons/87809.cc: New test.
      	* testsuite/23_containers/vector/bool/cons/87809.cc: New test.
      	* testsuite/23_containers/vector/cons/87809.cc: New test.
      
      From-SVN: r265626
      Jonathan Wakely committed
    • PR libstdc++/87784 fix dynamic_bitset::push_back · c397f267
      Previously the _M_Nb member was incremented before calling
      _M_unchecked_set which meant that the bit being set was out of bounds.
      It either set the wrong bit in an allocated word, or accessed beyond the
      end of the allocated memory in the _M_w vector. The fix for the bug is
      to update the _M_Nb member after using it as an index.
      
      As an optimisation, when a new block needs to be appended the call to
      _M_unchecked_set can be avoided by appending a block with the least
      significant bit already set to the desired value.
      
      	PR libstdc++/87784
      	* include/tr2/dynamic_bitset (dynamic_bitset::push_back): When there
      	are no unused bits in the last block, append a new block with the
      	right value so the bit doesn't need to be set. Only increment size
      	after setting the new bit, not before.
      	* testsuite/tr2/dynamic_bitset/pr87784.cc: New test.
      
      From-SVN: r265625
      Jonathan Wakely committed
    • * gcc.dg/tree-ssa/attr-alias.c: Skip if no weak support. · 47abbc31
      From-SVN: r265624
      Paul Koning committed
    • Fix __builtin_expect_with_probability documentation · 3a4673e0
      	* doc/extend.texi: Fix prototype and description of
      	__builtin_expect_with_probability.
      
      From-SVN: r265622
      Jonathan Wakely committed
    • Avoid unnecessarily numbering cloned symbols. · 7958186b
      2018-10-30  Michael Ploujnikov  <michael.ploujnikov@oracle.com>
      
      	* cgraph.h (clone_function_name_1): Replaced by new
      	  clone_function_name_numbered that takes name as string; for
      	  privatize_symbol_name_1 use only.
      	  (clone_function_name): Renamed to
      	  clone_function_name_numbered to be explicit about numbering.
      	  (clone_function_name): New two-argument function that does
      	  not number its output.
      	  (clone_function_name): New three-argument function that
      	  takes a number to append to its output.
      	* cgraphclones.c (duplicate_thunk_for_node):
      	  (clone_function_name_1): Renamed.
      	  (clone_function_name_numbered): Two new functions.
      	  (clone_function_name): Improved documentation.
      	  (cgraph_node::create_virtual_clone): Use clone_function_name_numbered.
      	* config/rs6000/rs6000.c (make_resolver_func): Ditto.
      	* final.c (final_scan_insn_1): Use the new clone_function_name
      	  without numbering.
      	* multiple_target.c (create_dispatcher_calls): Ditto.
      	  (create_target_clone): Ditto.
      	* omp-expand.c (grid_expand_target_grid_body): Ditto.
      	* omp-low.c (create_omp_child_function_name): Ditto.
      	* omp-simd-clone.c (simd_clone_create): Ditto.
      	* symtab.c (simd_symtab_node::noninterposable_alias): Use the
      	  new clone_function_name without numbering.
      2018-10-30  Michael Ploujnikov  <michael.ploujnikov@oracle.com>
      
      	* lto-partition.c (privatize_symbol_name_1): Use
      	  clone_function_name_numbered.
      2018-10-30  Michael Ploujnikov  <michael.ploujnikov@oracle.com>
      
      	* gcc.dg/tree-prof/cold_partition_label.c: Update for cold
      	  section names without numbers.
      	* gcc.dg/tree-prof/section-attr-1.c: Ditto.
      	* gcc.dg/tree-prof/section-attr-2.c: Ditto.
      	* gcc.dg/tree-prof/section-attr-3.c: Ditto.
      
      From-SVN: r265621
      Michael Ploujnikov committed
    • Don't allow the pool allocator to be configured to allocate zero-sized objects · 29f6f2d2
      PR bootstrap/87747 would have been significantly easier to track down if
      the pool allocator had faulted an attempt to configure it to allocate
      zero-sized objects.  Instead, this slipped through and we later hit
      memory corruption when the assumed size turned out to be different to
      the configured size.
      
      While, theoretically, there might be a use case for this, it seems
      unlikely to me that GCC would have such a use.  So this patch adds a
      checking assert that the object size is not zero.
      
      	* alloc-pool.h (base_pool_allocator <TBlockAllocator>::initialize):
      	Assert that the allocation size is not zero.
      
      From-SVN: r265620
      Richard Earnshaw committed
    • re PR tree-optimization/87800 (CPU2006 416.gamess failed to build with LTO) · 22e4f1fb
      2018-10-30  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/87800
      	* tree-vect-slp.c (vect_build_slp_tree_2): Reject any
      	non-induction or reduction PHIs.
      
      From-SVN: r265619
      Richard Biener committed
    • Fixes bug 87330 by invoking df_note_add_problem to recompute REG_DEAD and… · 83933829
      Fixes bug 87330 by invoking  df_note_add_problem to recompute REG_DEAD and REG_UNUSED notes before analysis.
      
      From-SVN: r265618
      Sameera Deshpande committed
    • libgcc: properly destroy mutexes on VxWorks · be7b071e
      Just as one needs run-time initialization of mutexes, one needs to
      destroy them properly to allow the OS to release resources associated
      with the semaphore.
      
      From-SVN: r265616
      Rasmus Villemoes committed
    • Fix typo in documentation of __builtin_expect_with_probability. · 9eeb0b97
      2018-10-30  Martin Liska  <mliska@suse.cz>
      
      	* doc/extend.texi: Fix typo in documentation
      	of __builtin_expect_with_probability.
      
      From-SVN: r265615
      Martin Liska committed
    • Daily bump. · 4267ed51
      From-SVN: r265614
      GCC Administrator committed
  3. 29 Oct, 2018 10 commits
    • Fix ICE in get_substring_ranges_for_loc on __FILE__ (PR c++/87721) · 3d0a5393
      PR c++/87721 reports a crash in get_substring_ranges_for_loc introduced
      by r265271, my fix for PR 87562.
      
      The new issue occurs when attempting to get a location with a string
      literal inside a macro in which the first token is __FILE__ (formed via
      concatenation).  Attempting to get the spelling location of __FILE__
      fails, leading to NULL for start_ord_map and final_ord_map, and thus
      a NULL pointer dereference.
      
      Given that our "on-demand" substring locations approach reparses the
      string literals, there isn't a good way to access the locations inside
      such string literals: attempting to reparse __FILE__ fails with a
      "missing open quote".
      
      This patch applies the easy fix by gracefully rejecting the case where
      the spelling locations for the start or finish give us NULL maps.
      
      gcc/ChangeLog:
      	PR c++/87721
      	* input.c (get_substring_ranges_for_loc): Detect if
      	linemap_resolve_location gives us a NULL map, and reject
      	this case.
      
      gcc/testsuite/ChangeLog:
      	PR c++/87721
      	* c-c++-common/substring-location-PR-87721.c: New test.
      	* gcc.dg/plugin/diagnostic-test-string-literals-1.c: Add test for
      	PR 87721.
      	* gcc.dg/plugin/diagnostic_plugin_test_string_literals.c
      	(test_string_literals): Fold the index arguments before checking
      	for INTEGER_CST.
      
      From-SVN: r265611
      David Malcolm committed
    • C++: simplify output from suggest_alternatives_for · 7e2de6df
      In the C++ FE, after emitting various errors about unrecognized names,
      the parser can call
        suggest_alternatives_for
      and/or
        suggest_alternative_in_explicit_scope.
      These can issue zero or more suggestions for the unrecognized name,
      or various other "note" diagnostics suggesting how to fix the problem.
      
      For example, currently g++ emits:
      
      t.cc:12:3: error: 'gtk_widget_showall' was not declared in this scope
      12 |   gtk_widget_showall (w);
         |   ^~~~~~~~~~~~~~~~~~
      t.cc:12:3: note: suggested alternative: 'gtk_widget_show_all'
      12 |   gtk_widget_showall (w);
         |   ^~~~~~~~~~~~~~~~~~
         |   gtk_widget_show_all
      
      This patch consolidates the common case when there is a single
      candidate, so that the error can issue a fix-it hint directly.
      
      This simplifies the above to:
      
      t.cc:12:3: error: 'gtk_widget_showall' was not declared in this scope;
       did you mean 'gtk_widget_show_all'?
      12 |   gtk_widget_showall (w);
         |   ^~~~~~~~~~~~~~~~~~
         |   gtk_widget_show_all
      
      omitting the second "note" diagnostic.
      
      Doing so requires changing the above "suggest_" functions so that
      rather than being called after "error" and emitting a note directly,
      they are called before the "error", and return a name_hint, which
      can contain a suggestion and/or a deferred diagnostic.  The "single
      candidate" case is handled via a suggestion, and the "multiple
      candidates" case via a new subclass of deferred_diagnostic.
      
      There was some complication due to the fact that we don't always have
      enough location information to issue a fix-it hint.  Specifically,
      for the case in qualified_name_lookup_error, the location is that of
      the name, but the location of the qualifier prefix isn't reliably
      available.  For some hints, e.g. spell-corrections, the replacement
      is of the name, and for others, e.g. parent namespaces, it's for the
      qualified name.  The patch addresses this by splitting this case out
      into a new "suggest_alternatives_in_other_namespaces" function, for
      which fix-it hints aren't issued.
      
      Another complication is that of emitting a note when
        --param cxx-max-namespaces-for-diagnostic-help
      is reached.  The patch emulates the existing behavior by emitting
      the note from a deferred_diagnostic.  This potentially needs to
      co-exist with another deferred_diagnostic, so it works as a decorator
      around any other such deferred_diagnostic.  Doing so requires slightly
      extending class name_hint.
      
      On adding test coverage for the various cases, I discovered that
      after emitting a "FOO is not a namespace-name" error, we also emit
      a "expected namespace-name before" error.  The patch removes this
      second error for the case where it's redundant, simplifying this case
      from e.g.:
      
      spellcheck-ns.C:10:24: error: 'inner_ms' is not a namespace-name
      10 | using namespace outer::inner_ms;
         |                        ^~~~~~~~
      spellcheck-ns.C:10:24: note: suggested alternative: 'inner_ns'
      10 | using namespace outer::inner_ms;
         |                        ^~~~~~~~
         |                        inner_ns
      spellcheck-ns.C:10:32: error: expected namespace-name before ';' token
      10 | using namespace outer::inner_ms;
         |                                ^
      
      to:
      
      spellcheck-ns.C:10:24: error: 'inner_ms' is not a namespace-name;
       did you mean 'inner_ns'?
      10 | using namespace outer::inner_ms;
         |                        ^~~~~~~~
         |                        inner_ns
      
      include/ChangeLog:
      	* unique-ptr.h (gnu::move): Generalize so it applies to all
      	lvalue references, rather than just to unique_ptr values.
      
      gcc/c-family/ChangeLog:
      	* name-hint.h (name_hint::take_deferred): New member function.
      
      gcc/c/ChangeLog:
      	* c-decl.c (implicit_decl_warning): Update "is there a suggestion"
      	logic for change to name_hint::operator bool.
      	(undeclared_variable): Likewise.
      	* c-parser.c (c_parser_declaration_or_fndef): Likewise.
      	(c_parser_parameter_declaration): Likewise.
      
      gcc/cp/ChangeLog:
      	* cp-name-hint.h: New file.
      	* cp-tree.h (expr_to_string): New decl.
      	(suggest_alternatives_for): Move to cp-name-hint.h, changing
      	return type from bool to name_hint.
      	(suggest_alternative_in_explicit_scope): Likewise.
      	* error.c: Define INCLUDE_UNIQUE_PTR.  Include "cp-name-hint.h".
      	(expr_to_string): Make non-static.
      	(qualified_name_lookup_error): For the non-"::" case, take
      	responsibity for issuing any suggestion from
      	suggest_alternative_in_explicit_scope, as it changes from
      	returning a bool to returning a name_hint.  Replace fallback call
      	to suggest_alternatives_for to a call to
      	suggest_alternatives_in_other_namespaces, capturing the fact that
      	we don't have enough location information to issue a fix-it hint
      	for this case.  Update the error to support emitting a fix-it hint
      	where appropriate.  For the "::" case, take responsibility for
      	issuing any suggestion from suggest_alternatives_for, supporting
      	emitting a fix-it hint.
      	* lex.c: Define INCLUDE_UNIQUE_PTR.  Include "gcc-rich-location.h"
      	and "cp-name-hint.h".
      	(unqualified_name_lookup_error): Take responsibility for issuing
      	any suggestion from suggest_alternatives_for, supporting emitting
      	a fix-it hint.
      	* name-lookup.c (class namespace_limit_reached): New subclass of
      	deferred_diagnostic.
      	(class show_candidate_location): Likewise.
      	(class suggest_alternatives): Likewise.
      	(class namespace_hints): New class.
      	(suggest_alternatives_for): Convert return type from bool to
      	name_hint, replacing all direct diagnostic emission by setting
      	suggestions on the return value, or creating deferred diagnostics.
      	Specifically, split out initial traversal of namespaces into
      	namespace_hints' ctor, and maybe_decorate_with_limit, and move the
      	rest of the implementation to
      	namespace_hints::convert_candidates_to_name_hint and
      	suggest_alternatives_for_1.
      	(namespace_hints::namespace_hints): New ctor, adapted from
      	suggest_alternatives_for's initial namespace traversal, storing
      	location and name, and converting locals "candidates", "limited"
      	and "limit" into members.
      	(namespace_hints::convert_candidates_to_name_hint): New member
      	function.
      	(namespace_hints::maybe_decorate_with_limit): New member function.
      	(suggest_alternatives_for_1): New function, based on second half
      	of old implementation of suggest_alternatives_for, converting from
      	immediate emission of suggestions to using name_hint.
      	(suggest_alternatives_in_other_namespaces): New function.
      	(maybe_suggest_missing_std_header): Convert from immediate
      	emission of suggestions to using name_hint, moving emission
      	implementation to...
      	(class missing_std_header): New subclass of deferred_diagnostic.
      	(maybe_suggest_missing_header): Convert return type from bool to
      	name_hint.
      	(suggest_alternative_in_explicit_scope): Convert from immediate
      	emission of suggestions to using name_hint.
      	* parser.c: Replace include of "c-family/name-hint.h" with
      	"cp-name-hint.h".
      	(cp_parser_diagnose_invalid_type_name): Update
      	"is there a suggestion" logic for change to
      	name_hint::operator bool.  Take responsibility for emitting
      	fix-it hints from suggest_alternative_in_explicit_scope.
      	(cp_parser_namespace_name): Take responsibility for emitting
      	fix-it hints from suggest_alternative_in_explicit_scope.  Don't
      	emit the "expected namespace-name" error if we've already emitted
      	an "is not a namespace-name" error.
      
      gcc/testsuite/ChangeLog:
      	* c-c++-common/spellcheck-reserved.c: Update expected output for
      	C++ for merger of "did you mean" suggestions into the error
      	message.
      	* g++.dg/ext/builtin3.C: Update expected output for merger of "did
      	you mean" suggestion into the error.
      	* g++.dg/lookup/error1.C: Likewise.
      	* g++.dg/lookup/pr77549.C: Likewise.
      	* g++.dg/lookup/pr80913.C: Likewise.
      	* g++.dg/lookup/suggestions1.C: Likewise.
      	* g++.dg/lookup/suggestions2.C: New test.
      	* g++.dg/overload/koenig1.C: Update expected output as above.
      	* g++.dg/spellcheck-identifiers-2.C: Likewise.
      	* g++.dg/spellcheck-identifiers.C: Likewise.
      	* g++.dg/spellcheck-ns.C: New test.
      	* g++.dg/spellcheck-pr77829.C: Update expected output as above.
      	* g++.dg/spellcheck-pr78656.C: Likewise.
      	* g++.dg/spellcheck-pr79298.C: Likewise, adding
      	-fdiagnostics-show-caret to options.
      	* g++.dg/spellcheck-pr80177.C: Likewise.
      	* g++.dg/spellcheck-single-vs-multiple.C: New test.
      	* g++.dg/spellcheck-typenames.C: Update expected output as above.
      	* g++.dg/template/static10.C: Likewise.
      	* g++.old-deja/g++.mike/ns5.C: Likewise.
      	* g++.old-deja/g++.mike/ns7.C: Likewise.
      	* g++.old-deja/g++.ns/koenig5.C: Likewise.
      	* g++.old-deja/g++.other/lineno5.C: Likewise.
      
      libstdc++-v3/ChangeLog:
      	* testsuite/17_intro/using_namespace_std_exp_neg.cc: Remove
      	"expected namespace-name before" error.
      	* testsuite/17_intro/using_namespace_std_tr1_neg.cc: Likewise.
      
      From-SVN: r265610
      David Malcolm committed
    • Folding and check_function_arguments · b2bf438c
      This patch eliminates the arglocs array I introduced to build_over_call
      in r264887, and eliminates the call to maybe_constant_value when building
      "fargs" (thus retaining location wrapper nodes).
      
      Instead, this patch requires that any checks within
      check_function_arguments that need folded arguments do their own folding.
      
      Of the various checks:
      (a) check_function_nonnull already calls fold_for_warn,
      (b) check_function_format doesn't need folding
      (c) check_function_sentinel needs fold_for_warn in one place, which the
      patch adds, and
      (d) check_function_restrict needs per-argument folding, which the patch
      adds.  Given that it scans before and after resetting TREE_VISITED on
      each argument, it seemed best to make a copy of the array, folding each
      argument from the outset, rather than repeatedly calling fold_for_warn;
      
      gcc/c-family/ChangeLog:
      	PR c++/56856
      	* c-common.c (check_function_sentinel): Call fold_for_warn on the
      	argument.
      	(check_function_restrict): Rename param "argarray" to
      	"unfolded_argarray", and make a copy named "argarray", calling
      	fold_for_warn on each argument.
      	(check_function_arguments): Add note about responsibility for
      	folding the arguments.
      
      gcc/cp/ChangeLog:
      	PR c++/56856
      	* call.c (build_over_call): Eliminate the "arglocs" array, and the
      	call to maybe_constant_value when building "fargs".
      
      From-SVN: r265609
      David Malcolm committed
    • decl.c (create_array_type_for_decl): Add location_t parameter and use it. · ebdb73c0
      /cp
      2018-10-29  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* decl.c (create_array_type_for_decl): Add location_t parameter
      	and use it.
      	(grokdeclarator): Adjust call.
      
      /testsuite
      2018-10-29  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/cpp0x/auto24.C: Test location too.
      	* g++.dg/cpp0x/auto3.C: Likewise.
      	* g++.dg/cpp0x/auto42.C: Likewise.
      	* g++.dg/cpp0x/initlist57.C: Likewise.
      	* g++.dg/cpp0x/initlist75.C: Likewise.
      	* g++.dg/cpp0x/initlist80.C: Likewise.
      	* g++.dg/cpp0x/lambda/lambda-ice13.C: Likewise.
      	* g++.old-deja/g++.brendan/array-refs.C: Likewise.
      	* g++.old-deja/g++.bugs/900322_01.C: Likewise.
      	* g++.old-deja/g++.bugs/900519_07.C: Likewise.
      	* g++.old-deja/g++.other/typeck1.C: Likewise.
      
      From-SVN: r265608
      Paolo Carlini committed
    • config.gcc (xstormy16-*-elf): Set tm_d_file. · 64ac3c33
      gcc/ChangeLog:
      
      2018-10-29  Iain Buclaw  <ibuclaw@gdcproject.org>
      
      	* config.gcc (xstormy16-*-elf): Set tm_d_file.
      
      From-SVN: r265607
      Iain Buclaw committed
    • ux.texi: move "Quoting" and "Fix-it hints" from DiagnosticsGuidelines wiki page · 90938ef8
      gcc/ChangeLog:
      	* doc/ux.texi (Quoting): New subsection, adapted from material at
      	https://gcc.gnu.org/wiki/DiagnosticsGuidelines written by
      	MartinSebor and ManuelLopezIbanez.
      	(Fix-it hints): Note that fix-it hints shouldn't be marked for
      	translation.
      
      
      Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>
      Co-Authored-By: Martin Sebor <msebor@redhat.com>
      
      From-SVN: r265606
      David Malcolm committed
    • re PR c++/87469 (ice in record_estimate, at tree-ssa-loop-niter.c:3271) · 5efd9f17
      gcc/testsuite/ChangeLog:
      
      2018-10-29  Kugan Vivekanandarajah  <kuganv@linaro.org>
      
      	PR middle-end/87469
      	* g++.dg/pr87469.C: New test.
      
      gcc/ChangeLog:
      
      2018-10-29  Kugan Vivekanandarajah  <kuganv@linaro.org>
      
      	PR middle-end/87469
      	* tree-ssa-loop-niter.c (number_of_iterations_popcount): Fix niter
      	max value.
      
      From-SVN: r265605
      Kugan Vivekanandarajah committed
    • [rs6000] Remove inaccurate comment · 56950844
      DEBUG doesn't actually "replace abort with printf on error",
      it just enables debugging output.  Just remove the comment.
      
      [gcc/testsuite]
      
      2018-10-29  Paul A. Clarke  <pc@us.ibm.com>
      
      	* gcc.target/powerpc/ssse3-check.h: Remove inaccurate comment.
      
      From-SVN: r265603
      Paul A. Clarke committed
    • * doc/rtl.texi (CONST_WIDE_INT_ELT): Give correct macro name. · 74ec8580
      From-SVN: r265602
      Paul Koning committed