+static bool
+fold_predicate_in (tree stmt)
+{
+ tree *pred_p = NULL;
+ bool modify_stmt_p = false;
+ tree val;
+
+ if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
+ && COMPARISON_CLASS_P (GIMPLE_STMT_OPERAND (stmt, 1)))
+ {
+ modify_stmt_p = true;
+ pred_p = &GIMPLE_STMT_OPERAND (stmt, 1);
+ }
+ else if (TREE_CODE (stmt) == COND_EXPR)
+ pred_p = &COND_EXPR_COND (stmt);
+ else
+ return false;
+
+ val = vrp_evaluate_conditional (*pred_p, stmt);
+ if (val)
+ {
+ if (modify_stmt_p)
+ val = fold_convert (TREE_TYPE (*pred_p), val);
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "Folding predicate ");
+ print_generic_expr (dump_file, *pred_p, 0);
+ fprintf (dump_file, " to ");
+ print_generic_expr (dump_file, val, 0);
+ fprintf (dump_file, "\n");
+ }
+
+ prop_stats.num_pred_folded++;
+ *pred_p = val;
+ return true;
+ }
+
+ return false;
+}
+
+
+/* Perform final substitution and folding of propagated values.
+
+ PROP_VALUE[I] contains the single value that should be substituted
+ at every use of SSA name N_I. If PROP_VALUE is NULL, no values are
+ substituted.
+
+ If USE_RANGES_P is true, statements that contain predicate
+ expressions are evaluated with a call to vrp_evaluate_conditional.
+ This will only give meaningful results when called from tree-vrp.c
+ (the information used by vrp_evaluate_conditional is built by the
+ VRP pass).
+
+ Return TRUE when something changed. */
+
+bool
+substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)