1. 30 Oct, 2019 30 commits
    • [C++ PATCH] Feature macros are long · 43f1814c
      https://gcc.gnu.org/ml/gcc-patches/2019-10/msg02157.html
      	* c-cppbuiltin.c (c_cpp_builtins): Add 'L' suffix to feature
      	macros.
      
      From-SVN: r277632
      Nathan Sidwell committed
    • Fortran/OpenMP] Don't create "alloc:" for 'target exit data' · 91ae0a46
              gcc/
              * gimplify.c (gimplify_scan_omp_clauses): Remove FE-generated
              GOMP_MAP_TO_PSET and GOMP_MAP_POINTER mapping for 'target update'
              and 'target exit data'.
      
              libgomp/
              * testsuite/libgomp.fortran/target9.f90: New.
      
      From-SVN: r277631
      Tobias Burnus committed
    • Remove some more using-declarations from namespace __gnu_cxx · d03eca30
      Similar to some recent patches, this removes using-declarations for
      names from namespace std, so that they are not redeclared in __gnu_cxx.
      
      	* include/bits/stl_iterator.h (namespace __gnu_cxx): Remove
      	using-declarations for std::iterator and std::iterator_traits.
      	(__gnu_cxx::__normal_iterator): Qualify iterator_traits.
      	* include/ext/algorithm (namespace __gnu_cxx): Remove
      	using-declarations for std names and qualify those names when used.
      	Also refer to std::min in parentheses to protect against function-like
      	macros.
      	* include/ext/rc_string_base.h: Qualify iterator_traits.
      	* include/ext/sso_string_base.h: Qualify iterator_traits.
      
      From-SVN: r277630
      Jonathan Wakely committed
    • Apply C++20 changes to various iterator types · 9aeb3bef
      This ensures that __normal_iterator<T*, C> satisfies the
      contiguous_iterator concept, by defining the iterator_concept member
      type.
      
      Also update vector<bool>'s iterators, reverse_iterator,
      istreambuf_iterator and ostreambuf_iterator to meet the C++20
      requirements.
      
      	PR libstdc++/92272
      	* include/bits/stl_bvector.h (_Bit_iterator::pointer)
      	(_Bit_const_iterator::pointer): Define as void for C++20.
      	* include/bits/stl_iterator.h (reverse_iterator::operator->()): Add
      	constraints for C++20.
      	(__normal_iterator::iterator_concept): Define for C++20.
      	* include/bits/streambuf_iterator.h (istreambuf_iterator::pointer):
      	Define as void for C++20.
      	(ostreambuf_iterator::difference_type): Define as ptrdiff_t for C++20.
      	(ostreambuf_iterator::ostreambuf_iterator()): Add default constructor
      	for C++20.
      	* testsuite/23_containers/vector/bool/iterator_c++20.cc: New test.
      	* testsuite/24_iterators/bidirectional/concept.cc: New test.
      	* testsuite/24_iterators/bidirectional/tag.cc: New test.
      	* testsuite/24_iterators/contiguous/concept.cc: New test.
      	* testsuite/24_iterators/contiguous/tag.cc: New test.
      	* testsuite/24_iterators/forward/concept.cc: New test.
      	* testsuite/24_iterators/forward/tag.cc: New test.
      	* testsuite/24_iterators/input/concept.cc: New test.
      	* testsuite/24_iterators/input/tag.cc: New test.
      	* testsuite/24_iterators/istreambuf_iterator/requirements/typedefs.cc:
      	New test.
      	* testsuite/24_iterators/ostreambuf_iterator/requirements/typedefs.cc:
      	New test.
      	* testsuite/24_iterators/output/concept.cc: New test.
      	* testsuite/24_iterators/output/tag.cc: New test.
      	* testsuite/24_iterators/random_access/concept.cc: New test.
      	* testsuite/24_iterators/random_access/tag.cc: New test.
      	* testsuite/24_iterators/range_operations/advance_debug_neg.cc: New
      	test.
      	* testsuite/24_iterators/random_access_iterator/26020.cc: Move to ...
      	* testsuite/24_iterators/operations/26020.cc: ... here.
      	* testsuite/24_iterators/random_access_iterator/
      	string_vector_iterators.cc: Move to ...
      	* testsuite/24_iterators/random_access/string_vector_iterators.cc: ...
      	here.
      
      From-SVN: r277629
      Jonathan Wakely committed
    • Fix typo in preprocessor check · 5211593c
      	* testsuite/util/testsuite_iterators.h: Fix typo in __cplusplus check.
      
      From-SVN: r277628
      Jonathan Wakely committed
    • Edges to interposable calles are possibly_call_in_translation_unit_p · f653eb0e
      2019-10-30  Martin Jambor  <mjambor@suse.cz>
      
      	ipa/92278
      	* cgraph.c (cgraph_edge::possibly_call_in_translation_unit_p): Fix
      	availability comparison.
      
      From-SVN: r277627
      Martin Jambor committed
    • msp430.c (msp430_expand_helper): Support expansion of calls to __mspabi_mpy* functions. · 499a39af
      2019-10-30  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
      
      	* config/msp430/msp430.c (msp430_expand_helper): Support expansion of
      	calls to __mspabi_mpy* functions.
      	* config/msp430/msp430.md (mulhisi3): New define_expand.
      	(umulhisi3): New define_expand.
      	(*mulhisi3_inline): Use old mulhisi3 define_insn.
      	(*umulhisi3_inline): Use old umulhisi3 define_insn.
      
      From-SVN: r277624
      Jozef Lawrynowicz committed
    • msp430.c (msp430_check_index_not_high_mem): New. · 0149b1b4
      gcc/ChangeLog:
      
      2019-10-30  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
      
      	* config/msp430/msp430.c (msp430_check_index_not_high_mem): New.
      	(msp430_check_plus_not_high_mem): New.
      	(msp430_op_not_in_high_mem): Use new functions to check if the operand
      	might be in low memory.
      	Indicate that a 16-bit absolute address is in lower memory.
      
      gcc/testsuite/ChangeLog:
      
      2019-10-30  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
      
      	* gcc.target/msp430/mlarge-use-430-insn.c: New test.
      
      From-SVN: r277623
      Jozef Lawrynowicz committed
    • Fix a call to ultimate_alias_target · d7caa129
      2019-10-30  Martin Jambor  <mjambor@suse.cz>
      
      	* ipa-prop.c (ipa_compute_jump_functions_for_bb): Fix the call to
      	ultimate_alias_target.
      
      From-SVN: r277622
      Martin Jambor committed
    • re PR tree-optimization/92275 (ICE: error: definition in block 11 does not… · b81f2daf
      re PR tree-optimization/92275 (ICE: error: definition in block 11 does not dominate use in block 15 since r277566)
      
      2019-10-30  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/92275
      	* tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_loops):
      	Copy all loop-closed PHIs.
      
      	* gcc.dg/torture/pr92275.c: New testcase.
      
      From-SVN: r277621
      Richard Biener committed
    • * g++.dg/gomp/declare-variant-6.C: New test. · 095578b5
      From-SVN: r277620
      Jakub Jelinek committed
    • Use const_tree more in IPA ICF. · 3f85ff83
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	* ipa-icf-gimple.c (func_checker::compare_ssa_name): Use
      	const_tree as function argument.
      	(func_checker::compare_decl): Likewise.
      	(func_checker::operand_equal_p): Likewise.
      	(func_checker::compare_variable_decl): Likewise.
      	(func_checker::parse_labels): Likewise.
      	* ipa-icf-gimple.h: Likewise.
      
      From-SVN: r277619
      Martin Liska committed
    • Remove alias set comparison. · fc0e67aa
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	* ipa-icf-gimple.c (func_checker::compatible_types_p):
      	Do not compare alias sets.  It's handled by operand_equal_p.
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	* c-c++-common/Wstringop-truncation-4.c: Disable IPA ICF.
      	* gcc.dg/tree-ssa/pr64910-2.c: Likewise.
      	* gcc.dg/tree-ssa/pr79352.c: Likewise.
      
      From-SVN: r277618
      Martin Liska committed
    • Remove comparison for polymorphic types. · 430d1e8d
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	* ipa-icf-gimple.c (func_checker::func_checker): Do not
      	initialize m_compare_polymorphic.
      	(func_checker::compare_decl): Do not compare polymorphic types.
      	* ipa-icf-gimple.h (m_compare_polymorphic): Remove.
      	* ipa-icf.c (sem_function::equals_private): Do not call
      	compare_polymorphic_p.
      
      From-SVN: r277617
      Martin Liska committed
    • IPA ICF: remove dead code · 938bba61
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	* ipa-icf-gimple.c (func_checker::compare_ssa_name): Call
      	compare_operand.
      	(func_checker::compare_memory_operand): Remove.
      	(func_checker::compare_cst_or_decl): Remove.
      	(func_checker::operand_equal_valueize): Do not handle
      	FIELD_DECL.
      	(func_checker::compare_gimple_call): Call compare_operand.
      	(func_checker::compare_gimple_assign): Likewise.
      	* ipa-icf-gimple.h: Remove compare_cst_or_decl.
      	* ipa-icf.c (sem_function::icf_handled_component_p): Remove.
      	* ipa-icf.h (icf_handled_component_p): Remove.
      
      From-SVN: r277616
      Martin Liska committed
    • Integrate that for IPA ICF. · 8a319aa3
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	* ipa-icf-gimple.c (func_checker::hash_operand): New.
      	(func_checker::compare_cst_or_decl): Remove handling
      	of FIELD_DECL.
      	(func_checker::compare_operand): Transform to ...
      	(func_checker::operand_equal_p): ... this.
      	* ipa-icf-gimple.h (class func_checker): Add
      	operand_equal_p and hash_operand.
      	* ipa-icf.c (sem_function::equals_private): Fix
      	pushing and popping of cfun.
      
      From-SVN: r277615
      Martin Liska committed
    • Come up with an abstraction. · 7f4a8ee0
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	* fold-const.c (operand_equal_p): Move to ...
      	(operand_compare::operand_equal_p): ... here.
      	(operand_compare::verify_hash_value): New.
      	(add_expr): Move to ...
      	(operand_compare::hash_operand): ... here.
      	* fold-const.h (operand_equal_p): Move to the class.
      	(class operand_compare): New.
      	* tree.c (add_expr): Remove.
      
      From-SVN: r277614
      Martin Liska committed
    • cp-tree.h (omp_declare_variant_finalize, [...]): Declare. · 42ceec06
      	* cp-tree.h (omp_declare_variant_finalize, build_local_temp): Declare.
      	* decl.c: Include omp-general.h.
      	(declare_simd_adjust_this): Add forward declaration.
      	(omp_declare_variant_finalize_one, omp_declare_variant_finalize): New
      	function.
      	(cp_finish_decl, finish_function): Call omp_declare_variant_finalize.
      	* parser.c (cp_finish_omp_declare_variant): Adjust parsing of the
      	variant id-expression and propagate enough information to
      	omp_declare_variant_finalize_one in the attribute so that it can
      	finalize it.
      	* class.c (finish_struct): Call omp_declare_variant_finalize.
      	* tree.c (build_local_temp): No longer static, remove forward
      	declaration.
      
      	* c-c++-common/gomp/declare-variant-2.c: Add a test with , before
      	match clause.
      	* c-c++-common/gomp/declare-variant-6.c: Expect diagnostics also from
      	C++ FE and adjust regexp so that it handles C++ pretty printing of
      	function names.
      	* g++.dg/gomp/declare-variant-1.C: New test.
      	* g++.dg/gomp/declare-variant-2.C: New test.
      	* g++.dg/gomp/declare-variant-3.C: New test.
      	* g++.dg/gomp/declare-variant-4.C: New test.
      	* g++.dg/gomp/declare-variant-5.C: New test.
      
      From-SVN: r277613
      Jakub Jelinek committed
    • operand_equal_p: add support for OBJ_TYPE_REF. · 96e05bf5
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	* fold-const.c (operand_equal_p): Support OBJ_TYPE_REF.
      	* tree.c (add_expr): Hash parts of OBJ_TYPE_REF.
      
      From-SVN: r277612
      Martin Liska committed
    • typeck.c (cp_build_modify_expr): Prefer error + inform to error + error in one place. · 0f928153
      /cp
      2019-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* typeck.c (cp_build_modify_expr): Prefer error + inform to
      	error + error in one place.
      	(get_delta_difference_1): Likewise.
      	(get_delta_difference): Likewise, in two places.
      
      /testsuite
      2019-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/conversion/ptrmem2.C: Adjust for error + inform.
      	* g++.dg/gomp/tpl-atomic-2.C: Likewise.
      
      From-SVN: r277610
      Paolo Carlini committed
    • libgomp/testsuite – use 'stop' · c425e66b
      	libgomp/
      	* testsuite/libgomp.fortran/: Replace 'STOP' by 'stop'.
      
      From-SVN: r277609
      Tobias Burnus committed
    • Use symtab_node::order in LTO sections with body. · 3c56d8d8
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	PR lto/91393
      	PR lto/88220
      	* cgraph.c (cgraph_node::get_create): Overwrite node->order
      	from a first_clone in order to get proper LTO section
      	in LTO stream.
      	(cgraph_node::get_untransformed_body):
      	Use lto_get_section_data where symtab_node::order
      	must be provided.
      	* cgraphclones.c (cgraph_node::find_replacement):
      	Update also symbol order.
      	* ipa-fnsummary.c (ipa_fn_summary_read):
      	Use new function lto_get_summary_section_data.
      	* ipa-hsa.c (ipa_hsa_read_summary): Likewise.
      	* ipa-icf.c (sem_item_optimizer::read_summary):
      	Likewise.
      	* ipa-prop.c (ipa_prop_read_jump_functions):
      	Likewise.
      	(ipcp_read_transformation_summaries): Likewise.
      	* ipa-sra.c (ipa_sra_read_summary): Likewise.
      	* lto-cgraph.c (input_node): Add also order_base.
      	(input_varpool_node): Likewise.
      	(input_cgraph_1): Assign the order_base.
      	(input_cgraph_opt_summary): Use new lto_get_summary_section_data.
      	* lto-opts.c (lto_write_options): Pass new argument.
      	* lto-section-in.c (lto_get_section_data): Add new argumente order.
      	(lto_get_summary_section_data): New.
      	(lto_get_raw_section_data): Add order argument.
      	(lto_create_simple_input_block): Likewise.
      	* lto-section-out.c (lto_destroy_simple_output_block):
      	Likewise.
      	* lto-streamer-in.c (lto_input_toplevel_asms):
      	Use lto_get_summary_section_data.
      	(lto_input_mode_table): Likewise.
      	* lto-streamer-out.c (produce_asm): Pass symtab_node::order.
      	(lto_output_toplevel_asms): Pass new argument.
      	(copy_function_or_variable): Likewise.
      	(produce_lto_section):Likewise.
      	(produce_symtab): Likewise.
      	(lto_write_mode_table): Likewise.
      	(produce_asm_for_decls): Likewise.
      	* lto-streamer.c (lto_get_section_name): Concat symbol name
      	and symbol order.
      	* lto-streamer.h (lto_get_section_data): Add order argument.
      	(lto_get_summary_section_data): New.
      	(lto_get_raw_section_data): Add order argument.
      	(lto_get_section_name): Likewise.
      	* varpool.c (varpool_node::get_constructor): Pass order argument.
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	PR lto/91393
      	PR lto/88220
      	* lto-common.c (lto_file_finalize): Use lto_get_summary_section_data.
      	(get_section_data): Add order argument.
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	PR lto/91393
      	PR lto/88220
      	* gcc.dg/lto/pr91393_0.c: New test.
      
      From-SVN: r277607
      Martin Liska committed
    • libgomp/testsuite – use 'stop' and 'dg-do run' · 01509e2f
              libgomp/
              * testsuite/libgomp.fortran/target-simd.f90: Use stop not abort.
              * testsuite/libgomp.fortran/use_device_ptr-optional-1.f90:
              Ditto; add 'dg-do run' for torture testing.
              * testsuite/libgomp.fortran/lastprivate1.f90:  Add 'dg-do run'.
              * testsuite/libgomp.fortran/lastprivate2.f90: Ditto.
              * testsuite/libgomp.fortran/nestedfn4.f90: Ditto.
              * testsuite/libgomp.fortran/pr25219.f90: Ditto.
              * testsuite/libgomp.fortran/pr28390.f: Ditto.
              * testsuite/libgomp.fortran/pr35130.f90: Ditto.
              * testsuite/libgomp.fortran/pr90779.f90: Ditto.
              * testsuite/libgomp.fortran/task2.f90: Ditto.
              * testsuite/libgomp.fortran/taskgroup1.f90: Ditto.
              * testsuite/libgomp.fortran/taskloop1.f90: Ditto.
              * testsuite/libgomp.fortran/use_device_addr-1.f90: Ditto.
              * testsuite/libgomp.fortran/use_device_addr-2.f90: Ditto.
              * testsuite/libgomp.fortran/workshare1.f90: Ditto.
              * testsuite/libgomp.fortran/workshare2.f90: Ditto.
      
      From-SVN: r277606
      Tobias Burnus committed
    • re PR tree-optimization/92262 (ICE: verify_gimple failed (error: incorrect sharing of tree nodes)) · 9f33e121
      	PR tree-optimization/92262
      	* tree-ssa-loop-ivopts.c (get_debug_computation_at): Don't unshare
      	ubase or cbase here.
      	(remove_unused_ivs): Unshare comp before using it.
      
      	* g++.dg/opt/pr92262.C: New test.
      
      From-SVN: r277605
      Jakub Jelinek committed
    • ipa-prop.c (update_jump_functions_after_inlining): Watch for missing summaries. · fd776d28
      	* ipa-prop.c (update_jump_functions_after_inlining):
      	Watch for missing summaries.
      
      From-SVN: r277604
      Jan Hubicka committed
    • re PR tree-optimization/65930 (Reduction with sign-change not handled) · b4673569
      2019-10-30  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/65930
      	* tree-vect-loop.c (vect_is_simple_reduction): For reduction
      	chains also allow a leading and trailing conversion.
      	* tree-vect-slp.c (vect_get_and_check_slp_defs): Handle
      	intermediate reduction chains.
      	(vect_analyze_slp_instance): Likewise.  Build a SLP
      	node for a trailing conversion manually.
      
      	* gcc.dg/vect/pr65930-2.c: New testcase.
      
      From-SVN: r277603
      Richard Biener committed
    • Suppress warning with -Wno-overwrite-recursive. · 91c4891a
      The use of -fno-automatic with -frecursive results in a warning implying
      that recursion will not work. If all relevant local variable have the
      automatic attribute explicitly declared recursion does work and the warning
      is redundant.
      
      From-SVN: r277602
      Mark Eggleston committed
    • Remove cgraph_local_info structure. · 87f94429
      2019-10-30  Martin Liska  <mliska@suse.cz>
      
      	* cgraph.c (cgraph_node::local_info): Transform to ...
      	(cgraph_node::local_info_node): ... this.
      	(cgraph_node::dump): Remove cgraph_local_info and
      	put its fields directly into cgraph_node.
      	(cgraph_node::get_availability): Likewise.
      	(cgraph_node::make_local): Likewise.
      	(cgraph_node::verify_node): Likewise.
      	* cgraph.h (struct GTY): Likewise.
      	* cgraphclones.c (set_new_clone_decl_and_node_flags): Likewise.
      	(duplicate_thunk_for_node): Likewise.
      	(cgraph_node::create_clone): Likewise.
      	(cgraph_node::create_virtual_clone): Likewise.
      	(cgraph_node::create_version_clone): Likewise.
      	* cgraphunit.c (cgraph_node::reset): Likewise.
      	(cgraph_node::finalize_function): Likewise.
      	(cgraph_node::add_new_function): Likewise.
      	(analyze_functions): Likewise.
      	* combine.c (setup_incoming_promotions): Likewise.
      	* config/i386/i386.c (ix86_function_regparm): Likewise.
      	(ix86_function_sseregparm): Likewise.
      	(init_cumulative_args): Likewise.
      	* ipa-cp.c (determine_versionability): Likewise.
      	(count_callers): Likewise.
      	(set_single_call_flag): Likewise.
      	(initialize_node_lattices): Likewise.
      	(estimate_local_effects): Likewise.
      	(create_specialized_node): Likewise.
      	(identify_dead_nodes): Likewise.
      	* ipa-fnsummary.c (compute_fn_summary): Likewise.
      	(ipa_fn_summary_generate): Likewise.
      	* ipa-hsa.c (check_warn_node_versionable): Likewise.
      	(process_hsa_functions): Likewise.
      	* ipa-icf.c (set_local): Likewise.
      	* ipa-inline-analysis.c (initialize_inline_failed): Likewise.
      	* ipa-inline.c (speculation_useful_p): Likewise.
      	* ipa-profile.c (ipa_propagate_frequency): Likewise.
      	(ipa_profile): Likewise.
      	* ipa-split.c (split_function): Likewise.
      	(execute_split_functions): Likewise.
      	* ipa-sra.c (ipa_sra_preliminary_function_checks): Likewise.
      	(ipa_sra_ipa_function_checks): Likewise.
      	* ipa-visibility.c (function_and_variable_visibility): Likewise.
      	* ipa.c (symbol_table::remove_unreachable_nodes): Likewise.
      	* lto-cgraph.c (lto_output_node): Likewise.
      	(input_overwrite_node): Likewise.
      	* multiple_target.c (expand_target_clones): Likewise.
      	* omp-simd-clone.c (simd_clone_create): Likewise.
      	* trans-mem.c (expand_call_tm): Likewise.
      	(ipa_tm_mayenterirr_function): Likewise.
      	(ipa_tm_diagnose_tm_safe): Likewise.
      	(ipa_tm_diagnose_transaction): Likewise.
      	(ipa_tm_create_version): Likewise.
      	(ipa_tm_transform_calls_redirect): Likewise.
      	(ipa_tm_execute): Likewise.
      	* tree-inline.c (expand_call_inline): Likewise.
      
      From-SVN: r277601
      Martin Liska committed
    • Remove cgraph_global_info. · a62bfab5
      From-SVN: r277600
      Martin Liska committed
    • Daily bump. · 53289de5
      From-SVN: r277599
      GCC Administrator committed
  2. 29 Oct, 2019 10 commits
    • typeck.c (build_x_unary_op): Use the location_t argument in three error_at. · 6c6a2737
      /cp
      2019-10-29  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* typeck.c (build_x_unary_op): Use the location_t argument in
      	three error_at.
      
      /testsuite
      2019-10-29  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/other/ptrmem8.C: Test locations too.
      	* g++.dg/template/dtor6.C: Likewise.
      
      From-SVN: r277595
      Paolo Carlini committed
    • PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion. · 1e2fa738
      After r269667 which introduced joust_maybe_elide_copy, in C++17 we can elide
      a constructor if it uses a conversion function that returns a prvalue, and
      use the conversion function in its stead.
      
      This eliding means that if we have a candidate that previously didn't have
      ->second_conv, it can have it after the elision.  This confused the
      -Wconversion warning because it was assuming that if cand1->second_conv is
      non-null, so is cand2->second_conv.  Here cand1->second_conv was non-null
      but cand2->second_conv remained null, so it crashed in compare_ics.
      
      I checked with clang that both compilers call A::operator B() in C++17 and
      B::B(A const &) otherwise.
      
      	* call.c (joust): Don't attempt to warn if ->second_conv is null.
      
      	* g++.dg/cpp0x/overload-conv-4.C: New test.
      
      From-SVN: r277593
      Marek Polacek committed
    • re PR c++/92201 (ICE: ‘verify_gimple’ failed with -std=c++2a) · 6835f8a0
      	PR c++/92201
      	* cp-gimplify.c (cp_gimplify_expr): If gimplify_to_rvalue changes the
      	function pointer type, re-add cast to the original one.
      
      	* g++.dg/other/pr92201.C: New test.
      
      From-SVN: r277592
      Jakub Jelinek committed
    • PR c++/91548 - fix detecting modifying const objects for ARRAY_REF. · 0f184800
      This fixes a bogus "modifying a const object" error for an array that actually
      isn't declared const.  The problem was how I handled ARRAY_REFs here; we
      shouldn't look at the ARRAY_REF itself, but at the array its accessing.
      
      	* constexpr.c (cxx_eval_store_expression): Don't call
      	modifying_const_object_p for ARRAY_REF.
      
      	* g++.dg/cpp1y/constexpr-tracking-const15.C: New test.
      	* g++.dg/cpp1y/constexpr-tracking-const16.C: New test.
      	* g++.dg/cpp1z/constexpr-tracking-const1.C: New test.
      
      From-SVN: r277591
      Marek Polacek committed
    • Fix compilation errors with Clang · 6cd96bad
      	* include/bits/range_access.h (ranges::disable_sized_range)
      	(ranges::begin, ranges::end, ranges::cbegin, ranges::cend)
      	(ranges::rbegin, ranges::rend, ranges::crbegin, ranges::crend)
      	(ranges::size, ranges::empty, ranges::data, ranges::cdata)
      	(ranges::range, ranges::sized_range, ranges::advance, ranges::distance)
      	(ranges::next, ranges::prev): Guard with __cpp_lib_concepts.
      	* include/bits/stl_iterator.h (disable_sized_sentinel): Likewise.
      
      From-SVN: r277589
      Jonathan Wakely committed
    • Fix compilation errors with Clang · 540218dd
      	* include/bits/alloc_traits.h (__cpp_lib_constexpr_dynamic_alloc):
      	Define.
      	(allocator_traits::_S_construct, allocator_traits::_S_destroy)
      	(__alloc_on_copy, __alloc_on_move, __alloc_on_swap): Use
      	_GLIBCXX14_CONSTEXPR instead of constexpr.
      	* include/bits/stl_construct.h (_Destroy): Likewise.
      
      From-SVN: r277588
      Jonathan Wakely committed
    • Add iterator concepts and range access customization points for C++20 · 6d0dff49
      This adds most of the new C++20 features to <iterator>, as well as a few
      initial pieces of <ranges> (but no actual <ranges> header just yet).
      
      	* include/Makefile.am: Add new header.
      	* include/Makefile.in: Regenerate.
      	* include/bits/iterator_concepts.h: New header.
      	(contiguous_iterator_tag, iter_reference_t, ranges::iter_move)
      	(iter_rvalue_reference_t, incrementable_traits, iter_difference_t)
      	(readable_traits, iter_value_t, readable, iter_common_reference_t)
      	(writable, waekly_incrementable, incrementable)
      	(input_or_output_iterator, sentinel_for, disable_sized_sentinel)
      	(sized_sentinel_for, input_iterator, output_iterator)
      	(forward_iterator, bidirectional_iterator, random_access_iterator)
      	(contiguous_iterator, indirectly_unary_invocable)
      	(indirectly_regular_unary_invocable, indirect_unary_predicate)
      	(indirect_relation, indirect_strict_weak_order, indirect_result_t)
      	(projected, indirectly_movable, indirectly_movable_storable)
      	(indirectly_copyable, indirectly_copyable_storable, ranges::iter_swap)
      	(indirectly_swappable, indirectly_comparable, permutable, mergeable)
      	(sortable, unreachable_sentinel_t, unreachable_sentinel)
      	(default_sentinel_t, default_sentinel): Define.
      	(__detail::__cpp17_iterator, __detail::__cpp17_input_iterator)
      	(__detail::__cpp17_fwd_iterator, __detail::__cpp17_bidi_iterator)
      	(__detail::__cpp17_randacc_iterator): Define.
      	(__iterator_traits): Define constrained specializations.
      	* include/bits/move.h (move): Only use old concept check for C++98.
      	* include/bits/range_access.h (ranges::disable_sized_range)
      	(ranges::begin, ranges::end, ranges::cbegin, ranges::cend)
      	(ranges::rbegin, ranges::rend, ranges::crbegin, ranges::crend)
      	(ranges::size, ranges::empty, ranges::data, ranges::cdata): Define
      	new customization points for C++20.
      	(ranges::range, ranges::sized_range): Define new concepts for C++20.
      	(ranges::advance, ranges::distance, ranges::next, ranges::prev):
      	Define new functions for C++20.
      	(__adl_end, __adl_cdata, __adl_cbegin, __adl_cend, __adl_rbegin)
      	(__adl_rend, __adl_crbegin, __adl_crend, __adl_cdata, __adl_size)
      	(__adl_empty): Remove.
      	* include/bits/stl_iterator.h (disable_sized_sentinel): Specialize
      	for reverse_iterator.
      	* include/bits/stl_iterator_base_types.h (contiguous_iterator_tag):
      	Define new struct for C++20.
      	(iterator_traits<_Tp*>): Constrain partial specialization in C++20.
      	* include/std/concepts (__is_class_or_enum): Move to __detail
      	namespace.
      	* testsuite/20_util/forward/c_neg.cc: Adjust dg-error line number.
      	* testsuite/20_util/forward/f_neg.cc: Likewise.
      	* testsuite/24_iterators/associated_types/incrementable.traits.cc: New
      	test.
      	* testsuite/24_iterators/associated_types/readable.traits.cc: New test.
      	* testsuite/24_iterators/contiguous/concept.cc: New test.
      	* testsuite/24_iterators/contiguous/tag.cc: New test.
      	* testsuite/24_iterators/customization_points/iter_move.cc: New test.
      	* testsuite/24_iterators/customization_points/iter_swap.cc: New test.
      	* testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: New test.
      	* testsuite/24_iterators/range_operations/advance.cc: New test.
      	* testsuite/24_iterators/range_operations/distance.cc: New test.
      	* testsuite/24_iterators/range_operations/next.cc: New test.
      	* testsuite/24_iterators/range_operations/prev.cc: New test.
      	* testsuite/26_numerics/adjacent_difference/requirements/
      	explicit_instantiation/2.cc: Rename types that conflict with C++20
      	concepts.
      	* testsuite/26_numerics/adjacent_difference/requirements/
      	explicit_instantiation/pod.cc: Likewise.
      	* testsuite/26_numerics/partial_sum/requirements/
      	explicit_instantiation/2.cc: Likewise.
      	* testsuite/26_numerics/partial_sum/requirements/
      	explicit_instantiation/pod.cc: Likewise.
      	* testsuite/experimental/iterator/requirements.cc: Likewise.
      	* testsuite/std/ranges/access/begin.cc: New test.
      	* testsuite/std/ranges/access/cbegin.cc: New test.
      	* testsuite/std/ranges/access/cdata.cc: New test.
      	* testsuite/std/ranges/access/cend.cc: New test.
      	* testsuite/std/ranges/access/crbegin.cc: New test.
      	* testsuite/std/ranges/access/crend.cc: New test.
      	* testsuite/std/ranges/access/data.cc: New test.
      	* testsuite/std/ranges/access/empty.cc: New test.
      	* testsuite/std/ranges/access/end.cc: New test.
      	* testsuite/std/ranges/access/rbegin.cc: New test.
      	* testsuite/std/ranges/access/rend.cc: New test.
      	* testsuite/std/ranges/access/size.cc: New test.
      	* testsuite/util/testsuite_iterators.h (contiguous_iterator_wrapper)
      	(test_range, test_sized_range): New test utilities.
      
      From-SVN: r277579
      Jonathan Wakely committed
    • Minor improvements to testsuite iterator utilities · 9921ac3d
      	* testsuite/util/testsuite_iterators.h (BoundsContainer::size()): Add
      	new member function.
      	(WritableObject::operator=): Constrain with enable_if when available.
      	(remove_cv): Use std::remove_if when available.
      	(test_container::it(int)): Use size().
      	(test_container::size()): Use BoundsContainer::size().
      
      From-SVN: r277578
      Jonathan Wakely committed
    • PR libstdc++/92267 fix ABI change in deque iterators · 0ed4d408
      Defaulting the copy constructor on its first declaration made it change
      from user-provided (and non-trivial) to implicitly-defined (and
      trivial). This caused an ABI incompatibility between GCC 8 and GCC 9,
      where functions taking a deque iterator disagree on the argument passing
      convention.
      
      	PR libstdc++/92267
      	* include/bits/stl_deque.h (_Deque_iterator(const _Deque_iterator&)):
      	Do not define as defaulted.
      	* testsuite/23_containers/deque/types/92267.cc: New test.
      
      From-SVN: r277577
      Jonathan Wakely committed
    • re PR testsuite/92144 (c-c++-common/Warray-bounds-4.c still fails after r277080) · 668ca050
      gcc/testsuite/ChangeLog:
      
      	PR testsuite/92144
      	* c-c++-common/Warray-bounds-4.c: Disable test to avoid failures
      	due to PR 83543.
      
      From-SVN: r277576
      Martin Sebor committed