summaryrefslogtreecommitdiff
path: root/gcc/gimple.h
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-27 14:32:47 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-27 14:32:47 +0000
commit09937c79d6fc38165805d31ca230fb2043137385 (patch)
tree2ef7f1febc0aea12d3964123c22645dfb8cb316b /gcc/gimple.h
parent04324e294846a522a86098f5699dc79a0417e27e (diff)
downloadgcc-09937c79d6fc38165805d31ca230fb2043137385.tar.gz
2010-11-27 Richard Guenther <rguenther@suse.de>
* gimple.c (gimple_assign_copy_p): Use gimple_assign_single_p. (gimple_assign_ssa_name_copy_p): Likewise. (gimple_assign_unary_nop_p): Use is_gimple_assign. (is_gimple_cast): Remove. (gimple_assign_single_p): Move ... * gimple.h (gimple_assign_single_p): ... here. (is_gimple_cast): Remove. (gimple_assign_rhs_code): Simplify. * gimple-fold.c (gimple_fold_builtin): Use CONVERT_EXPR_P instead of is_gimple_cast. * ipa-type-escape.c (look_for_casts): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167200 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r--gcc/gimple.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 150b836d55f..05f52318886 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -869,7 +869,6 @@ int gimple_call_arg_flags (const_gimple, unsigned);
void gimple_call_reset_alias_info (gimple);
bool gimple_assign_copy_p (gimple);
bool gimple_assign_ssa_name_copy_p (gimple);
-bool gimple_assign_single_p (gimple);
bool gimple_assign_unary_nop_p (gimple);
void gimple_set_bb (gimple, struct basic_block_def *);
void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
@@ -944,8 +943,6 @@ extern bool is_gimple_mem_rhs (tree);
/* Returns true iff T is a valid if-statement condition. */
extern bool is_gimple_condexpr (tree);
-/* Returns true iff T is a type conversion. */
-extern bool is_gimple_cast (tree);
/* Returns true iff T is a variable that does not need to live in memory. */
extern bool is_gimple_non_addressable (tree t);
@@ -1904,7 +1901,10 @@ gimple_assign_rhs_code (const_gimple gs)
enum tree_code code;
GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- code = gimple_expr_code (gs);
+ code = (enum tree_code) gs->gsbase.subcode;
+ /* While we initially set subcode to the TREE_CODE of the rhs for
+ GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
+ in sync when we rewrite stmts into SSA form or do SSA propagations. */
if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
code = TREE_CODE (gimple_assign_rhs1 (gs));
@@ -1933,6 +1933,19 @@ gimple_assign_rhs_class (const_gimple gs)
return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
}
+/* Return true if GS is an assignment with a singleton RHS, i.e.,
+ there is no operator associated with the assignment itself.
+ Unlike gimple_assign_copy_p, this predicate returns true for
+ any RHS operand, including those that perform an operation
+ and do not have the semantics of a copy, such as COND_EXPR. */
+
+static inline bool
+gimple_assign_single_p (gimple gs)
+{
+ return (is_gimple_assign (gs)
+ && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
+}
+
/* Return true if S is a type-cast assignment. */