+/* Check whether T is a simple boolean variable or a SSA name
+ set by a comparison operator in the same basic block. */
+static bool
+ccmp_tree_comparison_p (tree t, basic_block bb)
+{
+ gimple *g = get_gimple_for_ssa_name (t);
+ tree_code tcode;
+
+ /* If we have a boolean variable allow it and generate a compare
+ to zero reg when expanding. */
+ if (!g)
+ return (TREE_CODE (TREE_TYPE (t)) == BOOLEAN_TYPE);
+
+ /* Check to see if SSA name is set by a comparison operator in
+ the same basic block. */
+ if (!is_gimple_assign (g))
+ return false;
+ if (bb != gimple_bb (g))
+ return false;
+ tcode = gimple_assign_rhs_code (g);
+ return TREE_CODE_CLASS (tcode) == tcc_comparison;
+}
+