aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.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/tree-cfgcleanup.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/tree-cfgcleanup.c')
-rw-r--r--gcc/tree-cfgcleanup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index bd7c3c9..46d0fa3 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -601,9 +601,11 @@ fixup_noreturn_call (gimple *stmt)
/* If there is an LHS, remove it, but only if its type has fixed size.
The LHS will need to be recreated during RTL expansion and creating
- temporaries of variable-sized types is not supported. */
+ temporaries of variable-sized types is not supported. Also don't
+ do this with TREE_ADDRESSABLE types, as assign_temp will abort. */
tree lhs = gimple_call_lhs (stmt);
- if (lhs && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs))) == INTEGER_CST)
+ if (lhs && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs))) == INTEGER_CST
+ && !TREE_ADDRESSABLE (TREE_TYPE (lhs)))
{
gimple_call_set_lhs (stmt, NULL_TREE);