- 30 Jan, 2020 7 commits
-
-
By standard, coroutine body should be encapsulated in try-catch block as following: try { // coroutine body } catch(...) { promise.unhandled_exception(); } Given above try-catch block is implemented in the coroutine actor function called by coroutine ramp function, so the promise should be accessed via actor function's coroutine frame pointer argument, rather than the ramp function's coroutine frame variable. This patch cleans code a bit to make fix easy. gcc/cp * coroutines.cc (act_des_fn): New. (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls. Access promise via actor function's frame pointer argument. (build_actor_fn, build_destroy_fn): Use frame pointer argument.
Bin Cheng committed -
Function co_await_expander expands CO_AWAIT_EXPR and inserts expanded code before result of co_await is used, however, it doesn't cover the type conversion case and leads to gimplify ICE. This patch fixes it. gcc/cp * coroutines.cc (co_await_expander): Handle type conversion case. gcc/testsuite * g++.dg/coroutines/co-await-syntax-09-convert.C: New test.
Bin Cheng committed -
Patch by Svante Signell. Updates PR go/93468 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/216959
Ian Lance Taylor committed -
Patch from Svante Signell. Updates PR go/93468 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/216958
Ian Lance Taylor committed -
Since expand_stack_vars and such know how to deal with variables aligned beyond MAX_SUPPORTED_STACK_ALIGNMENT, we shouldn't reject alignas of large alignments. And if we don't do that, there's no point in having check_cxx_fundamental_alignment_constraints at all, since check_user_alignment already enforces MAX_OFILE_ALIGNMENT. PR c++/89357 * c-attribs.c (check_cxx_fundamental_alignment_constraints): Remove.
Jason Merrill committed -
GCC Administrator committed
-
The test uses __int128_t, so won't work on targets that don't support it. 2020-01-30 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/92706 * gcc.dg/tree-ssa/pr92706-1.c: Require int128 effective target.
Jakub Jelinek committed
-
- 29 Jan, 2020 26 commits
-
-
My fix for 60503 fixed handling of C++11 attributes following the lambda-declarator. My patch for 89640 re-added support for GNU attributes, but attributes after the trailing return type were parsed as applying to the return type rather than to the function. This patch adjusts parsing of a trailing-return-type to ignore GNU attributes at the end of the declaration so that they will be applied to the declaration as a whole. I also considered parsing the attributes between the closing paren and the trailing-return-type, and tried a variety of approaches to implementing that, but I think it's better to stick with the documented rule that "An attribute specifier list may appear immediately before the comma, '=' or semicolon terminating the declaration of an identifier...." Anyone disagree? Meanwhile, C++ committee discussion about the lack of any way to apply attributes to a lambda op() seems to have concluded that they should go between the introducer and declarator, so I've implemented that as well. PR c++/90333 PR c++/89640 PR c++/60503 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in a trailing return type. (cp_parser_lambda_declarator_opt): Parse C++11 attributes before parens.
Jason Merrill committed -
PR bootstrap/93409 * config/gcn/gcn-hsa.h (ASM_SPEC): Add -mattr=-code-object-v3 as LLVM's assembler changed the default in version 9.
Tobias Burnus committed -
This test got fixed by r10-1976-gdaaa6fcc so let's add it to the testsuite. PR c++/88092 * g++.dg/cpp2a/nontype-class31.C: New test.
Marek Polacek committed -
Improve DSE which in turn eliminates the need for jump threading and block duplication for the original testcase in pr89689 which in turn eliminates the false positive -Warray-bounds warning for the original testcase. PR tree-optimization/89689 * builtins.def (BUILT_IN_OBJECT_SIZE): Make it const rather than pure. PR tree-optimization/89689 * gcc.dg/pr89689.c: New test.
Jeff Law committed -
The patch caused regressions in gcc.target/sh/pr64345-1.c on sh3-linux-gnu and gcc.target/m68k/pr39726.c on m68k-linux-gnu. It didn't look like they would be fixable in an acceptably non-invasive and unhacky way, so punting till future releases. 2020-01-29 Richard Sandiford <richard.sandiford@arm.com> gcc/ Revert: 2020-01-28 Richard Sandiford <richard.sandiford@arm.com> PR rtl-optimization/87763 * simplify-rtx.c (simplify_truncation): Extend sign/zero_extract simplification to handle subregs as well as bare regs. * config/i386/i386.md (*testqi_ext_3): Match QI extracts too.
Richard Sandiford committed -
Here we fail to compile the attached test, stating that the use of T<s> in T<s>::T() {} is "invalid use of incomplete type". It is a function definition so grokdeclarator checks that the qualifying type is complete. When we parsed the class T, finish_struct gave the class a non-null TYPE_SIZE, making it COMPLETE_TYPE_P. But then we're parsing T<s>, a TEMPLATE_ID, in T<s>::T() {} so try to lookup_template_class T. This failed because we couldn't find such a class: comp_template_args told us that the argument lists don't match, because one of the args was wrapped in a VIEW_CONVERT_EXPR to make it look const. It seems to me that we should see through these artificial wrappers and consider the args same. 2020-01-29 Marek Polacek <polacek@redhat.com> PR c++/91754 - Fix template arguments comparison with class NTTP. * pt.c (class_nttp_const_wrapper_p): New. (template_args_equal): See through class_nttp_const_wrapper_p arguments. * g++.dg/cpp2a/nontype-class30.C: New test.
Marek Polacek committed -
This PR points out an ICE with an alias template and class NTTP, but I found that there are more issues. Trouble arise when we use a (non-type) template parameter as an argument to the template arg list of a template that accepts a class NTTP and a conversion to a class is involved, e.g. struct A { A(int) { } }; template<A a> struct B { }; template<int X> void fn () { B<X> b; } Normally for such a conversion we create a TARGET_EXPR with an AGGR_INIT_EXPR that calls a __ct_comp with some arguments, but not in this case: when converting X to type A in convert_nontype_argument we are in a template and the template parameter 'X' is value-dependent, and AGGR_INIT_EXPR don't work in templates. So it just creates a TARGET_EXPR that contains "A::A(*this, X)", but with that overload resolution fails: error: no matching function for call to 'A::A(A*, int)' That happens because finish_call_expr for a BASELINK creates a dummy object, so we have 'this' twice. I thought for the value-dependent case we could use IMPLICIT_CONV_EXPR, as in the patch below. Note that I only do this when we convert to a different type than the type of the expr. The point is to avoid the call to a converting ctor. The second issue was an ICE in tsubst_copy: when there's a conversion like the above involved then /* Wrapper to make a C++20 template parameter object const. */ op = tsubst_copy (op, args, complain, in_decl); might not produce a _ZT... VAR_DECL with const type, so the assert gcc_assert (CP_TYPE_CONST_P (TREE_TYPE (op))); fails. Allowing IMPLICIT_CONV_EXPR there probably makes sense. And since convert_nontype_argument uses value_dependent_expression_p a lot, I used a dedicated bool to speed things up. 2020-01-29 Marek Polacek <polacek@redhat.com> PR c++/92948 - Fix class NTTP with template arguments. * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when converting a value-dependent expression to a class type. (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR as the result of the tsubst_copy call. * g++.dg/cpp2a/nontype-class28.C: New test. * g++.dg/cpp2a/nontype-class29.C: New test.
Marek Polacek committed -
Fix synchronization issues in <stop_token>. Replace shared_ptr with _Stop_state_ref and a reference count embedded in the shared state. Replace std::mutex with spinlock using one bit of a std::atomic<> that also tracks whether a stop request has been made and how many stop_source objects share ownership of the state. PR libstdc++/92895 * include/std/stop_token (stop_token::stop_possible()): Call new _M_stop_possible() function. (stop_token::stop_requested()): Do not use stop_possible(). (stop_token::binary_semaphore): New class, as temporary stand-in for std::binary_semaphore. (stop_token::_Stop_cb::_M_callback): Add noexcept to type. (stop_token::_Stop_cb::_M_destroyed, stop_token::_Stop_cb::_M_done): New data members for symchronization with stop_callback destruction. (stop_token::_Stop_cb::_Stop_cb): Make non-template. (stop_token::_Stop_cb::_M_linked, stop_token::_Stop_cb::_S_execute): Remove. (stop_token::_Stop_cb::_M_run): New member function. (stop_token::_Stop_state::_M_stopped, stop_token::_Stop_state::_M_mtx): Remove. (stop_token::_Stop_state::_M_owners): New data member to track reference count for ownership. (stop_token::_Stop_state::_M_value): New data member combining a spinlock, the stop requested flag, and the reference count for associated stop_source objects. (stop_token::_Stop_state::_M_requester): New data member for synchronization with stop_callback destruction. (stop_token::_Stop_state::_M_stop_possible()): New member function. (stop_token::_Stop_state::_M_stop_requested()): Inspect relevant bit of _M_value. (stop_token::_Stop_state::_M_add_owner) (stop_token::_Stop_state::_M_release_ownership) (stop_token::_Stop_state::_M_add_ssrc) (stop_token::_Stop_state::_M_sub_ssrc): New member functions for updating reference counts. (stop_token::_Stop_state::_M_lock, stop_token::_Stop_state::_M_unlock) (stop_token::_Stop_state::_M_lock, stop_token::_Stop_state::_M_unlock) (stop_token::_Stop_state::_M_try_lock) (stop_token::_Stop_state::_M_try_lock_and_stop) (stop_token::_Stop_state::_M_do_try_lock): New member functions for managing spinlock. (stop_token::_Stop_state::_M_request_stop): Use atomic operations to read and update state. Release lock while running callbacks. Use new data members to synchronize with callback destruction. (stop_token::_Stop_state::_M_remove_callback): Likewise. (stop_token::_Stop_state::_M_register_callback): Use atomic operations to read and update state. (stop_token::_Stop_state_ref): Handle type to manage _Stop_state, replacing shared_ptr. (stop_source::stop_source(const stop_source&)): Update reference count. (stop_source::operator=(const stop_source&)): Likewise. (stop_source::~stop_source()): Likewise. (stop_source::stop_source(stop_source&&)): Define as defaulted. (stop_source::operator=(stop_source&&)): Establish postcondition on parameter. (stop_callback): Enforce preconditions on template parameter. Replace base class with data member of new _Cb_impl type. (stop_callback::stop_callback(const stop_token&, Cb&&)) (stop_callback::stop_callback(stop_token&&, Cb&&)): Fix TOCTTOU race. (stop_callback::_Cb_impl): New type wrapping _Callback member and defining the _S_execute member function. * testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc: New test. * testsuite/30_threads/stop_token/stop_callback/deadlock.cc: New test. * testsuite/30_threads/stop_token/stop_callback/destroy.cc: New test. * testsuite/30_threads/stop_token/stop_callback/destructible_neg.cc: New test. * testsuite/30_threads/stop_token/stop_callback/invocable_neg.cc: New test. * testsuite/30_threads/stop_token/stop_callback/invoke.cc: New test. * testsuite/30_threads/stop_token/stop_source/assign.cc: New test. * testsuite/30_threads/stop_token/stop_token/stop_possible.cc: New test.
Jonathan Wakely committed -
libgomp/ * oacc-init.c (name_of_acc_device_t): Handle acc_device_radeon. Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
Frederik Harwath committed -
A previous change to simplify LRA introduced in 11b809 (From-SVN: r279550) disabled hard register splitting for -O0. This causes a problem on aarch64 in cases where parameters are passed in multiple registers (in the bug report an OI passed in 2 V4SI registers). This is mandated by the AAPCS. gcc/ChangeLog: 2020-01-29 Joel Hutton <Joel.Hutton@arm.com> PR target/93221 * ira.c (ira): Revert use of simplified LRA algorithm. gcc/testsuite/ChangeLog: 2020-01-29 Joel Hutton <Joel.Hutton@arm.com> PR target/93221 * gcc.target/aarch64/pr93221.c: New test.
Andre Vieira committed -
The __3way_builtin_ptr_cmp concept can use three_way_comparable_with to check whether <=> is valid. Doing that makes it obvious that the disjunction on compare_three_way::operator() is redundant, because the second constraint subsumes the first. The workaround for PR c++/91073 can also be removed as that bug is fixed now. * libsupc++/compare (__detail::__3way_builtin_ptr_cmp): Use three_way_comparable_with. (__detail::__3way_cmp_with): Remove workaround for fixed bug. (compare_three_way::operator()): Remove redundant constraint from requires-clause. (__detail::_Synth3way::operator()): Use three_way_comparable_with instead of workaround. * testsuite/18_support/comparisons/object/93479.cc: Prune extra output due to simplified constraints on compare_three_way::operator().
Jonathan Wakely committed -
Currently types that cannot be compared using <=> but which are convertible to pointers will be compared by converting to pointers first. They should not be comparable. PR libstdc++/93479 * libsupc++/compare (__3way_builtin_ptr_cmp): Require <=> to be valid. * testsuite/18_support/comparisons/object/93479.cc: New test.
Jonathan Wakely committed -
* testsuite/std/ranges/access/end.cc: Do not assume test_range::end() returns the same type as test_range::begin(). Add comments. * testsuite/std/ranges/access/rbegin.cc: Likewise. * testsuite/std/ranges/access/rend.cc: Likewise. * testsuite/std/ranges/range.cc: Do not assume the sentinel for test_range is the same as its iterator type. * testsuite/util/testsuite_iterators.h (test_range::sentinel): Add operator- overloads to satisfy sized_sentinel_for when the iterator satisfies random_access_iterator.
Jonathan Wakely committed -
2020-01-29 Martin Jambor <mjambor@suse.cz> PR tree-optimization/92706 * tree-sra.c (struct access): Fields first_link, last_link, next_queued and grp_queued renamed to first_rhs_link, last_rhs_link, next_rhs_queued and grp_rhs_queued respectively, new fields first_lhs_link, last_lhs_link, next_lhs_queued and grp_lhs_queued. (struct assign_link): Field next renamed to next_rhs, new field next_lhs. Updated comment. (work_queue_head): Renamed to rhs_work_queue_head. (lhs_work_queue_head): New variable. (add_link_to_lhs): New function. (relink_to_new_repr): Also relink LHS lists. (add_access_to_work_queue): Renamed to add_access_to_rhs_work_queue. (add_access_to_lhs_work_queue): New function. (pop_access_from_work_queue): Renamed to pop_access_from_rhs_work_queue. (pop_access_from_lhs_work_queue): New function. (build_accesses_from_assign): Also add links to LHS lists and to LHS work_queue. (child_would_conflict_in_lacc): Renamed to child_would_conflict_in_acc. Adjusted parameter names. (create_artificial_child_access): New parameter set_grp_read, use it. (subtree_mark_written_and_enqueue): Renamed to subtree_mark_written_and_rhs_enqueue. (propagate_subaccesses_across_link): Renamed to propagate_subaccesses_from_rhs. (propagate_subaccesses_from_lhs): New function. (propagate_all_subaccesses): Also propagate subaccesses from LHSs to RHSs. testsuite/ * gcc.dg/tree-ssa/pr92706-1.c: New test.
Martin Jambor committed -
2020-01-29 Martin Jambor <mjambor@suse.cz> PR tree-optimization/92706 * tree-sra.c (struct access): Adjust comment of grp_total_scalarization. (find_access_in_subtree): Look for single children spanning an entire access. (scalarizable_type_p): Allow register accesses, adjust callers. (completely_scalarize): Remove function. (scalarize_elem): Likewise. (create_total_scalarization_access): Likewise. (sort_and_splice_var_accesses): Do not track total scalarization flags. (analyze_access_subtree): New parameter totally, adjust to new meaning of grp_total_scalarization. (analyze_access_trees): Pass new parameter to analyze_access_subtree. (can_totally_scalarize_forest_p): New function. (create_total_scalarization_access): Likewise. (create_total_access_and_reshape): Likewise. (total_should_skip_creating_access): Likewise. (totally_scalarize_subtree): Likewise. (analyze_all_variable_accesses): Perform total scalarization after subaccess propagation using the new functions above. (initialize_constant_pool_replacements): Output initializers by traversing the access tree. testsuite/ * gcc.dg/tree-ssa/pr92706-2.c: New test. * gcc.dg/guality/pr59776.c: Xfail tests for s2.g.
Martin Jambor committed -
2020-01-29 Martin Jambor <mjambor@suse.cz> * tree-sra.c (verify_sra_access_forest): New function. (verify_all_sra_access_forests): Likewise. (create_artificial_child_access): Set parent. (analyze_all_variable_accesses): Call the verifier.
Martin Jambor committed -
* cgraph.c (cgraph_edge::resolve_speculation): Only lookup direct edge if called on indirect edge. (cgraph_edge::redirect_call_stmt_to_callee): Lookup indirect edge of speculative call if needed. * gcc.dg/tree-prof/indir-call-prof-2.c: New testcase.
Jan Hubicka committed -
libgomp/ * testsuite/libgomp.oacc-c-c++-common/acc_get_property.c: Adjust to GNU coding style. * testsuite/libgomp.oacc-c-c++-common/acc_get_property-aux.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/acc_get_property-gcn.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/acc_get_property-host.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/acc_get_property-nvptx.c: Likewise.
Frederik Harwath committed -
Add full support for the OpenACC 2.6 acc_get_property and acc_get_property_string functions to the libgomp GCN plugin. libgomp/ * plugin-gcn.c (struct agent_info): Add fields "name" and "vendor_name" ... (GOMP_OFFLOAD_init_device): ... and init from here. (struct hsa_context_info): Add field "driver_version_s" ... (init_hsa_contest): ... and init from here. (GOMP_OFFLOAD_openacc_get_property): Replace stub with a proper implementation. * testsuite/libgomp.oacc-c-c++-common/acc_get_property.c: Enable test execution for amdgcn and host offloading targets. * testsuite/libgomp.oacc-fortran/acc_get_property.f90: Likewise. * testsuite/libgomp.oacc-c-c++-common/acc_get_property-aux.c (expect_device_properties): Split function into ... (expect_device_string_properties): ... this new function ... (expect_device_memory): ... and this new function. * testsuite/libgomp.oacc-c-c++-common/acc_get_property-gcn.c: Add test.
Frederik Harwath committed -
2020-01-29 Richard Sandiford <richard.sandiford@arm.com> gcc/testsuite/ PR testsuite/93393 * gcc.dg/torture/pr93133.c: XFAIL for powerpc*-*-*.
Richard Sandiford committed -
If the typeinfo decls appear in OpenMP default(none) regions, as we no longer predetermine const with no mutable members, they are diagnosed as errors, but it isn't something the users can actually provide explicit sharing for in the clauses. 2020-01-29 Jakub Jelinek <jakub@redhat.com> PR c++/91118 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls. * g++.dg/gomp/pr91118-1.C: New test. * g++.dg/gomp/pr91118-2.C: New test.
Jakub Jelinek committed -
As the testcase shows, some EXEC_OACC_* codes weren't handled in oacc_code_to_statement. Fixed thusly. 2020-01-29 Jakub Jelinek <jakub@redhat.com> PR fortran/93463 * openmp.c (oacc_code_to_statement): Handle EXEC_OACC_{ROUTINE,UPDATE,WAIT,CACHE,{ENTER,EXIT}_DATA,DECLARE}. * gfortran.dg/goacc/pr93463.f90: New test.
Jakub Jelinek committed -
All that is really needed is make sure you #include "diagnostic-core.h" before including pretty-print.h. By including diagnostic-core.h first, you do: and then pretty-print.h will do: If instead pretty-print.h is included first, then it will use __gcc_diag__ instead of __gcc_tdiag__ and thus will assume %E/%D etc. can't be handled. 2020-01-29 Jakub Jelinek <jakub@redhat.com> * analyzer.h (PUSH_IGNORE_WFORMAT, POP_IGNORE_WFORMAT): Remove. * constraint-manager.cc: Include diagnostic-core.h before graphviz.h. (range::dump, equiv_class::print): Don't use PUSH_IGNORE_WFORMAT or POP_IGNORE_WFORMAT. * state-purge.cc: Include diagnostic-core.h before gimple-pretty-print.h. (state_purge_annotator::add_node_annotations, print_vec_of_names): Don't use PUSH_IGNORE_WFORMAT or POP_IGNORE_WFORMAT. * region-model.cc: Move diagnostic-core.h include before graphviz.h. (path_var::dump, svalue::print, constant_svalue::print_details, region::dump_to_pp, region::dump_child_label, region::print_fields, map_region::print_fields, map_region::dump_dot_to_pp, map_region::dump_child_label, array_region::print_fields, array_region::dump_dot_to_pp): Don't use PUSH_IGNORE_WFORMAT or POP_IGNORE_WFORMAT.
Jakub Jelinek committed -
With SLP now being a graph with shared nodes across instances we have to make sure to compute the load permutation of nodes once, not overwriting the result of earlier analysis. 2020-01-28 Richard Biener <rguenther@suse.de> PR tree-optimization/93428 * tree-vect-slp.c (vect_build_slp_tree_2): Compute the load permutation when the load node is created. (vect_analyze_slp_instance): Re-use it here. * gcc.dg/torture/pr93428.c: New testcase.
Richard Biener committed -
* ipa-prop.c (update_indirect_edges_after_inlining): Fix warning.
Jan Hubicka committed -
GCC Administrator committed
-
- 28 Jan, 2020 7 commits
-
-
gcc/testsuite/ChangeLog: PR middle-end/93437 * g++.dg/warn/Wstringop-overflow-5.C: New test.
Martin Sebor committed -
A return statement in a discarded statement is not used for return type deduction, but we still want to do deduction for a return statement in a lambda in a discarded statement. PR c++/93442 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
Jason Merrill committed -
My patch for PR 91476 worked for decls that are implicitly comdat/weak due to C++ linkage rules, but broke variables explicitly marked weak. PR c++/93477 PR c++/91476 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
Jason Merrill committed -
* ipa-prop.c (update_indirect_edges_after_inlining):
Jan Hubicka committed -
Comments 11-16 within PR analyzer/93316 discuss an ICE in some setjmp tests seen on AIX and powerpc-darwin9. The issue turned out to be an implicit assumption that longjmp is marked "noreturn". There are two places in engine.cc where the code attempted to locate the longjmp GIMPLE_CALL by finding the final stmt within its supernode, in one place casting it via "as_a <gcall *>", in the other using it as the location_t of the "rewinding from longjmp..." event. When longjmp isn't marked noreturn, its basic block and hence supernode can have additional stmts after the longjmp; in the setjmp-3.c case this was a GIMPLE_RETURN, leading to a ICE when casting this to a GIMPLE_CALL. This patch fixes the two places in question to use the rewind_info_t::get_longjmp_call member function introduced by 342e14ff, fixing the ICE (and ensuring the correct location_t is used for events). gcc/analyzer/ChangeLog: PR analyzer/93316 * engine.cc (rewind_info_t::update_model): Get the longjmp call stmt via get_longjmp_call () rather than assuming it is the last stmt in the longjmp's supernode. (rewind_info_t::add_events_to_path): Get the location_t for the rewind_from_longjmp_event via get_longjmp_call () rather than from the supernode's get_end_location ().
David Malcolm committed -
2020-01-28 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/93272 * ira-lives.c (process_out_of_region_eh_regs): New function. (process_bb_node_lives): Call it.
Vladimir N. Makarov committed -
* coverage.c (read_counts_file): Make error message lowercase.
Jan Hubicka committed
-