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(-)

diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 33a4f87..bd635c6 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,21 @@
 2014-10-24  David Malcolm  <dmalc...@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  <dmalc...@redhat.com>
+
        Introduce gimple_phi_iterator
 
        * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 9eb77e8..25dcad8 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -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;
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index ce23019..19f2c32 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -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;
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index 3bbbb67..f7e8566 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -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;
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 2e337e4..6ed41bd 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -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
diff --git a/gcc/tree-ssa-propagate.h b/gcc/tree-ssa-propagate.h
index 2d8d876..1e1a3a1 100644
--- a/gcc/tree-ssa-propagate.h
+++ b/gcc/tree-ssa-propagate.h
@@ -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);
 
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 2e19273..289f0ba 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -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);
-- 
1.8.5.3

Reply via email to