GCC Middle and Back End API Reference
tree-dfa.c File Reference

Data Structures

struct  dfa_stats_d
struct  numbered_tree_d


typedef struct numbered_tree_d numbered_tree


static void collect_dfa_stats (struct dfa_stats_d *)
void renumber_gimple_stmt_uids ()
void renumber_gimple_stmt_uids_in_blocks ()
void dump_variable ()
DEBUG_FUNCTION void debug_variable ()
void dump_dfa_stats ()
DEBUG_FUNCTION void debug_dfa_stats ()
static void collect_dfa_stats ()
tree ssa_default_def ()
void set_ssa_default_def ()
tree get_or_create_ssa_default_def ()
tree get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, HOST_WIDE_INT *psize, HOST_WIDE_INT *pmax_size)
tree get_addr_base_and_unit_offset ()
bool stmt_references_abnormal_ssa_name ()
static int compare_decls_by_uid ()
static tree dump_enumerated_decls_push ()
void dump_enumerated_decls ()

Typedef Documentation

Function Documentation

static void collect_dfa_stats ( struct dfa_stats_d )
   Local functions.  
static void collect_dfa_stats ( )
   Collect DFA statistics and store them in the structure pointed to by
     Walk all the statements in the function counting references.  
static int compare_decls_by_uid ( )
   Compare two declarations references by their DECL_UID / sequence number.
   Called via qsort.  
DEBUG_FUNCTION void debug_dfa_stats ( void  )
   Dump DFA statistics on stderr.  

References memset().

DEBUG_FUNCTION void debug_variable ( )
   Dump variable VAR and its may-aliases to stderr.  
void dump_dfa_stats ( )
   Dump various DFA statistics to FILE.  
void dump_enumerated_decls ( )
   Find all the declarations used by the current function, sort them by uid,
   and emit the sorted list.  Each declaration is tagged with a sequence
   number indicating when it was found during statement / tree walking,
   so that TDF_NOUID comparisons of anonymous declarations are still
   meaningful.  Where a declaration was encountered more than once, we
   emit only the sequence number of the first encounter.
   FILE is the dump file where to output the list and FLAGS is as in
static tree dump_enumerated_decls_push ( )
   Called via walk_gimple_stmt / walk_gimple_op by dump_enumerated_decls.  
void dump_variable ( )
   Dump variable VAR and its may-aliases to FILE.  
tree get_addr_base_and_unit_offset ( )
   Returns the base object and a constant BITS_PER_UNIT offset in *POFFSET that
   denotes the starting address of the memory access EXP.
   Returns NULL_TREE if the offset is not constant or any component
   is not BITS_PER_UNIT-aligned.  

References numbered_tree_d::num, and numbered_tree_d::t.

Referenced by build1_stat(), compute_antic(), make_fancy_name(), and strinfo_shared().

tree get_or_create_ssa_default_def ( )
   Retrieve or create a default definition for VAR.  

References HOST_WIDE_INT.

Referenced by insert_phi_nodes(), and load_assign_lhs_subreplacements().

tree get_ref_base_and_extent ( tree  exp,
HOST_WIDE_INT poffset,
HOST_WIDE_INT pmax_size 
   If EXP is a handled component reference for a structure, return the
   base variable.  The access range is delimited by bit positions *POFFSET and
   *POFFSET + *PMAX_SIZE.  The access size is *PSIZE bits.  If either
   *PSIZE or *PMAX_SIZE is -1, they could not be determined.  If *PSIZE
   and *PMAX_SIZE are equal, the access is non-variable.  
     First get the final access size from just the outermost expression.  
     Initially, maxsize is the same as the accessed element size.
     In the following it will only grow (or become -1).  
     Compute cumulative bit-offset for nested component-refs and array-refs,
     and find the ultimate containing object.  
                   If we had seen a variable array ref already and we just
                   referenced the last field of a struct or a union member
                   then we have to adjust maxsize by the padding at the end
                   of our field.  
                   We need to adjust maxsize to the whole structure bitsize.
                   But we can subtract any constant offset seen so far,
                   because that would get us out of the structure otherwise.  
               If the resulting bit-offset is constant, track it.  
                   An array ref with a constant index up in the structure
                   hierarchy will constrain the size of any variable array ref
                   lower in the access hierarchy.  
                   We need to adjust maxsize to the whole array bitsize.
                   But we can subtract any constant offset seen so far,
                   because that would get us outside of the array otherwise.  
                   Remember that we have seen an array ref with a variable
             Hand back the decl for MEM[&decl, off].  
             Hand back the decl for MEM[&decl, off].  
                 Via the variable index or index2 we can reach the
                 whole object.  
     We need to deal with variable arrays ending structures such as
       struct { int length; int a[1]; } x;           x.a[d]
       struct { struct { int a; int b; } a[1]; } x;  x.a[d].a
       struct { struct { int a[1]; } a[1]; } x;      x.a[0][d], x.a[d][0]
       struct { int len; union { int a[1]; struct X x; } u; } x; x.u.a[d]
     where we do not know maxsize for variable index accesses to
     the array.  The simplest way to conservatively deal with this
     is to punt in the case that offset + maxsize reaches the
     base type boundary.  This needs to include possible trailing padding
     that is there for alignment purposes.  
     In case of a decl or constant base object we can do better.  
         If maxsize is unknown adjust it according to the size of the
         base decl.  
         If maxsize is unknown adjust it according to the size of the
         base type constant.  
     ???  Due to negative offsets in ARRAY_REF we can end up with
     negative bit_offset here.  We might want to store a zero offset
     in this case.  

Referenced by fold_builtin_logarithm(), get_ssa_def_if_simple_copy(), parm_ref_data_preserved_p(), and vn_reference_lookup_3().

void renumber_gimple_stmt_uids ( void  )
void renumber_gimple_stmt_uids_in_blocks ( )
   Like renumber_gimple_stmt_uids, but only do work on the basic blocks
   in BLOCKS, of which there are N_BLOCKS.  Also renumbers PHIs.  

References cfun, gimple_set_uid(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), and inc_gimple_stmt_max_uid().

Referenced by rewrite_use_compare().

void set_ssa_default_def ( )
   Insert the pair VAR's UID, DEF into the default_defs hashtable
   of function FN.  
     Default definition might be changed by tail call optimization.  
      Mark DEF as the default definition for VAR.  
tree ssa_default_def ( )
   Lookup VAR UID in the default_defs hashtable and return the associated

Referenced by adjust_return_value(), DFS(), dump_live_info(), initialize_parameter_reductions(), ipa_analyze_call_uses(), and update_complex_components_on_edge().

bool stmt_references_abnormal_ssa_name ( )
   Returns true if STMT references an SSA_NAME that has
   SSA_NAME_OCCURS_IN_ABNORMAL_PHI set, otherwise false.  

References walk_stmt_info::info, and numbered_tree_d::t.