aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cvt.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-01-08 11:01:12 -0500
committerJason Merrill <jason@gcc.gnu.org>2016-01-08 11:01:12 -0500
commit451773378f6808ce2b1e1d4eaed40b164ad590da (patch)
treea6a87fb093cb967de90353ff866ccad75a8602eb /gcc/cp/cvt.c
parent0795b6f262e37218e80ee03d9c4c2f63541b149b (diff)
downloadgcc-451773378f6808ce2b1e1d4eaed40b164ad590da.zip
gcc-451773378f6808ce2b1e1d4eaed40b164ad590da.tar.gz
gcc-451773378f6808ce2b1e1d4eaed40b164ad590da.tar.bz2
PR c++/68983 (BE)
PR c++/67557 gcc/ * function.c (assign_temp): Guard against TREE_ADDRESSABLE types here. * expr.c (store_field): Not here. * tree-cfgcleanup.c (fixup_noreturn_call): Don't clear LHS of a call with TREE_ADDRESSABLE type. * tree-cfg.c (verify_gimple_call): Adjust. gcc/cp/ * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of TREE_ADDRESSABLE type. From-SVN: r232167
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r--gcc/cp/cvt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index d79f13b..f381f9b 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -1229,11 +1229,12 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain)
case TARGET_EXPR:
/* Don't bother with the temporary object returned from a function if
- we don't use it and don't need to destroy it. We'll still
+ we don't use it, don't need to destroy it, and won't abort in
+ assign_temp. We'll still
allocate space for it in expand_call or declare_return_variable,
but we don't need to track it through all the tree phases. */
if (TARGET_EXPR_IMPLICIT_P (expr)
- && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (expr)))
+ && !TREE_ADDRESSABLE (TREE_TYPE (expr)))
{
tree init = TARGET_EXPR_INITIAL (expr);
if (TREE_CODE (init) == AGGR_INIT_EXPR