summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ifcombine.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-29 19:26:47 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-29 19:26:47 +0000
commitc4aa078796bd9c7237e0ac5ea4ab7553106f199d (patch)
tree98a5e7f47a887d71b7ce051eac4583deee5a6dac /gcc/tree-ssa-ifcombine.c
parente34f5cd313173ac0144aeb70ab96e50fc36605ba (diff)
downloadgcc-c4aa078796bd9c7237e0ac5ea4ab7553106f199d.tar.gz
2009-08-29 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 151199 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@151206 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ifcombine.c')
-rw-r--r--gcc/tree-ssa-ifcombine.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index 8cb9c1e4944..1d2d85b7a8f 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -151,7 +151,7 @@ get_name_for_bit_test (tree candidate)
{
gimple def_stmt = SSA_NAME_DEF_STMT (candidate);
if (is_gimple_assign (def_stmt)
- && gimple_assign_cast_p (def_stmt))
+ && CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)))
{
if (TYPE_PRECISION (TREE_TYPE (candidate))
<= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (def_stmt))))
@@ -162,21 +162,6 @@ get_name_for_bit_test (tree candidate)
return candidate;
}
-/* Helpers for recognize_single_bit_test defined mainly for source code
- formating. */
-
-static int
-operand_precision (tree t)
-{
- return TYPE_PRECISION (TREE_TYPE (t));
-}
-
-static bool
-integral_operand_p (tree t)
-{
- return INTEGRAL_TYPE_P (TREE_TYPE (t));
-}
-
/* Recognize a single bit test pattern in GIMPLE_COND and its defining
statements. Store the name being tested in *NAME and the bit
in *BIT. The GIMPLE_COND computes *NAME & (1 << *BIT).
@@ -212,15 +197,11 @@ recognize_single_bit_test (gimple cond, tree *name, tree *bit)
stmt = SSA_NAME_DEF_STMT (orig_name);
while (is_gimple_assign (stmt)
- && (gimple_assign_ssa_name_copy_p (stmt)
- || (gimple_assign_cast_p (stmt)
- && integral_operand_p (gimple_assign_lhs (stmt))
- && integral_operand_p (gimple_assign_rhs1 (stmt))
- && (operand_precision (gimple_assign_lhs (stmt))
- <= operand_precision (gimple_assign_rhs1 (stmt))))))
- {
- stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
- }
+ && ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
+ && (TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs (stmt)))
+ <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
+ || gimple_assign_ssa_name_copy_p (stmt)))
+ stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
/* If we found such, decompose it. */
if (is_gimple_assign (stmt)