From abd3a68c1343af515a1f9b5e60f2b6ed94ee1d7a Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 24 May 2016 13:34:37 +0000 Subject: tree-cfg.h (should_remove_lhs_p): New predicate. * tree-cfg.h (should_remove_lhs_p): New predicate. * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Use it. * gimplify.c (gimplify_modify_expr): Likewise. * tree-cfg.c (verify_gimple_call): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * gimple-fold.c: Include "tree-cfg.h". (gimple_fold_call): Use should_remove_lhs_p. From-SVN: r236637 --- gcc/tree-cfg.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gcc/tree-cfg.h') diff --git a/gcc/tree-cfg.h b/gcc/tree-cfg.h index 802e292..3e2a1ee 100644 --- a/gcc/tree-cfg.h +++ b/gcc/tree-cfg.h @@ -108,4 +108,14 @@ extern bool gimple_find_sub_bbs (gimple_seq, gimple_stmt_iterator *); extern bool extract_true_false_controlled_edges (basic_block, basic_block, edge *, edge *); +/* Return true if the LHS of a call should be removed. */ + +inline bool +should_remove_lhs_p (tree lhs) +{ + return (lhs + && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs))) == INTEGER_CST + && !TREE_ADDRESSABLE (TREE_TYPE (lhs))); +} + #endif /* _TREE_CFG_H */ -- cgit v1.1