return changed;
}
+/* Perform the minimal folding on statement STMT. Only operations like
+ *&x created by constant propagation are handled. The statement cannot
+ be replaced with a new one. */
+
+bool
+fold_stmt_inplace (tree stmt)
+{
+ tree old_stmt = stmt, rhs, new_rhs;
+ bool changed = false;
+
+ walk_tree (&stmt, fold_stmt_r, &changed, NULL);
+ gcc_assert (stmt == old_stmt);
+
+ rhs = get_rhs (stmt);
+ if (!rhs || rhs == stmt)
+ return changed;
+
+ new_rhs = fold (rhs);
+ if (new_rhs == rhs)
+ return changed;
+
+ changed |= set_rhs (&stmt, new_rhs);
+ gcc_assert (stmt == old_stmt);
+
+ return changed;
+}
\f
/* Convert EXPR into a GIMPLE value suitable for substitution on the
RHS of an assignment. Insert the necessary statements before