OSDN Git Service

PR c++/42844
[pf3gnuchains/gcc-fork.git] / gcc / tree-flow.h
index cec5ed7..bcbd7fb 100644 (file)
@@ -1,5 +1,5 @@
 /* Data and Control Flow Analysis for Trees.
-   Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
    Contributed by Diego Novillo <dnovillo@redhat.com>
 
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3.  If not see
 #define _TREE_FLOW_H 1
 
 #include "bitmap.h"
-#include "hard-reg-set.h"
+#include "sbitmap.h"
 #include "basic-block.h"
 #include "hashtab.h"
 #include "gimple.h"
@@ -53,16 +53,9 @@ struct GTY(()) gimple_df {
   /* Artificial variable used for the virtual operand FUD chain.  */
   tree vop;
 
-  /* Artificial variable used to model the effects of nonlocal
-     variables.  */
-  tree nonlocal_all;
-
   /* The PTA solution for the ESCAPED artificial variable.  */
   struct pt_solution escaped;
 
-  /* The PTA solution for the CALLUSED artificial variable.  */
-  struct pt_solution callused;
-
   /* A map of decls to artificial ssa-names that point to the partition
      of the decl.  */
   struct pointer_map_t * GTY((skip(""))) decls_to_pointers;
@@ -83,6 +76,9 @@ struct GTY(()) gimple_df {
   /* True if the code is in ssa form.  */
   unsigned int in_ssa_p : 1;
 
+  /* True if IPA points-to information was computed for this function.  */
+  unsigned int ipa_pta : 1;
+
   struct ssa_operands ssa_operands;
 };
 
@@ -110,7 +106,7 @@ typedef struct
 
 /*---------------------------------------------------------------------------
                      Attributes for SSA_NAMEs.
-  
+
   NOTE: These structures are stored in struct tree_ssa_name
   but are only used by the tree optimizers, so it makes better sense
   to declare them here to avoid recompiling unrelated files when
@@ -118,31 +114,14 @@ typedef struct
 ---------------------------------------------------------------------------*/
 
 /* Aliasing information for SSA_NAMEs representing pointer variables.  */
+
 struct GTY(()) ptr_info_def
 {
-  /* The points-to solution, TBAA-pruned if the pointer is dereferenced.  */
+  /* The points-to solution.  */
   struct pt_solution pt;
 };
 
 
-/*---------------------------------------------------------------------------
-                  Tree annotations stored in tree_base.ann
----------------------------------------------------------------------------*/
-enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, FUNCTION_ANN };
-
-struct GTY(()) tree_ann_common_d {
-  /* Annotation type.  */
-  enum tree_ann_type type;
-
-  /* Record EH region number into a statement tree created during RTL
-     expansion (see gimple_to_tree).  */
-  int rn;
-
-  /* Pointer to original GIMPLE statement.  Used during RTL expansion
-     (see gimple_to_tree).  */
-  gimple stmt;
-};
-
 /* It is advantageous to avoid things like life analysis for variables which
    do not need PHI nodes.  This enum describes whether or not a particular
    variable may need a PHI node.  */
@@ -153,7 +132,7 @@ enum need_phi_state {
      needs PHI nodes.  This is probably an overly conservative assumption.  */
   NEED_PHI_STATE_UNKNOWN,
 
-  /* This state indicates that we have seen one or more sets of the 
+  /* This state indicates that we have seen one or more sets of the
      variable in a single basic block and that the sets dominate all
      uses seen so far.  If after finding all definition and use sites
      we are still in this state, then the variable does not need any
@@ -192,8 +171,6 @@ enum noalias_state {
 
 
 struct GTY(()) var_ann_d {
-  struct tree_ann_common_d common;
-
   /* Used when building base variable structures in a var_map.  */
   unsigned base_var_processed : 1;
 
@@ -225,7 +202,7 @@ struct GTY(()) var_ann_d {
 
 
 /* Immediate use lists are used to directly access all uses for an SSA
-   name and get pointers to the statement for each use. 
+   name and get pointers to the statement for each use.
 
    The structure ssa_use_operand_d consists of PREV and NEXT pointers
    to maintain the list.  A USE pointer, which points to address where
@@ -247,7 +224,7 @@ struct GTY(()) var_ann_d {
    iterator manages this by inserting a marker node into the list
    immediately before the node currently being examined in the list.
    this marker node is uniquely identified by having null stmt *and* a
-   null use pointer.  
+   null use pointer.
 
    When iterating to the next use, the iteration routines check to see
    if the node after the marker has changed. if it has, then the node
@@ -276,19 +253,19 @@ typedef struct immediate_use_iterator_d
 /* Use this iterator when simply looking at stmts.  Adding, deleting or
    modifying stmts will cause this iterator to malfunction.  */
 
-#define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR)                      \
+#define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR)              \
   for ((DEST) = first_readonly_imm_use (&(ITER), (SSAVAR));    \
        !end_readonly_imm_use_p (&(ITER));                      \
-       (DEST) = next_readonly_imm_use (&(ITER)))
-  
+       (void) ((DEST) = next_readonly_imm_use (&(ITER))))
+
 /* Use this iterator to visit each stmt which has a use of SSAVAR.  */
 
 #define FOR_EACH_IMM_USE_STMT(STMT, ITER, SSAVAR)              \
   for ((STMT) = first_imm_use_stmt (&(ITER), (SSAVAR));                \
        !end_imm_use_stmt_p (&(ITER));                          \
-       (STMT) = next_imm_use_stmt (&(ITER)))
+       (void) ((STMT) = next_imm_use_stmt (&(ITER))))
 
-/* Use this to terminate the FOR_EACH_IMM_USE_STMT loop early.  Failure to 
+/* Use this to terminate the FOR_EACH_IMM_USE_STMT loop early.  Failure to
    do so will result in leaving a iterator marker node in the immediate
    use list, and nothing good will come from that.   */
 #define BREAK_FROM_IMM_USE_STMT(ITER)                          \
@@ -298,7 +275,7 @@ typedef struct immediate_use_iterator_d
    }
 
 
-/* Use this iterator in combination with FOR_EACH_IMM_USE_STMT to 
+/* Use this iterator in combination with FOR_EACH_IMM_USE_STMT to
    get access to each occurrence of ssavar on the stmt returned by
    that iterator..  for instance:
 
@@ -314,24 +291,14 @@ typedef struct immediate_use_iterator_d
 #define FOR_EACH_IMM_USE_ON_STMT(DEST, ITER)                   \
   for ((DEST) = first_imm_use_on_stmt (&(ITER));               \
        !end_imm_use_on_stmt_p (&(ITER));                       \
-       (DEST) = next_imm_use_on_stmt (&(ITER)))
+       (void) ((DEST) = next_imm_use_on_stmt (&(ITER))))
 
 
 
-union GTY((desc ("ann_type ((tree_ann_t)&%h)"))) tree_ann_d {
-  struct tree_ann_common_d GTY((tag ("TREE_ANN_COMMON"))) common;
-  struct var_ann_d GTY((tag ("VAR_ANN"))) vdecl;
-};
-
-typedef union tree_ann_d *tree_ann_t;
 typedef struct var_ann_d *var_ann_t;
-typedef struct tree_ann_common_d *tree_ann_common_t;
 
-static inline tree_ann_common_t tree_common_ann (const_tree);
-static inline tree_ann_common_t get_tree_common_ann (tree);
 static inline var_ann_t var_ann (const_tree);
 static inline var_ann_t get_var_ann (tree);
-static inline enum tree_ann_type ann_type (tree_ann_t);
 static inline void update_stmt (gimple);
 static inline int get_lineno (const_gimple);
 
@@ -353,7 +320,7 @@ static inline void set_phi_nodes (basic_block, gimple_seq);
                              Global declarations
 ---------------------------------------------------------------------------*/
 struct GTY(()) int_tree_map {
-  
+
   unsigned int uid;
   tree to;
 };
@@ -364,12 +331,11 @@ extern int int_tree_map_eq (const void *, const void *);
 extern unsigned int uid_decl_map_hash (const void *);
 extern int uid_decl_map_eq (const void *, const void *);
 
-typedef struct 
+typedef struct
 {
   htab_iterator hti;
 } referenced_var_iterator;
 
-
 /* This macro loops over all the referenced vars, one at a time, putting the
    current var in VAR.  Note:  You are not allowed to add referenced variables
    to the hashtable while using this macro.  Doing so may cause it to behave
@@ -378,26 +344,7 @@ typedef struct
 #define FOR_EACH_REFERENCED_VAR(VAR, ITER) \
   for ((VAR) = first_referenced_var (&(ITER)); \
        !end_referenced_vars_p (&(ITER)); \
-       (VAR) = next_referenced_var (&(ITER))) 
-
-
-typedef struct
-{
-  int i;
-} safe_referenced_var_iterator;
-
-/* This macro loops over all the referenced vars, one at a time, putting the
-   current var in VAR.  You are allowed to add referenced variables during the
-   execution of this macro, however, the macro will not iterate over them.  It
-   requires a temporary vector of trees, VEC, whose lifetime is controlled by
-   the caller.  The purpose of the vector is to temporarily store the
-   referenced_variables hashtable so that adding referenced variables does not
-   affect the hashtable.  */
-
-#define FOR_EACH_REFERENCED_VAR_SAFE(VAR, VEC, ITER) \
-  for ((ITER).i = 0, fill_referenced_var_vec (&(VEC)); \
-       VEC_iterate (tree, (VEC), (ITER).i, (VAR)); \
-       (ITER).i++)
+       (VAR) = next_referenced_var (&(ITER)))
 
 extern tree referenced_var_lookup (unsigned int);
 extern bool referenced_var_check_and_insert (tree);
@@ -540,6 +487,7 @@ extern basic_block move_sese_region_to_fn (struct function *, basic_block,
                                           basic_block, tree);
 void remove_edge_and_dominated_blocks (edge);
 void mark_virtual_ops_in_bb (basic_block);
+bool tree_node_can_be_shared (tree);
 
 /* In tree-cfgcleanup.c  */
 extern bitmap cfgcleanup_altered_bbs;
@@ -554,7 +502,7 @@ extern const char *op_symbol_code (enum tree_code);
 /* In tree-dfa.c  */
 extern var_ann_t create_var_ann (tree);
 extern void renumber_gimple_stmt_uids (void);
-extern tree_ann_common_t create_tree_common_ann (tree);
+extern void renumber_gimple_stmt_uids_in_blocks (basic_block *, int);
 extern void dump_dfa_stats (FILE *);
 extern void debug_dfa_stats (void);
 extern void debug_referenced_vars (void);
@@ -579,7 +527,7 @@ extern void reserve_phi_args_for_new_edge (basic_block);
 extern void add_phi_node_to_bb (gimple phi, basic_block bb);
 extern gimple make_phi_node (tree var, int len);
 extern gimple create_phi_node (tree, basic_block);
-extern void add_phi_arg (gimple, tree, edge);
+extern void add_phi_arg (gimple, tree, edge, source_location);
 extern void remove_phi_args (edge);
 extern void remove_phi_node (gimple_stmt_iterator *, bool);
 extern void remove_phi_nodes (basic_block);
@@ -596,6 +544,7 @@ extern void record_vars (tree);
 extern bool block_may_fallthru (const_tree);
 extern bool gimple_seq_may_fallthru (gimple_seq);
 extern bool gimple_stmt_may_fallthru (gimple);
+extern bool gimple_check_call_args (gimple);
 
 
 /* In tree-ssa.c  */
@@ -604,6 +553,7 @@ extern bool gimple_stmt_may_fallthru (gimple);
 struct GTY(()) _edge_var_map {
   tree result;                 /* PHI result.  */
   tree def;                    /* PHI arg definition.  */
+  source_location locus;        /* PHI arg location.  */
 };
 typedef struct _edge_var_map edge_var_map;
 
@@ -614,7 +564,7 @@ DEF_VEC_ALLOC_O(edge_var_map, heap);
 typedef VEC(edge_var_map, heap) *edge_var_map_vector;
 
 extern void init_tree_ssa (struct function *);
-extern void redirect_edge_var_map_add (edge, tree, tree);
+extern void redirect_edge_var_map_add (edge, tree, tree, source_location);
 extern void redirect_edge_var_map_clear (edge);
 extern void redirect_edge_var_map_dup (edge, edge);
 extern edge_var_map_vector redirect_edge_var_map_vector (edge);
@@ -625,6 +575,8 @@ extern void flush_pending_stmts (edge);
 extern void verify_ssa (bool);
 extern void delete_tree_ssa (void);
 extern bool ssa_undefined_value_p (tree);
+extern void warn_uninit (tree, const char *, void *);
+extern unsigned int warn_uninitialized_vars (bool);
 extern void execute_update_addresses_taken (bool);
 
 /* Call-back function for walk_use_def_chains().  At each reaching
@@ -633,6 +585,9 @@ typedef bool (*walk_use_def_chains_fn) (tree, gimple, void *);
 
 extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
 
+void insert_debug_temps_for_defs (gimple_stmt_iterator *);
+void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
+void release_defs_bitset (bitmap toremove);
 
 /* In tree-into-ssa.c  */
 void update_ssa (unsigned);
@@ -665,16 +620,7 @@ extern void ssanames_print_statistics (void);
 #endif
 
 /* In tree-ssa-ccp.c  */
-bool fold_stmt (gimple_stmt_iterator *);
-bool fold_stmt_inplace (gimple);
-tree get_symbol_constant_value (tree);
 tree fold_const_aggregate_ref (tree);
-bool may_propagate_address_into_dereference (tree, tree);
-
-
-/* In tree-vrp.c  */
-tree vrp_evaluate_conditional (enum tree_code, tree, tree, gimple);
-bool simplify_stmt_using_ranges (gimple_stmt_iterator *);
 
 /* In tree-ssa-dom.c  */
 extern void dump_dominator_optimization_stats (FILE *);
@@ -739,14 +685,14 @@ basic_block *blocks_in_phiopt_order (void);
 
 /* In tree-ssa-loop*.c  */
 
-void tree_ssa_lim (void);
+unsigned int tree_ssa_lim (void);
 unsigned int tree_ssa_unswitch_loops (void);
 unsigned int canonicalize_induction_variables (void);
 unsigned int tree_unroll_loops_completely (bool, bool);
 unsigned int tree_ssa_prefetch_arrays (void);
 void tree_ssa_iv_optimize (void);
 unsigned tree_predictive_commoning (void);
-tree canonicalize_loop_ivs (struct loop *, htab_t, tree *);
+tree canonicalize_loop_ivs (struct loop *, tree *, bool);
 bool parallelize_loops (void);
 
 bool loop_only_exit_p (const struct loop *, const_edge);
@@ -756,6 +702,7 @@ tree find_loop_niter (struct loop *, edge *);
 tree loop_niter_by_eval (struct loop *, edge);
 tree find_loop_niter_by_eval (struct loop *, edge *);
 void estimate_numbers_of_iterations (void);
+bool array_at_struct_end_p (tree);
 bool scev_probably_wraps_p (tree, tree, gimple, struct loop *, bool);
 bool convert_affine_scev (struct loop *, tree, tree *, tree *, gimple, bool);
 
@@ -766,7 +713,7 @@ enum ev_direction scev_direction (const_tree);
 void free_numbers_of_iterations_estimates (void);
 void free_numbers_of_iterations_estimates_loop (struct loop *);
 void rewrite_into_loop_closed_ssa (bitmap, unsigned);
-void verify_loop_closed_ssa (void);
+void verify_loop_closed_ssa (bool);
 bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *);
 void create_iv (tree, tree, tree, struct loop *, gimple_stmt_iterator *, bool,
                tree *, tree *);
@@ -799,6 +746,9 @@ bool contains_abnormal_ssa_name_p (tree);
 bool stmt_dominates_stmt_p (gimple, gimple);
 void mark_virtual_ops_for_renaming (gimple);
 
+/* In tree-ssa-dce.c */
+void mark_virtual_phi_result_for_renaming (gimple);
+
 /* In tree-ssa-threadedge.c */
 extern void threadedge_initialize_values (void);
 extern void threadedge_finalize_values (void);
@@ -826,7 +776,6 @@ extern enum move_pos movement_possibility (gimple);
 char *get_lsm_tmp_name (tree, unsigned);
 
 /* In tree-flow-inline.h  */
-static inline bool is_call_clobbered (const_tree);
 static inline void set_is_used (tree);
 static inline bool unmodifiable_var_p (const_tree);
 static inline bool ref_contains_array_ref (const_tree);
@@ -834,6 +783,9 @@ static inline bool array_ref_contains_indirect_ref (const_tree);
 
 /* In tree-eh.c  */
 extern void make_eh_edges (gimple);
+extern bool make_eh_dispatch_edges (gimple);
+extern edge redirect_eh_edge (edge, basic_block);
+extern void redirect_eh_dispatch_edge (gimple, edge, basic_block);
 extern bool tree_could_trap_p (tree);
 extern bool operation_could_trap_helper_p (enum tree_code, bool, bool, bool,
                                           bool, tree, bool *);
@@ -842,16 +794,21 @@ extern bool stmt_could_throw_p (gimple);
 extern bool tree_could_throw_p (tree);
 extern bool stmt_can_throw_internal (gimple);
 extern bool stmt_can_throw_external (gimple);
-extern void add_stmt_to_eh_region (gimple, int);
-extern bool remove_stmt_from_eh_region (gimple);
+extern void add_stmt_to_eh_lp_fn (struct function *, gimple, int);
+extern void add_stmt_to_eh_lp (gimple, int);
+extern bool remove_stmt_from_eh_lp (gimple);
+extern bool remove_stmt_from_eh_lp_fn (struct function *, gimple);
+extern int lookup_stmt_eh_lp_fn (struct function *, gimple);
+extern int lookup_stmt_eh_lp (gimple);
+extern bool maybe_clean_eh_stmt_fn (struct function *, gimple);
+extern bool maybe_clean_eh_stmt (gimple);
 extern bool maybe_clean_or_replace_eh_stmt (gimple, gimple);
-extern void add_stmt_to_eh_region_fn (struct function *, gimple, int);
-extern bool remove_stmt_from_eh_region_fn (struct function *, gimple);
-extern int lookup_stmt_eh_region_fn (struct function *, gimple);
-extern int lookup_expr_eh_region (tree);
-extern int lookup_stmt_eh_region (gimple);
+extern bool maybe_duplicate_eh_stmt_fn (struct function *, gimple,
+                                       struct function *, gimple,
+                                       struct pointer_map_t *, int);
+extern bool maybe_duplicate_eh_stmt (gimple, gimple);
 extern bool verify_eh_edges (gimple);
-
+extern bool verify_eh_dispatch_edge (gimple);
 
 /* In tree-ssa-pre.c  */
 struct pre_expr_d;
@@ -875,7 +832,8 @@ extern void tree_check_data_deps (void);
 /* In tree-ssa-loop-ivopts.c  */
 bool expr_invariant_in_loop_p (struct loop *, tree);
 bool stmt_invariant_in_loop_p (struct loop *, gimple);
-bool multiplier_allowed_in_address_p (HOST_WIDE_INT, enum machine_mode);
+bool multiplier_allowed_in_address_p (HOST_WIDE_INT, enum machine_mode,
+                                     addr_space_t);
 unsigned multiply_by_cost (HOST_WIDE_INT, enum machine_mode, bool);
 
 /* In tree-ssa-threadupdate.c.  */
@@ -887,12 +845,12 @@ tree force_gimple_operand (tree, gimple_seq *, bool, tree);
 tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree,
                               bool, enum gsi_iterator_update);
 tree gimple_fold_indirect_ref (tree);
-void mark_addressable (tree);
 
 /* In tree-ssa-live.c */
 extern void remove_unused_locals (void);
 extern void dump_scope_blocks (FILE *, int);
 extern void debug_scope_blocks (int);
+extern void debug_scope_block (tree, int);
 
 /* In tree-ssa-address.c  */
 
@@ -904,9 +862,9 @@ struct mem_address
 };
 
 struct affine_tree_combination;
-tree create_mem_ref (gimple_stmt_iterator *, tree, 
-                    struct affine_tree_combination *, bool);
-rtx addr_for_mem_ref (struct mem_address *, bool);
+tree create_mem_ref (gimple_stmt_iterator *, tree,
+                    struct affine_tree_combination *, tree, bool);
+rtx addr_for_mem_ref (struct mem_address *, addr_space_t, bool);
 void get_address_description (tree, struct mem_address *);
 tree maybe_fold_tmr (tree);
 
@@ -918,6 +876,5 @@ unsigned int execute_fixup_cfg (void);
 void swap_tree_operands (gimple, tree *, tree *);
 
 int least_common_multiple (int, int);
-edge redirect_eh_edge (edge e, basic_block new_bb);
 
 #endif /* _TREE_FLOW_H  */