GCC Middle and Back End API Reference
cfgexpand.c File Reference
#include "insn-attr.h"
#include "asan.h"
Include dependency graph for cfgexpand.c:

Data Structures

struct  stack_var
struct  stack_vars_data

Enumerations

enum  { SPCT_FLAG_DEFAULT = 1, SPCT_FLAG_ALL = 2, SPCT_FLAG_STRONG = 3 }

Functions

static rtx expand_debug_expr (tree)
tree gimple_assign_rhs_to_tree ()
static void set_rtl ()
static unsigned int align_local_variable ()
static HOST_WIDE_INT alloc_stack_frame_space ()
static void add_stack_var ()
static void add_stack_var_conflict ()
static bool stack_var_conflict_p ()
static bool visit_op ()
static bool visit_conflict ()
static void add_scope_conflicts_1 ()
static void add_scope_conflicts ()
static int stack_var_cmp ()
static void add_partitioned_vars_to_ptset (struct pt_solution *pt, struct pointer_map_t *decls_to_partitions, struct pointer_set_t *visited, bitmap temp)
static void update_alias_info_with_stack_vars ()
static void union_stack_vars ()
static void partition_stack_vars ()
static void dump_stack_var_partition ()
static void expand_one_stack_var_at (tree decl, rtx base, unsigned base_align, HOST_WIDE_INT offset)
static void expand_stack_vars (bool(*pred)(size_t), struct stack_vars_data *data)
static HOST_WIDE_INT account_stack_vars ()
static void expand_one_stack_var ()
static void expand_one_hard_reg_var ()
static void expand_one_register_var ()
static void expand_one_error_var ()
static bool defer_stack_allocation ()
static HOST_WIDE_INT expand_one_var ()
static void expand_used_vars_for_block ()
static void clear_tree_used ()
static unsigned int stack_protect_classify_type ()
static int stack_protect_decl_phase ()
static bool stack_protect_decl_phase_1 ()
static bool stack_protect_decl_phase_2 ()
static bool asan_decl_phase_3 ()
static void add_stack_protection_conflicts ()
static void create_stack_guard ()
static void init_vars_expansion ()
static void fini_vars_expansion ()
HOST_WIDE_INT estimated_stack_frame_size ()
static int record_or_union_type_has_array_p ()
static rtx expand_used_vars ()
static void maybe_dump_rtl_for_gimple_stmt ()
static rtx label_rtx_for_bb ()
static void maybe_cleanup_end_of_block ()
static basic_block expand_gimple_cond ()
static void mark_transaction_restart_calls ()
static void expand_call_stmt ()
static void expand_gimple_stmt_1 ()
static rtx expand_gimple_stmt ()
static basic_block expand_gimple_tailcall ()
static rtx floor_sdiv_adjust ()
static rtx ceil_sdiv_adjust ()
static rtx ceil_udiv_adjust ()
static rtx round_sdiv_adjust ()
static rtx round_udiv_adjust ()
static rtx convert_debug_memory_address (enum machine_mode mode, rtx x, addr_space_t as)
static rtx expand_debug_parm_decl ()
static rtx expand_debug_expr ()
static rtx expand_debug_source_expr ()
static void avoid_complex_debug_insns ()
static void expand_debug_locations ()
static basic_block expand_gimple_basic_block ()
static basic_block construct_init_block ()
static void set_block_levels ()
static void construct_exit_block ()
static tree discover_nonconstant_array_refs_r (tree *tp, int *walk_subtrees, void *data)
static void discover_nonconstant_array_refs ()
static void expand_stack_alignment ()
static unsigned int gimple_expand_cfg ()
rtl_opt_passmake_pass_expand ()

Variables

struct ssaexpand SA
gimple currently_expanding_gimple_stmt
static struct stack_varstack_vars
static size_t stack_vars_alloc
static size_t stack_vars_num
static struct pointer_map_tdecl_to_stack_part
static bitmap_obstack stack_var_bitmap_obstack
static size_t * stack_vars_sorted
static int frame_phase
static bool has_protected_decls
static bool has_short_buffer
static struct pointer_map_tlab_rtx_for_bb

Enumeration Type Documentation

anonymous enum
Enumerator:
SPCT_FLAG_DEFAULT 
SPCT_FLAG_ALL 
SPCT_FLAG_STRONG 

Function Documentation

static HOST_WIDE_INT account_stack_vars ( )
static
Take into account all sizes of partitions and reset DECL_RTLs.   

References HOST_WIDE_INT, stack_var::next, set_rtl(), si, stack_var::size, stack_vars_num, and stack_vars_sorted.

Referenced by estimated_stack_frame_size().

static void add_partitioned_vars_to_ptset ( struct pt_solution pt,
struct pointer_map_t decls_to_partitions,
struct pointer_set_t visited,
bitmap  temp 
)
static
If the points-to solution *PI points to variables that are in a partition
   together with other variables add all partition members to the pointed-to
   variables bitmap.   

References pt_solution::anything, bitmap_bit_p(), bitmap_clear(), bitmap_empty_p(), bitmap_ior_into(), pointer_map_contains(), pointer_set_insert(), and pt_solution::vars.

Referenced by update_alias_info_with_stack_vars().

static void add_scope_conflicts ( )
static
Generate stack partition conflicts between all partitions that are
   simultaneously live.   

References add_scope_conflicts_1(), basic_block_def::aux, bitmap_ior_into(), changed, free(), and pre_and_rev_post_order_compute().

Referenced by expand_used_vars().

static void add_scope_conflicts_1 ( )
static
Helper routine for add_scope_conflicts, calculating the active partitions
   at the end of BB, leaving the result in WORK.  We're called to generate
   conflicts when FOR_CONFLICT is true, otherwise we're just tracking
   liveness.   

References basic_block_def::aux, bitmap_clear(), bitmap_clear_bit(), bitmap_ior_into(), stack_var::conflicts, gimple_assign_lhs(), gimple_clobber_p(), gsi_after_labels(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), is_gimple_debug(), pc_rtx, pointer_map_contains(), basic_block_def::preds, edge_def::src, visit_conflict(), visit_op(), and walk_stmt_load_store_addr_ops().

Referenced by add_scope_conflicts().

static void add_stack_protection_conflicts ( )
static
Ensure that variables in different stack protection phases conflict
   so that they are not merged and share the same stack slot.   

References add_stack_var_conflict(), stack_protect_decl_phase(), and stack_vars_num.

Referenced by expand_used_vars().

static void add_stack_var_conflict ( )
static
Make the decls associated with luid's X and Y conflict.   

References bitmap_set_bit(), and stack_var::conflicts.

Referenced by add_stack_protection_conflicts(), union_stack_vars(), and visit_conflict().

static unsigned int align_local_variable ( )
static
Compute the byte alignment to use for DECL.  Ignore alignment
   we can't do with expected alignment of the stack boundary.   

Referenced by add_stack_var(), and expand_one_stack_var().

static HOST_WIDE_INT alloc_stack_frame_space ( )
static
Allocate SIZE bytes at byte alignment ALIGN from the stack frame.
   Return the frame offset.   

References cfun, function::decl, frame_offset_overflow(), frame_phase, HOST_WIDE_INT, and offset.

Referenced by expand_one_stack_var(), expand_stack_vars(), and expand_used_vars().

static bool asan_decl_phase_3 ( )
static
And helper function that checks for asan phase (with stack protector
   it is phase 3).  This is used as callback for expand_stack_vars.
   Returns true if any of the vars in the partition need to be protected.   

References asan_protect_stack_decl(), and stack_var::next.

Referenced by expand_used_vars().

static void avoid_complex_debug_insns ( )
static
Ensure INSN_VAR_LOCATION_LOC (insn) doesn't have unbound complexity.
   Allow 4 levels of rtl nesting for most rtl codes, and if we see anything
   deeper than that, create DEBUG_EXPRs and emit DEBUG_INSNs before INSN.   

References emit_debug_insn_before(), exp(), make_debug_expr_from_rtl(), and VAR_INIT_STATUS_INITIALIZED.

Referenced by expand_debug_locations().

static rtx ceil_sdiv_adjust ( )
static
Return the difference between the ceil and the truncated result of
   a signed division by OP1 with remainder MOD.   

Referenced by expand_debug_expr().

static rtx ceil_udiv_adjust ( )
static
Return the difference between the ceil and the truncated result of
   an unsigned division by OP1 with remainder MOD.   

Referenced by expand_debug_expr().

static void clear_tree_used ( )
static
A subroutine of expand_used_vars.  Walk down through the BLOCK tree
   and clear TREE_USED on all local variables.   

Referenced by expand_used_vars().

static rtx convert_debug_memory_address ( enum machine_mode  mode,
rtx  x,
addr_space_t  as 
)
static
Convert X to MODE, that must be Pmode or ptr_mode, without emitting
   any rtl.   

References simplify_gen_subreg(), subreg_lowpart_offset(), and targetm.

Referenced by expand_debug_expr().

static void create_stack_guard ( )
static
Create a decl for the guard at the top of the stack frame.   

References current_function_decl, and expand_one_stack_var().

Referenced by expand_used_vars().

static bool defer_stack_allocation ( )
static
A subroutine of expand_one_var.  VAR is a variable that will be
   allocated to the local stack frame.  Return true if we wish to
   add VAR to STACK_VARS so that it will be coalesced with other
   variables.  Return false to allocate VAR immediately.

   This function is used to reduce the number of variables considered
   for coalescing, which reduces the size of the quadratic problem.   

References tree_low_cst().

Referenced by expand_one_var().

static void discover_nonconstant_array_refs ( )
static
RTL expansion is not able to compile array references with variable
   offsets for arrays stored in single register.  Discover such
   expressions and mark variables as addressable to avoid this
   scenario.   

References discover_nonconstant_array_refs_r(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_debug(), and walk_gimple_op().

Referenced by gimple_expand_cfg().

static tree discover_nonconstant_array_refs_r ( tree tp,
int *  walk_subtrees,
void *  data 
)
static
Helper function for discover_nonconstant_array_refs.
   Look for ARRAY_REF nodes with non-constant indexes and mark them
   addressable.   

References get_base_address(), and is_gimple_min_invariant().

Referenced by discover_nonconstant_array_refs().

static void dump_stack_var_partition ( )
static
HOST_WIDE_INT estimated_stack_frame_size ( )
Make a fair guess for the size of the stack frame of the function
   in NODE.  This doesn't have to be exact, the result is only used in
   the inline heuristics.  So we don't want to run the full stack var
   packing algorithm (which is quadratic in the number of stack vars).
   Instead, we calculate the total size of all stack vars.  This turns
   out to be a pretty fair estimate -- packing of stack vars doesn't
   happen very often.   

References account_stack_vars(), auto_var_in_fn_p(), symtab_node_base::decl, function::decl, expand_one_var(), fini_vars_expansion(), HOST_WIDE_INT, init_vars_expansion(), pop_cfun(), push_cfun(), stack_vars_num, stack_vars_sorted, and cgraph_node::symbol.

Referenced by compute_inline_parameters().

static rtx expand_debug_expr ( tree  )
static
static void expand_debug_locations ( )
static
Expand the _LOCs in debug insns.  We run this after expanding all
   regular insns, so that any variables referenced in the function
   will have their DECL_RTLs set.   

References avoid_complex_debug_insns(), expand_debug_expr(), expand_debug_source_expr(), get_insns(), get_last_insn(), last, and VAR_INIT_STATUS_UNINITIALIZED.

Referenced by gimple_expand_cfg().

static rtx expand_debug_parm_decl ( )
static
Return an RTX equivalent to the value of the parameter DECL.   

References copy_rtx(), gen_raw_REG(), gen_rtx_REG_offset(), and replace_equiv_address_nv().

Referenced by expand_debug_expr(), and expand_debug_source_expr().

static rtx expand_debug_source_expr ( )
static
static basic_block expand_gimple_basic_block ( )
static
Expand basic block BB from GIMPLE trees to RTL.   

References bb_seq(), bitmap_bit_p(), can_fallthru(), curr_insn_location(), delink_stmt_imm_use(), edge_def::dest, do_pending_stack_adjust(), dump_file, dump_flags, emit_debug_insn(), emit_insn_after_noloc(), emit_jump(), emit_label(), emit_note(), emit_note_after(), expand_gimple_cond(), expand_gimple_stmt(), expand_gimple_tailcall(), edge_def::flags, basic_block_def::flags, gen_move_insn(), gen_reg_rtx(), get_gimple_for_ssa_name(), get_last_insn(), basic_block_def::basic_block_il_dependent::gimple, gimple_assign_rhs_to_tree(), gimple_call_set_tail(), gimple_call_tail_p(), gimple_debug_bind_get_value(), gimple_debug_bind_get_var(), gimple_debug_bind_has_value_p(), gimple_debug_bind_p(), gimple_debug_source_bind_get_value(), gimple_debug_source_bind_get_var(), gimple_debug_source_bind_p(), gimple_location(), gimple_return_retval(), edge_def::goto_locus, gsi_end_p(), gsi_next(), gsi_remove(), gsi_stmt(), basic_block_def::il, basic_block_def::index, init_rtl_bb_info(), is_gimple_call(), is_gimple_debug(), label_rtx_for_bb(), last, maybe_dump_rtl_for_gimple_stmt(), basic_block_def::next_bb, gimple_bb_info::phi_nodes, pointer_map_contains(), rtl_profile_for_bb(), SA, gimple_bb_info::seq, set_curr_insn_location(), single_succ(), single_succ_edge(), single_succ_p(), basic_block_def::succs, target_for_debug_bind(), update_bb_for_insn(), update_stmt(), ssaexpand::values, VAR_INIT_STATUS_INITIALIZED, and VAR_INIT_STATUS_UNINITIALIZED.

Referenced by gimple_expand_cfg().

static rtx expand_gimple_stmt ( )
static
Expand one gimple statement STMT and return the last RTL instruction
   before any of the newly generated ones.

   In addition to generating the necessary RTL instructions this also
   sets REG_EH_REGION notes if necessary and sets the current source
   location for diagnostics.   

References cfun, expand_gimple_stmt_1(), find_reg_note(), free_temp_slots(), get_last_insn(), gimple_has_location(), gimple_location(), input_location, insn_could_throw_p(), last, lookup_stmt_eh_lp(), make_reg_eh_region_note(), and next_real_insn().

Referenced by expand_gimple_basic_block(), and expand_gimple_tailcall().

static basic_block expand_gimple_tailcall ( )
static
A subroutine of expand_gimple_basic_block.  Expand one GIMPLE_CALL
   that has CALL_EXPR_TAILCALL set.  Returns non-null if we actually
   generated a tail call (something that might be denied by the ABI
   rules governing the call; see calls.c).

   Sets CAN_FALLTHRU if we generated a *conditional* tail call, and
   can still reach the rest of BB.  The case here is __builtin_sqrt,
   where the NaN result goes through the external function (with a
   tailcall) and the normal result happens via a sqrt instruction.   

References count, edge_def::count, basic_block_def::count, create_basic_block(), delete_insn(), edge_def::dest, do_pending_stack_adjust(), ei_next(), ei_safe_edge(), expand_gimple_stmt(), edge_def::flags, basic_block_def::frequency, get_last_insn(), last, make_edge(), maybe_dump_rtl_for_gimple_stmt(), edge_def::probability, remove_edge(), basic_block_def::succs, and update_bb_for_insn().

Referenced by expand_gimple_basic_block().

static void expand_one_error_var ( )
static
A subroutine of expand_one_var.  Called to assign rtl to a VAR_DECL that
   has some associated error, e.g. its type is error-mark.  We just need
   to pick something that won't crash the rest of the compiler.   

References gen_reg_rtx(), and gen_rtx_MEM().

Referenced by expand_one_var().

static void expand_one_hard_reg_var ( )
static
A subroutine of expand_one_var.  Called to assign rtl to a VAR_DECL
   that will reside in a hard register.   

References rest_of_decl_compilation().

Referenced by expand_one_var().

static void expand_one_register_var ( )
static
A subroutine of expand_one_var.  Called to assign rtl to a VAR_DECL
   that will reside in a pseudo register.   

References gen_reg_rtx(), get_pointer_alignment(), mark_reg_pointer(), mark_user_reg(), promote_decl_mode(), reg_mode, and set_rtl().

Referenced by expand_one_var().

static void expand_one_stack_var ( )
static
A subroutine of expand_one_var.  Called to immediately assign rtl
   to a variable to be allocated in the stack frame.   

References align_local_variable(), alloc_stack_frame_space(), expand_one_stack_var_at(), HOST_WIDE_INT, offset, and tree_low_cst().

Referenced by create_stack_guard(), and expand_one_var().

static void expand_one_stack_var_at ( tree  decl,
rtx  base,
unsigned  base_align,
HOST_WIDE_INT  offset 
)
static
static HOST_WIDE_INT expand_one_var ( )
static
A subroutine of expand_used_vars.  Expand one variable according to
   its flavor.  Variables to be placed on the stack are not actually
   expanded yet, merely recorded.
   When REALLY_EXPAND is false, only add stack values to be allocated.
   Return stack usage this variable is supposed to take.

References add_stack_var(), defer_stack_allocation(), error(), expand_one_error_var(), expand_one_hard_reg_var(), expand_one_register_var(), expand_one_stack_var(), tree_low_cst(), use_register_for_decl(), and valid_constant_size_p().

Referenced by estimated_stack_frame_size(), expand_used_vars(), and expand_used_vars_for_block().

static void expand_stack_alignment ( )
static
This function sets crtl->args.internal_arg_pointer to a virtual
   register if DRAP is needed.  Local register allocator will replace
   virtual_incoming_args_rtx with the virtual register.   

References function::calls_alloca, function::can_throw_non_call_exceptions, cfun, fixup_tail_calls(), function::has_nonlocal_label, and targetm.

Referenced by gimple_expand_cfg().

static void expand_stack_vars ( bool(*)(size_t)  pred,
struct stack_vars_data data 
)
static
static void expand_used_vars_for_block ( )
static
A subroutine of expand_used_vars.  Walk down through the BLOCK tree
   expanding variables.  Those variables that can be put into registers
   are allocated pseudos; those that can't are put on the stack.

   TOPLEVEL is true if this is the outermost BLOCK.   

References expand_one_var().

Referenced by expand_used_vars().

static void fini_vars_expansion ( )
static
static rtx floor_sdiv_adjust ( )
static
Return the difference between the floor and the truncated result of
   a signed division by OP1 with remainder MOD.   

Referenced by expand_debug_expr().

static unsigned int gimple_expand_cfg ( )
static
Translate the intermediate representation contained in the CFG
   from GIMPLE trees to RTL.

   We do conversion per basic block and preserve/update the tree CFG.
   This implies we have to do some magic as the CFG can simultaneously
   consist of basic blocks containing RTL and GIMPLE trees.  This can
   confuse the CFG hooks, so be careful to not manipulate CFG during
   the expansion.   

References bitmap_ones(), function::calls_alloca, CDI_DOMINATORS, CDI_POST_DOMINATORS, function::cfg, cfun, cgraph_function_possibly_inlined_p(), cleanup_cfg(), commit_one_edge_insertion(), construct_exit_block(), construct_init_block(), curr_insn_location(), current_function_decl, currently_expanding_to_rtl, debug_hooks, function::decl, default_rtl_profile(), delete_tree_cfg_annotations(), edge_def::dest, discover_nonconstant_array_refs(), dump_file, function::eh, ei_next(), ei_safe_edge(), emit_initial_value_sets(), emit_insn_after(), emit_insn_after_noloc(), emit_insn_before(), emit_note(), end_sequence(), expand_debug_locations(), expand_function_start(), expand_gimple_basic_block(), expand_main_function(), expand_phi_nodes(), expand_stack_alignment(), expand_used_vars(), find_many_sub_basic_blocks(), finish_eh_generation(), finish_out_of_ssa(), fixup_tail_calls(), edge_def::flags, free_dominance_info(), free_histograms(), function::function_start_locus, generating_concat_p, get_containing_scope(), get_insns(), get_pointer_alignment(), function::gimple_df, has_short_buffer, gimple_df::in_ssa_p, insn_locations_finalize(), insn_locations_init(), edge_def::insns, LOOP_CLOSED_SSA, loops_state_clear(), ssaexpand::map, mark_reg_pointer(), control_flow_graph::max_jumptable_ents, basic_block_def::next_bb, _var_map::num_partitions, gcc_debug_hooks::outlining_inline_function, ssaexpand::partition_to_pseudo, partition_to_var(), pc_rtx, pointer_map_create(), pointer_map_destroy(), prologue_location, purge_all_dead_edges(), edge_def::edge_def_insns::r, rebuild_jump_labels(), rebuild_jump_labels_chain(), reg_renumber, eh_status::region_tree, remove_edge(), replace_ssa_name_symbol(), resolve_unique_section(), rewrite_out_of_ssa(), rtl_profile_for_bb(), rtl_register_cfg_hooks(), SA, sbitmap_alloc(), sbitmap_free(), set_block_levels(), set_curr_insn_location(), set_eh_throw_stmt_table(), set_mem_expr(), single_succ_p(), edge_def::src, stack_protect_prologue(), start_sequence(), basic_block_def::succs, targetm, timevar_pop(), timevar_push(), gimple_df::tm_restart, unshare_all_rtl(), var_to_partition(), verify_flow_info(), and warning().

static void init_vars_expansion ( )
static
static rtx label_rtx_for_bb ( )
static
rtl_opt_pass* make_pass_expand ( )
static void mark_transaction_restart_calls ( )
static
static void maybe_cleanup_end_of_block ( )
static
A subroutine of expand_gimple_cond.  Given E, a fallthrough edge
   of a basic block where we just expanded the conditional at the end,
   possibly clean up the CFG and instruction sequence.  LAST is the
   last instruction before the just emitted jump sequence.   

References any_condjump_p(), delete_insn(), get_last_insn(), last, and remove_edge().

Referenced by expand_gimple_cond().

static void maybe_dump_rtl_for_gimple_stmt ( )
static
If we need to produce a detailed dump, print the tree representation
   for STMT to the dump file.  SINCE is the last RTX after which the RTL
   generated for STMT should have been appended.   

References dump_file, dump_flags, print_gimple_stmt(), and print_rtl().

Referenced by expand_gimple_basic_block(), expand_gimple_cond(), and expand_gimple_tailcall().

static void partition_stack_vars ( )
static
A subroutine of expand_used_vars.  Binpack the variables into
   partitions constrained by the interference graph.  The overall
   algorithm used is as follows:

        Sort the objects by size in descending order.
        For each object A {
          S = size(A)
          O = 0
          loop {
            Look for the largest non-conflicting object B with size <= S.
            UNION (A, B)
          }
        }

References stack_var::alignb, HOST_WIDE_INT, stack_var::representative, si, stack_var::size, stack_var_cmp(), stack_var_conflict_p(), stack_vars_num, stack_vars_sorted, union_stack_vars(), and update_alias_info_with_stack_vars().

Referenced by expand_used_vars().

static int record_or_union_type_has_array_p ( )
static
Helper routine to check if a record or union contains an array field.  

References field_type().

Referenced by expand_used_vars().

static rtx round_sdiv_adjust ( )
static
Return the difference between the rounded and the truncated result
   of a signed division by OP1 with remainder MOD.  Halfway cases are
   rounded away from zero, rather than to the nearest even number.   

Referenced by expand_debug_expr().

static rtx round_udiv_adjust ( )
static
Return the difference between the rounded and the truncated result
   of a unsigned division by OP1 with remainder MOD.  Halfway cases
   are rounded away from zero, rather than to the nearest even
   number.   

Referenced by expand_debug_expr().

static void set_block_levels ( )
static
For each lexical block, set BLOCK_NUMBER to the depth at which it is
   found in the block tree.   

Referenced by gimple_expand_cfg().

static void set_rtl ( )
inlinestatic
Associate declaration T with storage space X.  If T is no
   SSA name this is exactly SET_DECL_RTL, otherwise make the
   partition of T associated with X.   

References ssaexpand::map, ssaexpand::partition_to_pseudo, pc_rtx, SA, set_reg_attrs_for_decl_rtl(), and var_to_partition().

Referenced by account_stack_vars(), add_stack_var(), expand_one_register_var(), and expand_one_stack_var_at().

static unsigned int stack_protect_classify_type ( )
static
static int stack_protect_decl_phase ( )
static
Return nonzero if DECL should be segregated into the "vulnerable" upper
   part of the local stack frame.  Remember if we ever return nonzero for
   any variable in this function.  The return value is the phase number in
   which the variable should be allocated.   

References has_protected_decls, has_short_buffer, SPCT_FLAG_ALL, SPCT_FLAG_STRONG, and stack_protect_classify_type().

Referenced by add_stack_protection_conflicts(), stack_protect_decl_phase_1(), and stack_protect_decl_phase_2().

static bool stack_protect_decl_phase_1 ( )
static
Two helper routines that check for phase 1 and phase 2.  These are used
   as callbacks for expand_stack_vars.   

References stack_protect_decl_phase().

Referenced by expand_used_vars().

static bool stack_protect_decl_phase_2 ( )
static

References stack_protect_decl_phase().

Referenced by expand_used_vars().

static int stack_var_cmp ( )
static
A subroutine of partition_stack_vars.  A comparison function for qsort,
   sorting an array of indices by the properties of the object.   

References stack_var::alignb, stack_var::decl, HOST_WIDE_INT, and stack_var::size.

Referenced by partition_stack_vars().

static bool stack_var_conflict_p ( )
static
Check whether the decls associated with luid's X and Y conflict.   

References bitmap_bit_p(), stack_var::conflicts, and stack_var::decl.

Referenced by partition_stack_vars().

static void union_stack_vars ( )
static
A subroutine of partition_stack_vars.  The UNION portion of a UNION/FIND
   partitioning algorithm.  Partitions A and B are known to be non-conflicting.
   Merge them into a single partition A.   

References add_stack_var_conflict(), stack_var::alignb, stack_var::conflicts, stack_var::next, and stack_var::representative.

Referenced by partition_stack_vars().

static void update_alias_info_with_stack_vars ( )
static
Update points-to sets based on partition info, so we can use them on RTL.
   The bitmaps representing stack partitions will be saved until expand,
   where partitioned decls used as bases in memory expressions will be
   rewritten.   

References add_partitioned_vars_to_ptset(), bitmap_set_bit(), cfun, create_tmp_var(), stack_var::decl, gimple_df::decls_to_pointers, gimple_df::escaped, get_ptr_info(), function::gimple_df, make_ssa_name(), stack_var::next, pointer_map_create(), pointer_map_destroy(), pointer_map_insert(), pointer_set_create(), pointer_set_destroy(), ptr_info_def::pt, pt_solution_set(), stack_vars_num, and visited.

Referenced by partition_stack_vars().

static bool visit_conflict ( )
static
Callback for walk_stmt_ops.  If OP is a decl touched by add_stack_var
   record conflicts between it and all currently active other partitions
   from bitmap DATA.   

References add_stack_var_conflict(), bitmap_set_bit(), get_base_address(), pc_rtx, pointer_map_contains(), and stack_vars_num.

Referenced by add_scope_conflicts_1().

static bool visit_op ( )
static
Callback for walk_stmt_ops.  If OP is a decl touched by add_stack_var
   enter its partition number into bitmap DATA.   

References bitmap_set_bit(), get_base_address(), pc_rtx, and pointer_map_contains().

Referenced by add_scope_conflicts_1().


Variable Documentation

gimple currently_expanding_gimple_stmt
This variable holds the currently expanded gimple statement for purposes
   of comminucating the profile info to the builtin expanders.   

Referenced by expand_builtin_memcpy(), and expand_builtin_memset_args().

struct pointer_map_t* decl_to_stack_part
static
int frame_phase
static
The phase of the stack frame.  This is the known misalignment of
   virtual_stack_vars_rtx from PREFERRED_STACK_BOUNDARY.  That is,
   (frame_offset+frame_phase) % PREFERRED_STACK_BOUNDARY == 0.   

Referenced by alloc_stack_frame_space(), expand_one_stack_var_at(), expand_used_vars(), and try_fit_stack_local().

bool has_protected_decls
static
Used during expand_used_vars to remember if we saw any decls for
   which we'd like to enable stack smashing protection.   

Referenced by expand_used_vars(), init_vars_expansion(), and stack_protect_decl_phase().

bool has_short_buffer
static
Used during expand_used_vars.  Remember if we say a character buffer
   smaller than our cutoff threshold.  Used for -Wstack-protector.   

Referenced by gimple_expand_cfg(), init_vars_expansion(), and stack_protect_decl_phase().

struct pointer_map_t* lab_rtx_for_bb
static
Maps the blocks that do not contain tree labels to rtx labels.   
struct ssaexpand SA
@verbatim A pass for lowering trees to RTL.

Copyright (C) 2004-2013 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 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 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 COPYING3. If not see http://www.gnu.org/licenses/.

This variable holds information helping the rewriting of SSA trees
   into RTL.   

Referenced by build_common_tree_nodes(), expand_debug_expr(), expand_gimple_basic_block(), expand_gimple_cond(), expand_stack_vars(), expand_used_vars(), get_gimple_for_ssa_name(), get_rtx_for_ssa_name(), gimple_expand_cfg(), insert_part_to_rtx_on_edge(), insert_partition_copy_on_edge(), insert_rtx_to_part_on_edge(), insert_value_copy_on_edge(), and set_rtl().

bitmap_obstack stack_var_bitmap_obstack
static
Conflict bitmaps go on this obstack.  This allows us to destroy
   all of them in one big sweep.   
struct stack_var* stack_vars
static
We have an array of such objects while deciding allocation.   
size_t stack_vars_alloc
static
size_t* stack_vars_sorted
static
An array of indices such that stack_vars[stack_vars_sorted[i]].size
   is non-decreasing.   

Referenced by account_stack_vars(), dump_stack_var_partition(), estimated_stack_frame_size(), expand_stack_vars(), fini_vars_expansion(), and partition_stack_vars().