PR target/80190
* config/darwin.c: Include intl.h.
(darwin_build_constant_cfstring): Improve i18n of diagnostics by not
composing the message out of two separate parts.
From-SVN: r269480
For named function calls in a template, the result of unqualified lookup is
safed in CALL_EXPR_FN. But for operator expressions, no unqualified lookup
is performed until we know whether the operands have class type. So when we
see in a lambda a use of an operator that might be overloaded, we need to do
that lookup then and save it away somewhere. One possibility would be in
the expression, but we can't really add extra conditional operands to
standard tree codes. I mostly implemented another approach using a new
WITH_LOOKUP_EXPR code, but teaching everywhere how to handle a new tree code
is always complicated. Then it occurred to me that we could associate the
lookups with the function, which is both simpler and smaller. So this patch
stores any operator bindings needed by a lambda function in an internal
attribute on the lambda call operator.
* name-lookup.c (op_unqualified_lookup)
(maybe_save_operator_binding, discard_operator_bindings)
(push_operator_bindings): New.
* typeck.c (build_x_binary_op, build_x_unary_op): Call
maybe_save_operator_binding.
* decl.c (start_preparsed_function): Call push_operator_bindings.
* tree.c (cp_free_lang_data): Call discard_operator_bindings.
From-SVN: r269477
Andreas Schwab <schwab@suse.de>
* config/abi/post/riscv64-linux-gnu: New directory.
* config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: New file.
From-SVN: r269472
PR target/80003
* config/i386/i386.c (ix86_set_func_type): Make sure diagnostics
doesn't start with a capital letter and doesn't end with a dot.
(ix86_function_arg_boundary): Make sure diagnostics doesn't start
with a capital letter.
(ix86_mangle_function_version_assembler_name): Likewise.
(ix86_generate_version_dispatcher_body): Likewise.
(fold_builtin_cpu): Likewise.
(get_builtin_code_for_version): Likewise. Remove extraneous space.
(ix86_handle_interrupt_attribute): Make the diagnostics easier for
translators, wrap full type name in %qs.
* gcc.target/i386/pr68657.c: Adjust expected diagnostics wording.
* gcc.target/i386/interrupt-6.c: Likewise.
* g++.target/i386/pr57362.C: Adjust capitalization in dg-prune-output.
From-SVN: r269471
2019-03-07 Martin Jambor <mjambor@suse.cz>
PR lto/87525
* ipa-cp.c (perform_estimation_of_a_value): Account zero time benefit
for extern inline functions.
testsuite/
* gcc.dg/ipa/ipcp-5.c: New test.
From-SVN: r269464
Here the problem was that in order to form a FUNCTION_DECL for foo<int> in
the uninstantiated template, we were trying to deduce template args for S
from the template parm itself, and failing.
* pt.c (do_class_deduction): Handle parm used as its own arg.
From-SVN: r269463
2019-03-07 Martin Jambor <mjambor@suse.cz>
PR ipa/88235
* cgraph.h (cgraph_node): New inline method former_thunk_p.
* cgraph.c (cgraph_node::dump): Dump a note if node is a former thunk.
(clone_of_p): Treat expanded thunks like thunks, be optimistic if they
have multiple callees. At the end check if declarations match as
opposed to cgraph_nodes.
testsuite/
* g++.dg/ipa/pr88235.C: New test.
From-SVN: r269462
2019-03-07 Martin Liska <mliska@suse.cz>
* cgraph.c (cgraph_node::verify_node): Verify with a neighbour
which is equivalent to searching for this in clones chain.
* symtab.c (symtab_node::verify_base): Similarly compare ASM
names with a neighbour and special case first node in a chain.
From-SVN: r269461
Nothing can refer to an internal decl with no definition, so we shouldn't
treat such a decl as a possible devirtualization target.
* gimple-fold.c (can_refer_decl_in_current_unit_p): Return false
for an internal symbol with DECL_EXTERNAL.
From-SVN: r269459
2019-03-07 Richard Biener <rguenther@suse.de>
PR tree-optimization/89595
* tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Take
stmt iterator as reference, take boolean output parameter to
indicate whether the stmt was removed and thus the iterator
already advanced.
(dom_opt_dom_walker::before_dom_children): Re-iterate over
stmts created by folding.
* gcc.dg/torture/pr89595.c: New testcase.
From-SVN: r269453
In Array_type::do_export, when emitting a concrete array length,
evaluate the length expression to an integer constant and emit that
constant, instead of calling the more general method for emitting
expressions. This is to avoid the possibility that we will need
to emit a conversion, which could confuse the gccgoimporter.
Fixesgolang/go#30628.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165741
From-SVN: r269443
Here the used base<int>::operator= gets into the list of foo's bindings for
operator=, but it shouldn't make the copy ctor deleted.
* class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
op= brought in by a using-declaration.
From-SVN: r269442
Now that we're doing implicit lambda capture in templates, we see x here as
the lambda capture. maybe_convert_cond was doing nothing in a template, so
we never called mark_rvalue_use on x. As part of the broad move toward
doing more processing of non-dependent expressions, let's do this
conversion.
* semantics.c (maybe_convert_cond): Do convert a non-dependent
condition in a template.
* typeck.c (condition_conversion): Handle being called in a
template.
From-SVN: r269433
* typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
overload resolution would actually succeed.
* g++.dg/cpp0x/Wredundant-move1.C (fn4): Drop dg-warning.
* g++.dg/cpp0x/Wredundant-move7.C: New test.
From-SVN: r269427
2019-03-06 Edward Smith-Rowland <3dw4rd@verizon.net>
PR libstdc++/86655 - std::assoc_legendre should not constrain
the value of m (or x).
* include/tr1/legendre_function.tcc (__assoc_legendre_p,
__sph_legendre): If degree > order Don't throw, return 0.
(__legendre_p, __assoc_legendre_p): Don't constrain x either.
* testsuite/special_functions/02_assoc_legendre/pr86655.cc: New test.
* testsuite/special_functions/20_sph_legendre/pr86655.cc: New test.
* testsuite/tr1/5_numerical_facilities/special_functions/
02_assoc_legendre/pr86655.cc: New test.
* testsuite/tr1/5_numerical_facilities/special_functions/
22_sph_legendre/pr86655.cc: New test.
From-SVN: r269423
* include/std/variant (__do_visit): New.
(__variant_cast): Likewise.
(__variant_cookie): Likewise.
(__erased_*): Remove.
(_Variant_storage::_S_vtable): Likewise.
(_Variant_storage::__M_reset_impl): Adjust to use __do_visit.
(_Variant_storage::__M_reset): Adjust.
(__variant_construct): New.
(_Copy_ctor_base(const _Copy_ctor_base&)): Adjust to use
__variant_construct.
(_Move_ctor_base(_Move_ctor_base&&)): Likewise.
(_Move_ctor_base::__M_destructive_copy): New.
(_Move_ctor_base::__M_destructive_move): Adjust to use
__variant_construct.
(_Copy_assign_base::operator=): Adjust to use __do_visit.
(_Copy_assign_alias): Adjust to check both copy assignment
and copy construction for triviality.
(_Move_assign_base::operator=): Adjust to use __do_visit.
(_Multi_array): Add support for visitors that accept and return
a __variant_cookie.
(__gen_vtable_impl::_S_apply_all_alts): Likewise.
(__gen_vtable_impl::_S_apply_single_alt): Likewise.
(__gen_vtable_impl::__element_by_index_or_cookie): New. Generate
a __variant_cookie temporary for a variant that is valueless and..
(__gen_vtable_impl::__visit_invoke): ..adjust here.
(__gen_vtable::_Array_type): Conditionally make space for
the __variant_cookie visitor case.
(__variant_construct_by_index): New.
(get_if): Adjust to use std::addressof.
(relops): Adjust to use __do_visit.
(variant): Add __variant_cast and __variant_construct_by_index
as friends.
(variant::emplace): Use _M_reset() and __variant_construct_by_index
instead of self-destruction.
(variant::swap): Adjust to use __do_visit.
(visit): Reimplement in terms of __do_visit.
(__variant_hash_call_base_impl::operator()): Adjust to use __do_visit.
* testsuite/20_util/variant/compile.cc: Adjust.
* testsuite/20_util/variant/run.cc: Likewise.
From-SVN: r269422
2019-03-06 Richard Biener <rguenther@suse.de>
PR testsuite/89551
* gcc.dg/uninit-pred-8_b.c: Force logical-op-non-short-circuit
the way that makes the testcase PASS.
From-SVN: r269416