aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-04-02 20:25:36 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2013-04-02 20:25:36 +0200
commit5d751b0c970f54e3a99a177d4b2d77db81116e09 (patch)
tree4ee3c2b7dfdc5ebe044adb7a6e509a7d8ffa2e13 /gcc/gimplify.c
parente594716a6a02ffcc0a33862ff6ea8325ac2263e8 (diff)
downloadgcc-5d751b0c970f54e3a99a177d4b2d77db81116e09.zip
gcc-5d751b0c970f54e3a99a177d4b2d77db81116e09.tar.gz
gcc-5d751b0c970f54e3a99a177d4b2d77db81116e09.tar.bz2
re PR c++/34949 (Dead code in empty destructors.)
PR c++/34949 * tree-cfg.c (verify_gimple_assign_single): Allow lhs of gimple_clobber_p to be MEM_REF. * gimplify.c (gimplify_modify_expr): Gimplify *to_p of an assignment from TREE_CLOBBER_P. Allow it to be MEM_REF after gimplification. * asan.c (get_mem_ref_of_assignment): Don't instrument gimple_clobber_p stmts. * tree-ssa-dse.c (dse_optimize_stmt): Allow DSE of gimple_clobber_p stmt if they have MEM_REF lhs and are dead because of another gimple_clobber_p stmt. * tree-ssa-live.c (clear_unused_block_pointer): Treat gimple_clobber_p stmts like debug stmts. (remove_unused_locals): Remove clobbers with MEM_REF lhs that refer to unused VAR_DECLs or uninitialized values. * tree-sra.c (sra_ipa_reset_debug_stmts): Also remove gimple_clobber_p stmts if they refer to removed parameters. (get_repl_default_def_ssa_name, sra_ipa_modify_expr): Fix up formatting. From-SVN: r197369
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index a6a6565..a93ce7c 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4840,7 +4840,12 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
so handle it here. */
if (TREE_CLOBBER_P (*from_p))
{
- gcc_assert (!want_value && TREE_CODE (*to_p) == VAR_DECL);
+ ret = gimplify_expr (to_p, pre_p, post_p, is_gimple_lvalue, fb_lvalue);
+ if (ret == GS_ERROR)
+ return ret;
+ gcc_assert (!want_value
+ && (TREE_CODE (*to_p) == VAR_DECL
+ || TREE_CODE (*to_p) == MEM_REF));
gimplify_seq_add_stmt (pre_p, gimple_build_assign (*to_p, *from_p));
*expr_p = NULL;
return GS_ALL_DONE;