@@ -1,5 +1,21 @@
2014-10-24 David Malcolm <dmalcolm@redhat.com>
+ Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
+
+ * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
+ type of parameter from gimple to gimple_phi.
+
+ * tree-complex.c (complex_visit_phi): Update signature of callback
+ implementation accordingly.
+ * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
+ * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
+ * tree-vrp.c (vrp_visit_phi_node): Likewise.
+
+ * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
+ gimple_phi when invoking the ssa_prop_visit_phi callback.
+
+2014-10-24 David Malcolm <dmalcolm@redhat.com>
+
Introduce gimple_phi_iterator
* gimple-iterator.h (struct gimple_phi_iterator): New subclass of
@@ -399,7 +399,7 @@ complex_visit_stmt (gimple stmt, edge *taken_edge_p ATTRIBUTE_UNUSED,
/* Evaluate a PHI node against the complex lattice defined above. */
static enum ssa_prop_result
-complex_visit_phi (gimple phi)
+complex_visit_phi (gimple_phi phi)
{
complex_lattice_t new_l, old_l;
unsigned int ver;
@@ -1018,7 +1018,7 @@ ccp_lattice_meet (ccp_prop_value_t *val1, ccp_prop_value_t *val2)
of the PHI node that are incoming via executable edges. */
static enum ssa_prop_result
-ccp_visit_phi_node (gimple phi)
+ccp_visit_phi_node (gimple_phi phi)
{
unsigned i;
ccp_prop_value_t *old_val, new_val;
@@ -331,7 +331,7 @@ copy_prop_visit_stmt (gimple stmt, edge *taken_edge_p, tree *result_p)
set it to be the value of the LHS of PHI. */
static enum ssa_prop_result
-copy_prop_visit_phi_node (gimple phi)
+copy_prop_visit_phi_node (gimple_phi phi)
{
enum ssa_prop_result retval;
unsigned i;
@@ -324,7 +324,7 @@ simulate_stmt (gimple stmt)
if (gimple_code (stmt) == GIMPLE_PHI)
{
- val = ssa_prop_visit_phi (stmt);
+ val = ssa_prop_visit_phi (as_a <gimple_phi> (stmt));
output_name = gimple_phi_result (stmt);
}
else
@@ -63,7 +63,7 @@ enum ssa_prop_result {
/* Call-back functions used by the value propagation engine. */
typedef enum ssa_prop_result (*ssa_prop_visit_stmt_fn) (gimple, edge *, tree *);
-typedef enum ssa_prop_result (*ssa_prop_visit_phi_fn) (gimple);
+typedef enum ssa_prop_result (*ssa_prop_visit_phi_fn) (gimple_phi);
typedef bool (*ssa_prop_fold_stmt_fn) (gimple_stmt_iterator *gsi);
typedef tree (*ssa_prop_get_value_fn) (tree);
@@ -8467,7 +8467,7 @@ vrp_meet (value_range_t *vr0, value_range_t *vr1)
value ranges, set a new range for the LHS of PHI. */
static enum ssa_prop_result
-vrp_visit_phi_node (gimple phi)
+vrp_visit_phi_node (gimple_phi phi)
{
size_t i;
tree lhs = PHI_RESULT (phi);
This corresponds to: [PATCH 10/89] Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01216.html from the original 89-patch kit That earlier patch was approved by Jeff: > OK when prerequisites have gone in. in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00619.html gcc/ * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen type of parameter from gimple to gimple_phi. * tree-complex.c (complex_visit_phi): Update signature of callback implementation accordingly. * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise. * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise. * tree-vrp.c (vrp_visit_phi_node): Likewise. * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to gimple_phi when invoking the ssa_prop_visit_phi callback. --- gcc/ChangeLog.gimple-classes | 16 ++++++++++++++++ gcc/tree-complex.c | 2 +- gcc/tree-ssa-ccp.c | 2 +- gcc/tree-ssa-copy.c | 2 +- gcc/tree-ssa-propagate.c | 2 +- gcc/tree-ssa-propagate.h | 2 +- gcc/tree-vrp.c | 2 +- 7 files changed, 22 insertions(+), 6 deletions(-)