diff gcc/tree-ssa-ifcombine.c @ 36:855418dad1a3

gcc-4.4-20091020
author e075725
date Tue, 22 Dec 2009 21:19:31 +0900
parents a06113de4d67
children 77e2b8dfacca
line wrap: on
line diff
--- a/gcc/tree-ssa-ifcombine.c	Thu Sep 24 13:21:57 2009 +0900
+++ b/gcc/tree-ssa-ifcombine.c	Tue Dec 22 21:19:31 2009 +0900
@@ -151,7 +151,7 @@
     {
       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 @@
   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 @@
       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)