OSDN Git Service

* config/sparc/linux.h (NO_PROFILE_COUNTERS): Undef before
[pf3gnuchains/gcc-fork.git] / gcc / tree-flow-inline.h
index e2b4f97..a41ee9a 100644 (file)
@@ -1,12 +1,12 @@
 /* Inline functions for tree-flow.h
-   Copyright (C) 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
    Contributed by Diego Novillo <dnovillo@redhat.com>
 
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GCC is distributed in the hope that it will be useful,
@@ -15,9 +15,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING.  If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 #ifndef _TREE_FLOW_INLINE_H
 #define _TREE_FLOW_INLINE_H 1
@@ -30,14 +29,14 @@ Boston, MA 02110-1301, USA.  */
    infrastructure is initialized.  Check for presence of the datastructures
    at first place.  */
 static inline bool
-gimple_in_ssa_p (struct function *fun)
+gimple_in_ssa_p (const struct function *fun)
 {
   return fun && fun->gimple_df && fun->gimple_df->in_ssa_p;
 }
 
 /* 'true' after aliases have been computed (see compute_may_aliases).  */
 static inline bool
-gimple_aliases_computed_p (struct function *fun)
+gimple_aliases_computed_p (const struct function *fun)
 {
   gcc_assert (fun && fun->gimple_df);
   return fun->gimple_df->aliases_computed_p;
@@ -51,7 +50,7 @@ gimple_aliases_computed_p (struct function *fun)
    call-clobbered variables are addressable (e.g., a local static
    variable).  */
 static inline bitmap
-gimple_addressable_vars (struct function *fun)
+gimple_addressable_vars (const struct function *fun)
 {
   gcc_assert (fun && fun->gimple_df);
   return fun->gimple_df->addressable_vars;
@@ -60,7 +59,7 @@ gimple_addressable_vars (struct function *fun)
 /* Call clobbered variables in the function.  If bit I is set, then
    REFERENCED_VARS (I) is call-clobbered.  */
 static inline bitmap
-gimple_call_clobbered_vars (struct function *fun)
+gimple_call_clobbered_vars (const struct function *fun)
 {
   gcc_assert (fun && fun->gimple_df);
   return fun->gimple_df->call_clobbered_vars;
@@ -68,7 +67,7 @@ gimple_call_clobbered_vars (struct function *fun)
 
 /* Array of all variables referenced in the function.  */
 static inline htab_t
-gimple_referenced_vars (struct function *fun)
+gimple_referenced_vars (const struct function *fun)
 {
   if (!fun->gimple_df)
     return NULL;
@@ -77,7 +76,7 @@ gimple_referenced_vars (struct function *fun)
 
 /* Artificial variable used to model the effects of function calls.  */
 static inline tree
-gimple_global_var (struct function *fun)
+gimple_global_var (const struct function *fun)
 {
   gcc_assert (fun && fun->gimple_df);
   return fun->gimple_df->global_var;
@@ -86,11 +85,20 @@ gimple_global_var (struct function *fun)
 /* Artificial variable used to model the effects of nonlocal
    variables.  */
 static inline tree
-gimple_nonlocal_all (struct function *fun)
+gimple_nonlocal_all (const struct function *fun)
 {
   gcc_assert (fun && fun->gimple_df);
   return fun->gimple_df->nonlocal_all;
 }
+
+/* Hashtable of variables annotations.  Used for static variables only;
+   local variables have direct pointer in the tree node.  */
+static inline htab_t
+gimple_var_anns (const struct function *fun)
+{
+  return fun->gimple_df->var_anns;
+}
+
 /* Initialize the hashtable iterator HTI to point to hashtable TABLE */
 
 static inline void *
@@ -115,7 +123,7 @@ first_htab_element (htab_iterator *hti, htab_t table)
    or NULL if we have  reached the end.  */
 
 static inline bool
-end_htab_p (htab_iterator *hti)
+end_htab_p (const htab_iterator *hti)
 {
   if (hti->slot >= hti->limit)
     return true;
@@ -143,20 +151,15 @@ next_htab_element (htab_iterator *hti)
 static inline tree
 first_referenced_var (referenced_var_iterator *iter)
 {
-  struct int_tree_map *itm;
-  itm = (struct int_tree_map *) first_htab_element (&iter->hti,
-                                                    gimple_referenced_vars
-                                                   (cfun));
-  if (!itm) 
-    return NULL;
-  return itm->to;
+  return (tree) first_htab_element (&iter->hti,
+                                   gimple_referenced_vars (cfun));
 }
 
 /* Return true if we have hit the end of the referenced variables ITER is
    iterating through.  */
 
 static inline bool
-end_referenced_vars_p (referenced_var_iterator *iter)
+end_referenced_vars_p (const referenced_var_iterator *iter)
 {
   return end_htab_p (&iter->hti);
 }
@@ -167,11 +170,7 @@ end_referenced_vars_p (referenced_var_iterator *iter)
 static inline tree
 next_referenced_var (referenced_var_iterator *iter)
 {
-  struct int_tree_map *itm;
-  itm = (struct int_tree_map *) next_htab_element (&iter->hti);
-  if (!itm) 
-    return NULL;
-  return itm->to;
+  return (tree) next_htab_element (&iter->hti);
 } 
 
 /* Fill up VEC with the variables in the referenced vars hashtable.  */
@@ -189,15 +188,30 @@ fill_referenced_var_vec (VEC (tree, heap) **vec)
 /* Return the variable annotation for T, which must be a _DECL node.
    Return NULL if the variable annotation doesn't already exist.  */
 static inline var_ann_t
-var_ann (tree t)
+var_ann (const_tree t)
 {
-  gcc_assert (t);
-  gcc_assert (DECL_P (t));
-  gcc_assert (TREE_CODE (t) != FUNCTION_DECL);
-  gcc_assert (!t->base.ann
-             || t->base.ann->common.type == VAR_ANN);
+  var_ann_t ann;
 
-  return (var_ann_t) t->base.ann;
+  if (!MTAG_P (t)
+      && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
+    {
+      struct static_var_ann_d *sann
+        = ((struct static_var_ann_d *)
+          htab_find_with_hash (gimple_var_anns (cfun), t, DECL_UID (t)));
+      if (!sann)
+       return NULL;
+      ann = &sann->ann;
+    }
+  else
+    {
+      if (!t->base.ann)
+       return NULL;
+      ann = (var_ann_t) t->base.ann;
+    }
+
+  gcc_assert (ann->common.type == VAR_ANN);
+
+  return ann;
 }
 
 /* Return the variable annotation for T, which must be a _DECL node.
@@ -212,7 +226,7 @@ get_var_ann (tree var)
 /* Return the function annotation for T, which must be a FUNCTION_DECL node.
    Return NULL if the function annotation doesn't already exist.  */
 static inline function_ann_t
-function_ann (tree t)
+function_ann (const_tree t)
 {
   gcc_assert (t);
   gcc_assert (TREE_CODE (t) == FUNCTION_DECL);
@@ -264,6 +278,41 @@ get_stmt_ann (tree stmt)
   return (ann) ? ann : create_stmt_ann (stmt);
 }
 
+/* Set the uid of all non phi function statements.  */
+static inline void
+set_gimple_stmt_uid (tree stmt, unsigned int uid)
+{
+  get_stmt_ann (stmt)->uid = uid;
+}
+
+/* Get the uid of all non phi function statements.  */
+static inline unsigned int
+gimple_stmt_uid (tree stmt)
+{
+  return get_stmt_ann (stmt)->uid;
+}
+
+/* Get the number of the next statement uid to be allocated.  */
+static inline unsigned int
+gimple_stmt_max_uid (struct function *fn)
+{
+  return fn->last_stmt_uid;
+}
+
+/* Set the number of the next statement uid to be allocated.  */
+static inline void
+set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid)
+{
+  fn->last_stmt_uid = maxid;
+}
+
+/* Set the number of the next statement uid to be allocated.  */
+static inline unsigned int
+inc_gimple_stmt_max_uid (struct function *fn)
+{
+  return fn->last_stmt_uid++;
+}
+
 /* Return the annotation type for annotation ANN.  */
 static inline enum tree_ann_type
 ann_type (tree_ann_t ann)
@@ -284,19 +333,18 @@ bb_for_stmt (tree t)
   return ann ? ann->bb : NULL;
 }
 
-/* Return the may_aliases varray for variable VAR, or NULL if it has
+/* Return the may_aliases bitmap for variable VAR, or NULL if it has
    no may aliases.  */
-static inline VEC(tree, gc) *
-may_aliases (tree var)
+static inline bitmap
+may_aliases (const_tree var)
 {
-  var_ann_t ann = var_ann (var);
-  return ann ? ann->may_aliases : NULL;
+  return MTAG_ALIASES (var);
 }
 
 /* Return the line number for EXPR, or return -1 if we have no line
    number information for it.  */
 static inline int
-get_lineno (tree expr)
+get_lineno (const_tree expr)
 {
   if (expr == NULL_TREE)
     return -1;
@@ -310,24 +358,6 @@ get_lineno (tree expr)
   return EXPR_LINENO (expr);
 }
 
-/* Return the file name for EXPR, or return "???" if we have no
-   filename information.  */
-static inline const char *
-get_filename (tree expr)
-{
-  const char *filename;
-  if (expr == NULL_TREE)
-    return "???";
-
-  if (TREE_CODE (expr) == COMPOUND_EXPR)
-    expr = TREE_OPERAND (expr, 0);
-
-  if (EXPR_HAS_LOCATION (expr) && (filename = EXPR_FILENAME (expr)))
-    return filename;
-  else
-    return "???";
-}
-
 /* Return true if T is a noreturn call.  */
 static inline bool
 noreturn_call_p (tree t)
@@ -479,7 +509,7 @@ relink_imm_use_stmt (ssa_use_operand_t *linknode, ssa_use_operand_t *old, tree s
 
 /* Return true is IMM has reached the end of the immediate use list.  */
 static inline bool
-end_readonly_imm_use_p (imm_use_iterator *imm)
+end_readonly_imm_use_p (const imm_use_iterator *imm)
 {
   return (imm->imm_use == imm->end_p);
 }
@@ -507,8 +537,8 @@ next_readonly_imm_use (imm_use_iterator *imm)
   use_operand_p old = imm->imm_use;
 
 #ifdef ENABLE_CHECKING
-  /* If this assertion fails, it indicates the 'next' pointer has changed 
-     since we the last bump.  This indicates that the list is being modified
+  /* If this assertion fails, it indicates the 'next' pointer has changed
+     since the last bump.  This indicates that the list is being modified
      via stmt changes, or SET_USE, or somesuch thing, and you need to be
      using the SAFE version of the iterator.  */
   gcc_assert (imm->iter_node.next == old->next);
@@ -517,50 +547,35 @@ next_readonly_imm_use (imm_use_iterator *imm)
 
   imm->imm_use = old->next;
   if (end_readonly_imm_use_p (imm))
-    return old;
+    return NULL_USE_OPERAND_P;
   return imm->imm_use;
 }
 
 /* Return true if VAR has no uses.  */
 static inline bool
-has_zero_uses (tree var)
+has_zero_uses (const_tree var)
 {
-  ssa_use_operand_t *ptr;
-  ptr = &(SSA_NAME_IMM_USE_NODE (var));
+  const ssa_use_operand_t *const ptr = &(SSA_NAME_IMM_USE_NODE (var));
   /* A single use means there is no items in the list.  */
   return (ptr == ptr->next);
 }
 
 /* Return true if VAR has a single use.  */
 static inline bool
-has_single_use (tree var)
+has_single_use (const_tree var)
 {
-  ssa_use_operand_t *ptr;
-  ptr = &(SSA_NAME_IMM_USE_NODE (var));
+  const ssa_use_operand_t *const ptr = &(SSA_NAME_IMM_USE_NODE (var));
   /* A single use means there is one item in the list.  */
   return (ptr != ptr->next && ptr == ptr->next->next);
 }
 
 
-/* If VAR has only a single immediate use, return true.  */
-static inline bool
-single_imm_use_p (tree var)
-{
-  ssa_use_operand_t *ptr;
-
-  ptr = &(SSA_NAME_IMM_USE_NODE (var));
-  return (ptr != ptr->next && ptr == ptr->next->next);
-}
-
-
 /* If VAR has only a single immediate use, return true, and set USE_P and STMT
    to the use pointer and stmt of occurrence.  */
 static inline bool
-single_imm_use (tree var, use_operand_p *use_p, tree *stmt)
+single_imm_use (const_tree var, use_operand_p *use_p, tree *stmt)
 {
-  ssa_use_operand_t *ptr;
-
-  ptr = &(SSA_NAME_IMM_USE_NODE (var));
+  const ssa_use_operand_t *const ptr = &(SSA_NAME_IMM_USE_NODE (var));
   if (ptr != ptr->next && ptr == ptr->next->next)
     {
       *use_p = ptr->next;
@@ -574,27 +589,18 @@ single_imm_use (tree var, use_operand_p *use_p, tree *stmt)
 
 /* Return the number of immediate uses of VAR.  */
 static inline unsigned int
-num_imm_uses (tree var)
+num_imm_uses (const_tree var)
 {
-  ssa_use_operand_t *ptr, *start;
-  unsigned int num;
+  const ssa_use_operand_t *const start = &(SSA_NAME_IMM_USE_NODE (var));
+  const ssa_use_operand_t *ptr;
+  unsigned int num = 0;
 
-  start = &(SSA_NAME_IMM_USE_NODE (var));
-  num = 0;
   for (ptr = start->next; ptr != start; ptr = ptr->next)
      num++;
 
   return num;
 }
 
-/* Return true if VAR has no immediate uses.  */
-static inline bool
-zero_imm_uses_p (tree var)
-{
-  ssa_use_operand_t *ptr = &(SSA_NAME_IMM_USE_NODE (var));
-  return (ptr == ptr->next);
-}
-
 /* Return the tree pointer to by USE.  */ 
 static inline tree
 get_use_from_ptr (use_operand_p use)
@@ -636,9 +642,21 @@ addresses_taken (tree stmt)
 /* Return the PHI nodes for basic block BB, or NULL if there are no
    PHI nodes.  */
 static inline tree
-phi_nodes (basic_block bb)
+phi_nodes (const_basic_block bb)
+{
+  gcc_assert (!(bb->flags & BB_RTL));
+  if (!bb->il.tree)
+    return NULL;
+  return bb->il.tree->phi_nodes;
+}
+
+/* Return pointer to the list of PHI nodes for basic block BB.  */
+
+static inline tree *
+phi_nodes_ptr (basic_block bb)
 {
-  return bb->phi_nodes;
+  gcc_assert (!(bb->flags & BB_RTL));
+  return &bb->il.tree->phi_nodes;
 }
 
 /* Set list of phi nodes of a basic block BB to L.  */
@@ -648,7 +666,8 @@ set_phi_nodes (basic_block bb, tree l)
 {
   tree phi;
 
-  bb->phi_nodes = l;
+  gcc_assert (!(bb->flags & BB_RTL));
+  bb->il.tree->phi_nodes = l;
   for (phi = l; phi; phi = PHI_CHAIN (phi))
     set_bb_for_stmt (phi, bb);
 }
@@ -693,30 +712,16 @@ set_is_used (tree var)
   ann->used = 1;
 }
 
-/* Return true if T is an executable statement.  */
-static inline bool
-is_exec_stmt (tree t)
-{
-  return (t && !IS_EMPTY_STMT (t) && t != error_mark_node);
-}
 
+/* Return true if T (assumed to be a DECL) is a global variable.  */
 
-/* Return true if this stmt can be the target of a control transfer stmt such
-   as a goto.  */
 static inline bool
-is_label_stmt (tree t)
-{
-  if (t)
-    switch (TREE_CODE (t))
-      {
-       case LABEL_DECL:
-       case LABEL_EXPR:
-       case CASE_LABEL_EXPR:
-         return true;
-       default:
-         return false;
-      }
-  return false;
+is_global_var (const_tree t)
+{
+  if (MTAG_P (t))
+    return (TREE_STATIC (t) || MTAG_GLOBAL (t));
+  else
+    return (TREE_STATIC (t) || DECL_EXTERNAL (t));
 }
 
 /* PHI nodes should contain only ssa_names and invariants.  A test
@@ -724,7 +729,7 @@ is_label_stmt (tree t)
    slip in in the meantime.  */
 
 static inline bool
-phi_ssa_name_p (tree t)
+phi_ssa_name_p (const_tree t)
 {
   if (TREE_CODE (t) == SSA_NAME)
     return true;
@@ -736,20 +741,37 @@ phi_ssa_name_p (tree t)
 
 /*  -----------------------------------------------------------------------  */
 
+/* Returns the list of statements in BB.  */
+
+static inline tree
+bb_stmt_list (const_basic_block bb)
+{
+  gcc_assert (!(bb->flags & BB_RTL));
+  return bb->il.tree->stmt_list;
+}
+
+/* Sets the list of statements in BB to LIST.  */
+
+static inline void
+set_bb_stmt_list (basic_block bb, tree list)
+{
+  gcc_assert (!(bb->flags & BB_RTL));
+  bb->il.tree->stmt_list = list;
+}
+
 /* Return a block_stmt_iterator that points to beginning of basic
    block BB.  */
 static inline block_stmt_iterator
 bsi_start (basic_block bb)
 {
   block_stmt_iterator bsi;
-  if (bb->stmt_list)
-    bsi.tsi = tsi_start (bb->stmt_list);
-  else
+  if (bb->index < NUM_FIXED_BLOCKS)
     {
-      gcc_assert (bb->index < NUM_FIXED_BLOCKS);
       bsi.tsi.ptr = NULL;
       bsi.tsi.container = NULL;
     }
+  else
+    bsi.tsi = tsi_start (bb_stmt_list (bb));
   bsi.bb = bb;
   return bsi;
 }
@@ -774,14 +796,14 @@ static inline block_stmt_iterator
 bsi_last (basic_block bb)
 {
   block_stmt_iterator bsi;
-  if (bb->stmt_list)
-    bsi.tsi = tsi_last (bb->stmt_list);
-  else
+
+  if (bb->index < NUM_FIXED_BLOCKS)
     {
-      gcc_assert (bb->index < NUM_FIXED_BLOCKS);
       bsi.tsi.ptr = NULL;
       bsi.tsi.container = NULL;
     }
+  else
+    bsi.tsi = tsi_last (bb_stmt_list (bb));
   bsi.bb = bb;
   return bsi;
 }
@@ -861,46 +883,21 @@ memory_partition (tree sym)
   return tag;
 }
 
-
-/* Set MPT to be the memory partition associated with symbol SYM.  */
-
-static inline void
-set_memory_partition (tree sym, tree mpt)
-{
-#if defined ENABLE_CHECKING
-  if (mpt)
-    gcc_assert (TREE_CODE (mpt) == MEMORY_PARTITION_TAG
-               && !is_gimple_reg (sym));
-#endif
-  var_ann (sym)->mpt = mpt;
-  if (mpt)
-    {
-      bitmap_set_bit (MPT_SYMBOLS (mpt), DECL_UID (sym));
-
-      /* MPT inherits the call-clobbering attributes from SYM.  */
-      if (is_call_clobbered (sym))
-       {
-         MTAG_GLOBAL (mpt) = 1;
-         mark_call_clobbered (mpt, ESCAPE_IS_GLOBAL);
-       }
-    }
-}
-
 /* Return true if NAME is a memory factoring SSA name (i.e., an SSA
    name for a memory partition.  */
 
 static inline bool
-factoring_name_p (tree name)
+factoring_name_p (const_tree name)
 {
   return TREE_CODE (SSA_NAME_VAR (name)) == MEMORY_PARTITION_TAG;
 }
 
 /* Return true if VAR is a clobbered by function calls.  */
 static inline bool
-is_call_clobbered (tree var)
+is_call_clobbered (const_tree var)
 {
   if (!MTAG_P (var))
-    return DECL_CALL_CLOBBERED (var);
+    return var_ann (var)->call_clobbered;
   else
     return bitmap_bit_p (gimple_call_clobbered_vars (cfun), DECL_UID (var)); 
 }
@@ -911,7 +908,7 @@ mark_call_clobbered (tree var, unsigned int escape_type)
 {
   var_ann (var)->escape_mask |= escape_type;
   if (!MTAG_P (var))
-    DECL_CALL_CLOBBERED (var) = true;
+    var_ann (var)->call_clobbered = true;
   bitmap_set_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var));
 }
 
@@ -921,18 +918,21 @@ clear_call_clobbered (tree var)
 {
   var_ann_t ann = var_ann (var);
   ann->escape_mask = 0;
-  if (MTAG_P (var) && TREE_CODE (var) != STRUCT_FIELD_TAG)
+  if (MTAG_P (var))
     MTAG_GLOBAL (var) = 0;
   if (!MTAG_P (var))
-    DECL_CALL_CLOBBERED (var) = false;
+    var_ann (var)->call_clobbered = false;
   bitmap_clear_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var));
 }
 
 /* Return the common annotation for T.  Return NULL if the annotation
    doesn't already exist.  */
 static inline tree_ann_common_t
-tree_common_ann (tree t)
+tree_common_ann (const_tree t)
 {
+  /* Watch out static variables with unshared annotations.  */
+  if (DECL_P (t) && TREE_CODE (t) == VAR_DECL)
+    return &var_ann (t)->common;
   return &t->base.ann->common;
 }
 
@@ -952,7 +952,7 @@ get_tree_common_ann (tree t)
 
 /* Return true if PTR is finished iterating.  */
 static inline bool
-op_iter_done (ssa_op_iter *ptr)
+op_iter_done (const ssa_op_iter *ptr)
 {
   return ptr->done;
 }
@@ -1418,7 +1418,7 @@ op_iter_init_phidef (ssa_op_iter *ptr, tree phi, int flags)
 /* Return true is IMM has reached the end of the immediate use stmt list.  */
 
 static inline bool
-end_imm_use_stmt_p (imm_use_iterator *imm)
+end_imm_use_stmt_p (const imm_use_iterator *imm)
 {
   return (imm->imm_use == imm->end_p);
 }
@@ -1536,7 +1536,6 @@ next_imm_use_stmt (imm_use_iterator *imm)
 
   link_use_stmts_after (imm->imm_use, imm);
   return USE_STMT (imm->imm_use);
-
 }
 
 /* This routine will return the first use on the stmt IMM currently refers
@@ -1552,7 +1551,7 @@ first_imm_use_on_stmt (imm_use_iterator *imm)
 /*  Return TRUE if the last use on the stmt IMM refers to has been visited.  */
 
 static inline bool
-end_imm_use_on_stmt_p (imm_use_iterator *imm)
+end_imm_use_on_stmt_p (const imm_use_iterator *imm)
 {
   return (imm->imm_use == &(imm->iter_node));
 }
@@ -1575,13 +1574,13 @@ next_imm_use_on_stmt (imm_use_iterator *imm)
 /* Return true if VAR cannot be modified by the program.  */
 
 static inline bool
-unmodifiable_var_p (tree var)
+unmodifiable_var_p (const_tree var)
 {
   if (TREE_CODE (var) == SSA_NAME)
     var = SSA_NAME_VAR (var);
 
   if (MTAG_P (var))
-    return TREE_READONLY (var) && (TREE_STATIC (var) || MTAG_GLOBAL (var));
+    return false;
 
   return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var));
 }
@@ -1589,7 +1588,7 @@ unmodifiable_var_p (tree var)
 /* Return true if REF, an ARRAY_REF, has an INDIRECT_REF somewhere in it.  */
 
 static inline bool
-array_ref_contains_indirect_ref (tree ref)
+array_ref_contains_indirect_ref (const_tree ref)
 {
   gcc_assert (TREE_CODE (ref) == ARRAY_REF);
 
@@ -1604,7 +1603,7 @@ array_ref_contains_indirect_ref (tree ref)
    somewhere in it.  */
 
 static inline bool
-ref_contains_array_ref (tree ref)
+ref_contains_array_ref (const_tree ref)
 {
   gcc_assert (handled_component_p (ref));
 
@@ -1617,123 +1616,28 @@ ref_contains_array_ref (tree ref)
   return false;
 }
 
-/* Given a variable VAR, lookup and return a pointer to the list of
-   subvariables for it.  */
-
-static inline subvar_t *
-lookup_subvars_for_var (tree var)
-{
-  var_ann_t ann = var_ann (var);
-  gcc_assert (ann);
-  return &ann->subvars;
-}
-
-/* Given a variable VAR, return a linked list of subvariables for VAR, or
-   NULL, if there are no subvariables.  */
-
-static inline subvar_t
-get_subvars_for_var (tree var)
-{
-  subvar_t subvars;
-
-  gcc_assert (SSA_VAR_P (var));  
-  
-  if (TREE_CODE (var) == SSA_NAME)
-    subvars = *(lookup_subvars_for_var (SSA_NAME_VAR (var)));
-  else
-    subvars = *(lookup_subvars_for_var (var));
-  return subvars;
-}
-
-/* Return the subvariable of VAR at offset OFFSET.  */
-
-static inline tree
-get_subvar_at (tree var, unsigned HOST_WIDE_INT offset)
-{
-  subvar_t sv;
-
-  for (sv = get_subvars_for_var (var); sv; sv = sv->next)
-    if (SFT_OFFSET (sv->var) == offset)
-      return sv->var;
-
-  return NULL_TREE;
-}
-
-/* Return true if V is a tree that we can have subvars for.
-   Normally, this is any aggregate type.  Also complex
-   types which are not gimple registers can have subvars.  */
+/* Return true, if the two ranges [POS1, SIZE1] and [POS2, SIZE2]
+   overlap.  SIZE1 and/or SIZE2 can be (unsigned)-1 in which case the
+   range is open-ended.  Otherwise return false.  */
 
 static inline bool
-var_can_have_subvars (tree v)
-{
-  /* Volatile variables should never have subvars.  */
-  if (TREE_THIS_VOLATILE (v))
-    return false;
-
-  /* Non decls or memory tags can never have subvars.  */
-  if (!DECL_P (v) || MTAG_P (v))
-    return false;
-
-  /* Aggregates can have subvars.  */
-  if (AGGREGATE_TYPE_P (TREE_TYPE (v)))
+ranges_overlap_p (unsigned HOST_WIDE_INT pos1,
+                 unsigned HOST_WIDE_INT size1,
+                 unsigned HOST_WIDE_INT pos2,
+                 unsigned HOST_WIDE_INT size2)
+{
+  if (pos1 >= pos2
+      && (size2 == (unsigned HOST_WIDE_INT)-1
+         || pos1 < (pos2 + size2)))
     return true;
-
-  /* Complex types variables which are not also a gimple register can
-    have subvars. */
-  if (TREE_CODE (TREE_TYPE (v)) == COMPLEX_TYPE
-      && !DECL_GIMPLE_REG_P (v))
+  if (pos2 >= pos1
+      && (size1 == (unsigned HOST_WIDE_INT)-1
+         || pos2 < (pos1 + size1)))
     return true;
 
   return false;
 }
 
-  
-/* Return true if OFFSET and SIZE define a range that overlaps with some
-   portion of the range of SV, a subvar.  If there was an exact overlap,
-   *EXACT will be set to true upon return. */
-
-static inline bool
-overlap_subvar (unsigned HOST_WIDE_INT offset, unsigned HOST_WIDE_INT size,
-               tree sv,  bool *exact)
-{
-  /* There are three possible cases of overlap.
-     1. We can have an exact overlap, like so:   
-     |offset, offset + size             |
-     |sv->offset, sv->offset + sv->size |
-     
-     2. We can have offset starting after sv->offset, like so:
-     
-           |offset, offset + size              |
-     |sv->offset, sv->offset + sv->size  |
-
-     3. We can have offset starting before sv->offset, like so:
-     
-     |offset, offset + size    |
-       |sv->offset, sv->offset + sv->size|
-  */
-
-  if (exact)
-    *exact = false;
-  if (offset == SFT_OFFSET (sv) && size == SFT_SIZE (sv))
-    {
-      if (exact)
-       *exact = true;
-      return true;
-    }
-  else if (offset >= SFT_OFFSET (sv) 
-          && offset < (SFT_OFFSET (sv) + SFT_SIZE (sv)))
-    {
-      return true;
-    }
-  else if (offset < SFT_OFFSET (sv) 
-          && (size > SFT_OFFSET (sv) - offset))
-    {
-      return true;
-    }
-  return false;
-
-}
-
 /* Return the memory tag associated with symbol SYM.  */
 
 static inline tree
@@ -1793,8 +1697,42 @@ get_value_handle (tree expr)
 
 /* Accessor to tree-ssa-operands.c caches.  */
 static inline struct ssa_operands *
-gimple_ssa_operands (struct function *fun)
+gimple_ssa_operands (const struct function *fun)
 {
   return &fun->gimple_df->ssa_operands;
 }
+
+/* Map describing reference statistics for function FN.  */
+static inline struct mem_ref_stats_d *
+gimple_mem_ref_stats (const struct function *fn)
+{
+  return &fn->gimple_df->mem_ref_stats;
+}
+
+/* Given an edge_var_map V, return the PHI arg definition.  */
+
+static inline tree
+redirect_edge_var_map_def (edge_var_map *v)
+{
+  return v->def;
+}
+
+/* Given an edge_var_map V, return the PHI result.  */
+
+static inline tree
+redirect_edge_var_map_result (edge_var_map *v)
+{
+  return v->result;
+}
+
+
+/* Return an SSA_NAME node for variable VAR defined in statement STMT
+   in function cfun.  */
+
+static inline tree
+make_ssa_name (tree var, tree stmt)
+{
+  return make_ssa_name_fn (cfun, var, stmt);
+}
+
 #endif /* _TREE_FLOW_INLINE_H  */