OSDN Git Service

PR debug/7055
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-operands.h
index 35d59a4..cdbc050 100644 (file)
@@ -1,11 +1,11 @@
 /* SSA operand management for trees.
-   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 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) any later
+Software Foundation; either version 3, or (at your option) any later
 version.
 
 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
@@ -14,9 +14,8 @@ 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 GCC_TREE_SSA_OPERANDS_H
 #define GCC_TREE_SSA_OPERANDS_H
@@ -58,7 +57,7 @@ typedef struct vuse_element_d
 
 typedef struct vuse_vec_d
 {
-  int num_vuse;
+  unsigned int num_vuse;
   vuse_element_t uses[1];
 } vuse_vec_t;
 typedef struct vuse_vec_d *vuse_vec_p;
@@ -70,23 +69,23 @@ typedef struct vuse_vec_d *vuse_vec_p;
 
 #ifdef ENABLE_CHECKING
 #define VUSE_VECT_ELEMENT(V,X)                                         \
-    (gcc_assert ((X) >= 0 && (X) < VUSE_VECT_NUM_ELEM (V)),            \
+    (gcc_assert (((unsigned int) (X)) < VUSE_VECT_NUM_ELEM (V)),       \
      VUSE_VECT_ELEMENT_NC (V,X))
 
 #define VUSE_ELEMENT_PTR(V,X)                                          \
-    (gcc_assert ((X) >= 0 && (X) < VUSE_VECT_NUM_ELEM (V)),            \
+    (gcc_assert (((unsigned int) (X)) < VUSE_VECT_NUM_ELEM (V)),       \
      VUSE_ELEMENT_PTR_NC (V, X))
 
 #define SET_VUSE_VECT_ELEMENT(V,X,N)                                   \
-    (gcc_assert ((X) >= 0 && (X) < VUSE_VECT_NUM_ELEM (V)),            \
+    (gcc_assert (((unsigned int) (X)) < VUSE_VECT_NUM_ELEM (V)),       \
      VUSE_VECT_ELEMENT_NC (V,X) = (N))
 
 #define SET_VUSE_ELEMENT_VAR(V,X,N)                                    \
-    (gcc_assert ((X) >= 0 && (X) < VUSE_VECT_NUM_ELEM (V)),            \
+    (gcc_assert (((unsigned int) (X)) < VUSE_VECT_NUM_ELEM (V)),       \
      VUSE_VECT_ELEMENT_NC ((V),(X)).use_var = (N))
 
 #define SET_VUSE_ELEMENT_PTR(V,X,N)                                    \
-    (gcc_assert ((X) >= 0 && (X) < VUSE_VECT_NUM_ELEM (V)),            \
+    (gcc_assert (((unsigned int) (X)) < VUSE_VECT_NUM_ELEM (V)),       \
      VUSE_ELEMENT_PTR_NC (V, X) = (N))
 #else
 #define VUSE_VECT_ELEMENT(V,X) VUSE_VECT_ELEMENT_NC(V,X)
@@ -124,6 +123,8 @@ struct ssa_operand_memory_d GTY((chain_next("%h.next")))
 struct ssa_operands GTY(()) {
    struct ssa_operand_memory_d *operand_memory;
    unsigned operand_memory_index;
+   /* Current size of the operand memory buffer.  */
+   unsigned int ssa_operand_mem_size;
 
    bool ops_active;
 
@@ -156,15 +157,7 @@ typedef struct stmt_operands_d *stmt_operands_p;
 #define SET_USE(USE, V)                set_ssa_use_from_ptr (USE, V)
 #define SET_DEF(DEF, V)                ((*(DEF)) = (V))
 
-#define USE_STMT(USE)          (USE)->stmt
-
-#define DEF_OPS(STMT)          (stmt_ann (STMT)->operands.def_ops)
-#define USE_OPS(STMT)          (stmt_ann (STMT)->operands.use_ops)
-#define VUSE_OPS(STMT)         (stmt_ann (STMT)->operands.vuse_ops)
-#define VDEF_OPS(STMT)         (stmt_ann (STMT)->operands.vdef_ops)
-
-#define LOADED_SYMS(STMT)      (stmt_ann (STMT)->operands.loads)
-#define STORED_SYMS(STMT)      (stmt_ann (STMT)->operands.stores)
+#define USE_STMT(USE)          (USE)->loc.stmt
 
 #define USE_OP_PTR(OP)         (&((OP)->use_ptr))
 #define USE_OP(OP)             (USE_FROM_PTR (USE_OP_PTR (OP)))
@@ -186,11 +179,11 @@ typedef struct stmt_operands_d *stmt_operands_p;
 #define VDEF_NUM(OP)           VUSE_VECT_NUM_ELEM ((OP)->usev)
 #define VDEF_VECT(OP)          &((OP)->usev)
 
-#define PHI_RESULT_PTR(PHI)    get_phi_result_ptr (PHI)
+#define PHI_RESULT_PTR(PHI)    gimple_phi_result_ptr (PHI)
 #define PHI_RESULT(PHI)                DEF_FROM_PTR (PHI_RESULT_PTR (PHI))
 #define SET_PHI_RESULT(PHI, V) SET_DEF (PHI_RESULT_PTR (PHI), (V))
 
-#define PHI_ARG_DEF_PTR(PHI, I)        get_phi_arg_def_ptr ((PHI), (I))
+#define PHI_ARG_DEF_PTR(PHI, I)        gimple_phi_arg_imm_use_ptr ((PHI), (I))
 #define PHI_ARG_DEF(PHI, I)    USE_FROM_PTR (PHI_ARG_DEF_PTR ((PHI), (I)))
 #define SET_PHI_ARG_DEF(PHI, I, V)                                     \
                                SET_USE (PHI_ARG_DEF_PTR ((PHI), (I)), (V))
@@ -201,17 +194,15 @@ typedef struct stmt_operands_d *stmt_operands_p;
 #define PHI_ARG_INDEX_FROM_USE(USE)   phi_arg_index_from_use (USE)
 
 
-extern struct voptype_d *realloc_vdef (struct voptype_d *, int);
-extern struct voptype_d *realloc_vuse (struct voptype_d *, int);
-
 extern void init_ssa_operands (void);
 extern void fini_ssa_operands (void);
-extern void free_ssa_operands (stmt_operands_p);
-extern void update_stmt_operands (tree);
+extern void update_stmt_operands (gimple);
+extern void free_stmt_operands (gimple);
 extern bool verify_imm_links (FILE *f, tree var);
 
-extern void copy_virtual_operands (tree, tree);
-extern void create_ssa_artificial_load_stmt (tree, tree);
+extern void copy_virtual_operands (gimple, gimple);
+extern int operand_build_cmp (const void *, const void *);
+extern void create_ssa_artificial_load_stmt (gimple, gimple, bool);
 
 extern void dump_immediate_uses (FILE *file);
 extern void dump_immediate_uses_for (FILE *file, tree var);
@@ -222,10 +213,10 @@ extern void debug_decl_set (bitmap);
 
 extern bool ssa_operands_active (void);
 
-extern void add_to_addressable_set (tree, bitmap *);
-extern void push_stmt_changes (tree *);
-extern void pop_stmt_changes (tree *);
-extern void discard_stmt_changes (tree *);
+extern void push_stmt_changes (gimple *);
+extern void pop_stmt_changes (gimple *);
+extern void discard_stmt_changes (gimple *);
+void add_to_addressable_set (tree, bitmap *);
 
 enum ssa_op_iter_type {
   ssa_op_iter_none = 0,
@@ -250,10 +241,10 @@ typedef struct ssa_operand_iterator_d
   enum ssa_op_iter_type iter_type;
   int phi_i;
   int num_phi;
-  tree phi_stmt;
+  gimple phi_stmt;
   bool done;
-  int vuse_index;
-  int mayuse_index;
+  unsigned int vuse_index;
+  unsigned int mayuse_index;
 } ssa_op_iter;
 
 /* These flags are used to determine which operands are returned during 
@@ -297,12 +288,12 @@ typedef struct ssa_operand_iterator_d
        DEFVAR = op_iter_next_def (&(ITER)))
 
 /* This macro executes a loop over the VDEF operands of STMT.  The def
-   and use for each VDEF is returned in DEFVAR and USEVAR
+   and use vector for each VDEF is returned in DEFVAR and USEVECT
    ITER is an ssa_op_iter structure used to control the loop.  */
-#define FOR_EACH_SSA_VDEF_OPERAND(DEFVAR, USEVAR, STMT, ITER)  \
-  for (op_iter_init_vdef (&(ITER), STMT, &(USEVAR), &(DEFVAR));        \
+#define FOR_EACH_SSA_VDEF_OPERAND(DEFVAR, USEVECT, STMT, ITER) \
+  for (op_iter_init_vdef (&(ITER), STMT, &(USEVECT), &(DEFVAR));       \
        !op_iter_done (&(ITER));                                        \
-       op_iter_next_vdef (&(USEVAR), &(DEFVAR), &(ITER)))
+       op_iter_next_vdef (&(USEVECT), &(DEFVAR), &(ITER)))
 
 /* This macro will execute a loop over all the arguments of a PHI which
    match FLAGS.   A use_operand_p is always returned via USEVAR.  FLAGS
@@ -316,7 +307,7 @@ typedef struct ssa_operand_iterator_d
 /* This macro will execute a loop over a stmt, regardless of whether it is
    a real stmt or a PHI node, looking at the USE nodes matching FLAGS.  */
 #define FOR_EACH_PHI_OR_STMT_USE(USEVAR, STMT, ITER, FLAGS)    \
-  for ((USEVAR) = (TREE_CODE (STMT) == PHI_NODE                \
+  for ((USEVAR) = (gimple_code (STMT) == GIMPLE_PHI            \
                   ? op_iter_init_phiuse (&(ITER), STMT, FLAGS) \
                   : op_iter_init_use (&(ITER), STMT, FLAGS));  \
        !op_iter_done (&(ITER));                                        \
@@ -325,7 +316,7 @@ typedef struct ssa_operand_iterator_d
 /* This macro will execute a loop over a stmt, regardless of whether it is
    a real stmt or a PHI node, looking at the DEF nodes matching FLAGS.  */
 #define FOR_EACH_PHI_OR_STMT_DEF(DEFVAR, STMT, ITER, FLAGS)    \
-  for ((DEFVAR) = (TREE_CODE (STMT) == PHI_NODE                \
+  for ((DEFVAR) = (gimple_code (STMT) == GIMPLE_PHI            \
                   ? op_iter_init_phidef (&(ITER), STMT, FLAGS) \
                   : op_iter_init_def (&(ITER), STMT, FLAGS));  \
        !op_iter_done (&(ITER));                                        \
@@ -355,8 +346,4 @@ typedef struct ssa_operand_iterator_d
 /* This macro counts the number of operands in STMT matching FLAGS.  */
 #define NUM_SSA_OPERANDS(STMT, FLAGS)  num_ssa_operands (STMT, FLAGS)
 
-extern tree get_mpt_for (tree);
-extern void dump_memory_partitions (FILE *);
-extern void debug_memory_partitions (void);
-
 #endif  /* GCC_TREE_SSA_OPERANDS_H  */