- 31 Oct, 2019 6 commits
-
-
This precondition is the subject of a national body comment on the C++20 CD. This just adds a test to ensure we enforce the precondition. Also move existing 24_iterator/range_access*.cc tests to a dedicated directory for the [iterator.range] subclause. * testsuite/24_iterators/range_access*.cc: Move to ... * testsuite/24_iterators/range_access/range_access*.cc: ... here. * testsuite/24_iterators/range_access/range_access_cpp20_neg.cc: New test. From-SVN: r277658
Jonathan Wakely committed -
2019-10-31 Martin Liska <mliska@suse.cz> * config/arm/arm.c (arm_get_pcs_model): Remove usage of cgraph_local_info and use local_info_node instead. * config/bfin/bfin.c (bfin_load_pic_reg): Likewise. (bfin_function_ok_for_sibcall): Likewise. * config/c6x/c6x.c (c6x_function_ok_for_sibcall): Likewise. (must_reload_pic_reg_p): Likewise. From-SVN: r277657
Martin Liska committed -
PR c++/90947 * tree.h (type_initializer_zero_p): Remove. * tree.c (type_initializer_zero_p): Remove. cp/ * cp-tree.h (type_initializer_zero_p): Declare. * decl.c (reshape_init_array_1): Formatting fix. * tree.c (type_initializer_zero_p): New function. Moved from ../tree.c, use next_initializable_field, formatting fix. Return false for TYPE_NON_AGGREGATE_CLASS types. From-SVN: r277656
Jakub Jelinek committed -
Attached is a patch that adds parsing of the optional requires-clause in a lambda-expression and lambda-declarator. Additionally, shorthand constraints from the template-parameter-list are now actually applied and constrain the synthesized operator(). Previously we were not parsing the requires clauses at all and not saving the shorthand constraints in the place expected by grokfndecl. The trailing requires-clause is now also used to suppress synthesis of the conversion to function pointer for non-capturing non-generic lambdas as per expr.prim.lambda.closure/7. This includes a fix to template_class_depth. Previously it was computing the wrong depth for lambdas in the initializer of a static member of a class template, exhibited by the concepts-lambda4 test which currently fails on trunk. The bug was causing grokfndecl to use the constraints from the template class for the lambda. gcc/cp/ 2019-10-30 Jeff Chapman II <jchapman@lock3software.com> PR c++/84810 - constraints on lambdas * lambda.c (maybe_add_lambda_conv_op): Do not synthesize conversion if the call operator does not satisfy its constraints. * parser.c (cp_parser_lambda_declarator_opt): Parse requires-clause on generic lambdas; combine with shorthand constraints. Parse trailing requires-clause and attach to the synthesized call operator. * pt.c (template_class_depth): Only inspect LAMBDA_TYPE_EXTRA_SCOPE if it is present. This fixes an incorrect depth calculation for lambdas inside the initializer of a static data member of a template class. gcc/testsuite/ 2019-10-30 Jeff Chapman II <jchapman@lock3software.com> PR c++/84810 - constraints on lambdas * g++.dg/cpp2a/concepts-lambda2.C: New test. * g++.dg/cpp2a/concepts-lambda3.C: Ditto. * g++.dg/cpp2a/concepts-lambda4.C: Ditto. * g++.dg/cpp2a/concepts-pr84810.C: Ditto. From-SVN: r277655
Jeff Chapman II committed -
Previously we would put the template arguments for the concept-check in a TEMPLATE_ID and then also pass them to constraints_satisfied_p, which meant that we would try to normalize the concept-check with the fully instantiated arguments, leading to sadness. Simply not passing the args to constraints_satisfied_p fixes the problem. I also noticed that we weren't detecting substitution failure in the constraints, but were silently treating it as success. * constraint.cc (type_deducible_p): Check for substitution failure. (diagnose_compound_requirement): Adjust diagnostic. * pt.c (do_auto_deduction): Don't pass cargs to constraints_satisfied_p. From-SVN: r277654
Jason Merrill committed -
From-SVN: r277653
GCC Administrator committed
-
- 30 Oct, 2019 34 commits
-
-
PR c++/91369 - Implement P0784R7: constexpr new * constexpr.c (cxx_replaceable_global_alloc_fn): Don't return true for placement new. (cxx_placement_new_fn, is_std_construct_at): New functions. (cxx_eval_call_expression): Allow placement new in std::construct_at. (potential_constant_expression_1): Likewise. * g++.dg/cpp2a/constexpr-new5.C: New test. From-SVN: r277649
Jakub Jelinek committed -
typeck.c (decl_in_std_namespace_p): Return true also for decls in inline namespaces inside of std namespace. * typeck.c (decl_in_std_namespace_p): Return true also for decls in inline namespaces inside of std namespace. * g++.dg/cpp0x/Wpessimizing-move6.C: New test. From-SVN: r277648
Jakub Jelinek committed -
2019-10-30 Bernd Edlinger <bernd.edlinger@hotmail.de> * doc/invoke.texi (-Wshadow, -Wshadow=global -Wshadow=local, -Wshadow=compatible-local): Update documentation. cp: 2019-10-30 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/92024 * name-lookup.c (check_local_shadow): Shadowing TYPE_DECLs is always a -Wshadow=compatible-local warning, unless -Wshadow is used. testsuite: 2019-10-30 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/92024 * g++.dg/parse/crash70.C: New test. * c-c++-common/Wshadow-1.c: New test. From-SVN: r277643
Bernd Edlinger committed -
PR fortran/92208 * trans-array.c (gfc_conv_array_parameter): Only copy string-length backend_decl if expression is not a function. PR fortran/92208 * gfortran.dg/pr92208.f90: New. From-SVN: r277639
Tobias Burnus committed -
From-SVN: r277637
Jason Merrill committed -
I wasn't properly setting LOOKUP_CONSTINIT in grokfield and so we didn't detect a non-const initializer. * decl2.c (grokfield): Set LOOKUP_CONSTINIT. * g++.dg/cpp2a/constinit14.C: New test. From-SVN: r277636
Marek Polacek committed -
This combines two of the std::ranges::swap.operator() overloads into a single function template. Using if-constexpr to choose between implementations should give the compiler less work to do than using overloading. * include/std/concepts (std::ranges::swap): Use a single overload for the non-array cases, and switch using if-constexpr. From-SVN: r277635
Jonathan Wakely committed -
* include/bits/stl_iterator.h (__normal_iterator::iterator_concept): Guard with __cpp_lib_concepts macro. From-SVN: r277634
Jonathan Wakely committed -
* include/std/bit (__cpp_lib_bitops): Define. * include/std/version (__cpp_lib_constexpr): Remove. (__cpp_lib_bitops, __cpp_lib_constexpr_dynamic_alloc): Define. * testsuite/26_numerics/bit/header.cc: New test. * testsuite/26_numerics/bit/header-2.cc: New test. * testsuite/20_util/allocator_traits/header.cc: New test. * testsuite/20_util/allocator_traits/header-2.cc: New test. From-SVN: r277633
Jonathan Wakely committed -
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 -
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 -
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 -
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 -
* testsuite/util/testsuite_iterators.h: Fix typo in __cplusplus check. From-SVN: r277628
Jonathan Wakely committed -
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 -
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 -
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 -
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 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 -
From-SVN: r277620
Jakub Jelinek committed -
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 -
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 -
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 -
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 -
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 -
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, 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 -
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 -
/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/libgomp.fortran/: Replace 'STOP' by 'stop'. From-SVN: r277609
Tobias Burnus committed -
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/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 -
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. From-SVN: r277604
Jan Hubicka committed
-