diff options
author | Jason Merrill <jason@redhat.com> | 2018-04-30 11:21:01 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-04-30 11:21:01 -0400 |
commit | cdc184174ce56df1fcaf2355d5ecdb47244c2de8 (patch) | |
tree | 9654bf8df2ca4818d260cdca690325cbc05f7405 /gcc/gimplify.c | |
parent | 4d20f49036b7a669518aab3ba4cbb062287957da (diff) | |
download | gcc-cdc184174ce56df1fcaf2355d5ecdb47244c2de8.zip gcc-cdc184174ce56df1fcaf2355d5ecdb47244c2de8.tar.gz gcc-cdc184174ce56df1fcaf2355d5ecdb47244c2de8.tar.bz2 |
PR c++/61982 - dead stores to destroyed objects.
gcc/cp/
* call.c (build_trivial_dtor_call): New, assigns a clobber.
(build_over_call, build_special_member_call): Use it.
* cp-tree.h: Declare it.
* init.c (build_delete): Remove trivial path.
gcc/
* gimplify.c (gimplify_modify_expr): Simplify complex lvalue on LHS
of clobber.
From-SVN: r259772
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index b5b80ab..d27aae2 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -5558,8 +5558,13 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, ret = gimplify_expr (to_p, pre_p, post_p, is_gimple_lvalue, fb_lvalue); if (ret == GS_ERROR) return ret; - gcc_assert (!want_value - && (VAR_P (*to_p) || TREE_CODE (*to_p) == MEM_REF)); + gcc_assert (!want_value); + if (!VAR_P (*to_p) && TREE_CODE (*to_p) != MEM_REF) + { + tree addr = get_initialized_tmp_var (build_fold_addr_expr (*to_p), + pre_p, post_p); + *to_p = build_simple_mem_ref_loc (EXPR_LOCATION (*to_p), addr); + } gimplify_seq_add_stmt (pre_p, gimple_build_assign (*to_p, *from_p)); *expr_p = NULL; return GS_ALL_DONE; |