diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-24 12:47:56 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-24 12:47:56 +0000 |
commit | aa834ebc50f9ad5428385675e6b337ee7f5b25da (patch) | |
tree | 5bf77ec7639aa0b5fc27763151dd1b71c3daae43 /gcc/gimple.c | |
parent | e9d79eef3ca6f45d535cff1b6579e4d33182eb56 (diff) | |
download | gcc-aa834ebc50f9ad5428385675e6b337ee7f5b25da.tar.gz |
2012-02-24 Richard Guenther <rguenther@suse.de>
PR middle-end/52361
* gimple.c (walk_gimple_op): Use predicates with less redundant
tests.
(is_gimple_reg_type): Move inline ...
* gimple.h (is_gimple_reg_type): ... here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184552 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index 805ad2d77b2..3876912e471 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1481,7 +1481,7 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op, tree lhs = gimple_assign_lhs (stmt); wi->val_only = (is_gimple_reg_type (TREE_TYPE (lhs)) && !is_gimple_reg (lhs)) - || !gimple_assign_single_p (stmt); + || gimple_assign_rhs_class (stmt) != GIMPLE_SINGLE_RHS; } for (i = 1; i < gimple_num_ops (stmt); i++) @@ -1497,11 +1497,14 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op, if (wi) { /* If the RHS has more than 1 operand, it is not appropriate - for the memory. */ - wi->val_only = !(is_gimple_mem_rhs (gimple_assign_rhs1 (stmt)) - || TREE_CODE (gimple_assign_rhs1 (stmt)) - == CONSTRUCTOR) - || !gimple_assign_single_p (stmt); + for the memory. + ??? A lhs always requires an lvalue, checking the val_only flag + does not make any sense, so we should be able to avoid computing + it here. */ + tree rhs1 = gimple_assign_rhs1 (stmt); + wi->val_only = !(is_gimple_mem_rhs (rhs1) + || TREE_CODE (rhs1) == CONSTRUCTOR) + || gimple_assign_rhs_class (stmt) != GIMPLE_SINGLE_RHS; wi->is_lhs = true; } @@ -2908,14 +2911,6 @@ is_gimple_id (tree t) || TREE_CODE (t) == STRING_CST); } -/* Return true if TYPE is a suitable type for a scalar register variable. */ - -bool -is_gimple_reg_type (tree type) -{ - return !AGGREGATE_TYPE_P (type); -} - /* Return true if T is a non-aggregate register variable. */ bool |