GCC Middle and Back End API Reference
explow.c File Reference

Functions

static rtx break_out_memory_refs (rtx)
HOST_WIDE_INT trunc_int_for_mode ()
rtx plus_constant ()
rtx eliminate_constant_term ()
rtx expr_size ()
HOST_WIDE_INT int_expr_size ()
static rtx break_out_memory_refs ()
rtx convert_memory_address_addr_space (enum machine_mode to_mode, rtx x, addr_space_t as)
rtx memory_address_addr_space ()
rtx validize_mem ()
rtx use_anchored_address ()
rtx copy_to_reg ()
rtx copy_addr_to_reg ()
rtx copy_to_mode_reg ()
rtx force_reg ()
rtx force_not_mem ()
rtx copy_to_suggested_reg ()
enum machine_mode promote_function_mode (const_tree type, enum machine_mode mode, int *punsignedp, const_tree funtype, int for_return)
enum machine_mode promote_mode (const_tree type, enum machine_mode mode, int *punsignedp)
enum machine_mode promote_decl_mode ()
static void adjust_stack_1 ()
void adjust_stack ()
void anti_adjust_stack ()
static rtx round_push ()
void emit_stack_save ()
void emit_stack_restore ()
void update_nonlocal_goto_save_area ()
rtx allocate_dynamic_stack_space (rtx size, unsigned size_align, unsigned required_align, bool cannot_accumulate)
void set_stack_check_libfunc ()
void emit_stack_probe ()
void probe_stack_range ()
void anti_adjust_stack_and_probe ()
rtx hard_function_value (const_tree valtype, const_tree func, const_tree fntype, int outgoing)
rtx hard_libcall_value ()
int rtx_to_tree_code ()

Variables

static bool suppress_reg_args_size
static rtx stack_check_libfunc

Function Documentation

void adjust_stack ( )
Adjust the stack pointer by ADJUST (an rtx for a number of bytes).
   This pops when ADJUST is positive.  ADJUST need not be constant.   

References adjust_stack_1().

Referenced by anti_adjust_stack_and_probe(), do_pending_stack_adjust(), and emit_call_1().

static void adjust_stack_1 ( )
static
A helper for adjust_stack and anti_adjust_stack.   

References add_reg_note(), emit_move_insn(), expand_binop(), get_last_insn(), OPTAB_LIB_WIDEN, and suppress_reg_args_size.

Referenced by adjust_stack(), and anti_adjust_stack().

rtx allocate_dynamic_stack_space ( rtx  size,
unsigned  size_align,
unsigned  required_align,
bool  cannot_accumulate 
)
Return an rtx representing the address of an area of memory dynamically
   pushed on the stack.

   Any required stack pointer alignment is preserved.

   SIZE is an rtx representing the size of the area.

   SIZE_ALIGN is the alignment (in bits) that we know SIZE has.  This
   parameter may be zero.  If so, a proper value will be extracted 
   from SIZE if it is constant, otherwise BITS_PER_UNIT will be assumed.

   REQUIRED_ALIGN is the alignment (in bits) required for the region
   of memory.

   If CANNOT_ACCUMULATE is set to TRUE, the caller guarantees that the
   stack space allocated by the generated code cannot be added with itself
   in the course of the execution of the function.  It is always safe to
   pass FALSE here and the following criterion is sufficient in order to
   pass TRUE: every path in the CFG that starts at the allocation point and
   loops to it executes the associated deallocation code.   

References anti_adjust_stack(), anti_adjust_stack_and_probe(), function::calls_alloca, cfun, convert_to_mode(), create_convert_operand_to(), create_fixed_operand(), do_pending_stack_adjust(), emit_barrier(), emit_cmp_and_jump_insns(), emit_insn(), emit_jump(), emit_label(), emit_library_call_value(), emit_move_insn(), error(), expand_binop(), expand_divmod(), expand_insn(), expand_mult(), find_reg_equal_equiv_note(), force_operand(), gen_label_rtx(), gen_reg_rtx(), GENERIC_STACK_CHECK, get_last_insn(), HOST_BITS_PER_INT, HOST_WIDE_INT, init_one_libfunc(), LCT_NORMAL, mark_reg_pointer(), function::nonlocal_goto_save_area, OPTAB_LIB_WIDEN, OPTAB_WIDEN, plus_constant(), probe_stack_range(), round_push(), rtx_equal_p(), stack_limit_rtx, STATIC_BUILTIN_STACK_CHECK, suppress_reg_args_size, and update_nonlocal_goto_save_area().

Referenced by expand_builtin_alloca(), expand_builtin_apply(), expand_call(), expand_stack_vars(), and initialize_argument_information().

void anti_adjust_stack ( )
Adjust the stack pointer by minus ADJUST (an rtx for a number of bytes).
   This pushes when ADJUST is positive.  ADJUST need not be constant.   

References adjust_stack_1().

Referenced by allocate_dynamic_stack_space(), anti_adjust_stack_and_probe(), emit_call_1(), emit_library_call_value_1(), emit_push_insn(), expand_call(), and push_block().

void anti_adjust_stack_and_probe ( )
Adjust the stack pointer by minus SIZE (an rtx for a number of bytes)
   while probing it.  This pushes when SIZE is positive.  SIZE need not
   be constant.  If ADJUST_BACK is true, adjust back the stack pointer
   by plus SIZE at the end.   

References adjust_stack(), anti_adjust_stack(), convert_to_mode(), emit_cmp_and_jump_insns(), emit_jump(), emit_label(), emit_stack_probe(), force_operand(), gen_label_rtx(), HOST_WIDE_INT, plus_constant(), and simplify_gen_binary().

Referenced by allocate_dynamic_stack_space(), and expand_function_end().

static rtx break_out_memory_refs ( rtx  )
static
@verbatim Subroutines for manipulating rtx's in semantically interesting ways.

Copyright (C) 1987-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/.

Referenced by break_out_memory_refs(), and memory_address_addr_space().

static rtx break_out_memory_refs ( )
static
Return a copy of X in which all memory references
   and all constants that involve symbol refs
   have been replaced with new temporary registers.
   Also emit code to load the memory locations and constants
   into those registers.

   If X contains no such constants or memory references,
   X itself (not a copy) is returned.

   If a constant is found in the address that is not a legitimate constant
   in an insn, it is left alone in the hope that it might be valid in the
   address.

   X may contain no arithmetic except addition, subtraction and multiplication.
   Values returned by expand_expr with 1 for sum_ok fit this constraint.   

References break_out_memory_refs(), force_reg(), and simplify_gen_binary().

rtx convert_memory_address_addr_space ( enum machine_mode  to_mode,
rtx  x,
addr_space_t  as 
)
Given X, a memory address in address space AS' pointer mode, convert it to
   an address in the address space's address mode, or vice versa (TO_MODE says
   which way).  We take advantage of the fact that pointers are not allowed to
   overflow by commuting arithmetic operations over conversions so that address
   arithmetic insns can be used.   

References convert_memory_address_addr_space(), convert_modes(), simplify_unary_operation(), and targetm.

Referenced by convert_memory_address_addr_space(), expand_assignment(), expand_expr_addr_expr(), expand_expr_addr_expr_1(), make_tree(), and memory_address_addr_space().

rtx copy_addr_to_reg ( )
Like copy_to_reg but always give the new register mode Pmode
   in case X is a constant.   

References copy_to_mode_reg().

Referenced by emit_block_move_via_libcall(), expand_builtin_apply(), expand_builtin_apply_args_1(), expand_builtin_cexpi(), expand_builtin_frame_address(), expand_call(), and set_storage_via_libcall().

rtx copy_to_suggested_reg ( )
Copy X to TARGET (if it's nonzero and a reg)
   or to a new temp reg and return that reg.
   MODE is the mode to use for X in case it is a constant.   

References emit_move_insn(), and gen_reg_rtx().

rtx eliminate_constant_term ( )
If X is a sum, return a new sum like X but lacking any constant terms.
   Add all the removed constant terms into *CONSTPTR.
   X itself is not altered.  The result != X if and only if
   it is not isomorphic to X.   

References simplify_binary_operation().

Referenced by memory_address_addr_space().

void emit_stack_probe ( )
Emit one stack probe at ADDRESS, an address within the stack.   

References emit_insn(), emit_move_insn(), gen_rtx_MEM(), and word_mode.

Referenced by anti_adjust_stack_and_probe(), and probe_stack_range().

void emit_stack_restore ( )
Restore the stack pointer for the purpose in SAVE_LEVEL.  SA is the save
   area made by emit_stack_save.  If it is zero, we have nothing to do.   

References discard_pending_stack_adjust(), emit_clobber(), emit_insn(), gen_move_insn(), gen_rtx_MEM(), SAVE_BLOCK, SAVE_FUNCTION, SAVE_NONLOCAL, and validize_mem().

Referenced by expand_builtin_apply(), expand_builtin_longjmp(), expand_builtin_nonlocal_goto(), expand_call(), expand_function_end(), and expand_stack_restore().

void emit_stack_save ( )
Save the stack pointer for the purpose in SAVE_LEVEL.  PSAVE is a pointer
   to a previously-created save area.  If no save area has been allocated,
   this function will allocate one.  If a save area is specified, it
   must be of the proper mode.   

References assign_stack_local(), do_pending_stack_adjust(), emit_insn(), gen_move_insn(), gen_reg_rtx(), SAVE_BLOCK, SAVE_FUNCTION, SAVE_NONLOCAL, and validize_mem().

Referenced by expand_builtin_apply(), expand_builtin_setjmp_setup(), expand_builtin_update_setjmp_buf(), expand_call(), expand_function_end(), expand_stack_save(), initialize_argument_information(), and update_nonlocal_goto_save_area().

rtx force_not_mem ( )
If X is a memory ref, copy its contents to a new temp reg and return
   that reg.  Otherwise, return X.   

References emit_move_insn(), and gen_reg_rtx().

Referenced by expand_assignment(), expand_return(), and prepare_call_address().

rtx force_reg ( )
Load X into a register if it is not already one.
   Use mode MODE for the register.
   X should be valid for mode MODE, but it may be a constant which
   is valid for all integer modes; that's why caller must specify MODE.

   The caller must not alter the value in the register we return,
   since we mark it as a "constant" register.   

References ctz_hwi(), emit_move_insn(), force_operand(), gen_reg_rtx(), general_operand(), get_last_insn(), mark_reg_pointer(), rtx_equal_p(), and set_unique_reg_note().

Referenced by asan_clear_shadow(), avoid_expensive_constant(), break_out_memory_refs(), builtin_memset_gen_str(), compress_float_constant(), convert_extracted_bit_field(), convert_move(), emit_cmp_and_jump_insns(), emit_group_load_into_temps(), emit_library_call_value_1(), expand_asm_operands(), expand_binop(), expand_builtin_frob_return_addr(), expand_builtin_longjmp(), expand_builtin_memset_args(), expand_builtin_setjmp_setup(), expand_builtin_signbit(), expand_call(), expand_divmod(), expand_doubleword_clz(), expand_expr_real_1(), expand_expr_real_2(), expand_movstr(), expand_mult(), expand_mult_const(), expand_sdiv_pow2(), expand_shift_1(), expand_smod_pow2(), expand_vec_perm_1(), extract_bit_field_1(), extract_fixed_bit_field(), extract_low_bits(), force_operand(), gen_lowpart_general(), instantiate_virtual_regs_in_insn(), lowpart_subreg_maybe_copy(), memory_address_addr_space(), offset_address(), operand_subword_force(), precompute_register_parameters(), prepare_call_address(), prepare_cmp_insn(), sjlj_emit_dispatch_table(), store_bit_field_using_insv(), store_fixed_bit_field(), store_split_bit_field(), use_anchored_address(), and widen_operand().

rtx hard_function_value ( const_tree  valtype,
const_tree  func,
const_tree  fntype,
int  outgoing 
)
Return an rtx representing the register or memory location
   in which a scalar value of data type VALTYPE
   was returned by a function call to function FUNC.
   FUNC is a FUNCTION_DECL, FNTYPE a FUNCTION_TYPE node if the precise
   function is known, otherwise 0.
   OUTGOING is 1 if on a machine with register windows this function
   should return the register in which the function will put its result
   and 0 otherwise.   

References HOST_WIDE_INT, int_size_in_bytes(), and targetm.

Referenced by aggregate_value_p(), emit_library_call_value_1(), expand_call(), and expand_function_start().

rtx hard_libcall_value ( )
Return an rtx representing the register or memory location
   in which a scalar value of mode MODE was returned by a library call.   

References targetm.

Referenced by emit_library_call_value_1(), and expand_unop().

HOST_WIDE_INT int_expr_size ( )
Return a wide integer for the size in bytes of the value of EXP, or -1
   if the size can vary or is larger than an integer.   

References host_integerp(), tree_expr_size(), and tree_low_cst().

Referenced by expand_constructor(), and store_expr().

rtx memory_address_addr_space ( )
Return something equivalent to X but valid as a memory address for something
   of mode MODE in the named address space AS.  When X is not itself valid,
   this works by copying X or subexpressions of it into registers.   

References break_out_memory_refs(), convert_memory_address_addr_space(), copy_to_reg(), cse_not_expected, eliminate_constant_term(), force_operand(), force_reg(), mark_reg_pointer(), memory_address_addr_space_p(), targetm, and update_temp_slot_address().

Referenced by change_address_1(), expand_expr_real_1(), and get_address_cost().

rtx plus_constant ( )
Return an rtx for the sum of X and the integer C, given that X has
   mode MODE.   

References double_int::add_with_sign(), copy(), copy_rtx(), find_constant_term_loc(), force_const_mem(), double_int::from_pair(), double_int::from_shwi(), gen_int_mode(), get_pool_constant(), HOST_BITS_PER_WIDE_INT, and immed_double_int_const().

Referenced by adjust_address_1(), allocate_dynamic_stack_space(), anti_adjust_stack_and_probe(), asan_clear_shadow(), assign_stack_local_1(), canon_rtx(), check_mem_read_rtx(), combine_simplify_rtx(), compute_argument_addresses(), compute_cfa_pointer(), cselib_subst_to_values(), eliminate_regs_1(), eliminate_regs_in_insn(), emit_library_call_value_1(), emit_move_resolve_push(), emit_push_insn(), equiv_address_substitution(), expand_builtin_apply(), expand_builtin_apply_args_1(), expand_builtin_extract_return_addr(), expand_builtin_frob_return_addr(), expand_builtin_longjmp(), expand_builtin_nonlocal_goto(), expand_builtin_return_addr(), expand_builtin_setjmp_setup(), expand_builtin_stpcpy(), expand_builtin_update_setjmp_buf(), expand_call(), expand_debug_expr(), expand_divmod(), expand_expr_addr_expr_1(), expand_expr_real_2(), expand_movstr(), expand_one_stack_var_at(), find_inc(), find_reg_offset_for_const(), find_reloads_address(), fold_rtx(), force_to_mode(), form_sum(), gen_variable_die(), init_alias_analysis(), init_reload(), insert_const_anchor(), instantiate_virtual_regs_in_rtx(), internal_arg_pointer_based_exp(), lra_eliminate_regs_1(), move_by_pieces(), offsettable_address_addr_space_p(), prepare_call_arguments(), prepare_cmp_insn(), probe_stack_range(), push_block(), record_store(), restore_fixed_argument_area(), round_push(), rtl_for_decl_location(), save_fixed_argument_area(), simplify_binary_operation_1(), simplify_plus_minus(), simplify_unary_operation_1(), sjlj_emit_function_enter(), store_by_pieces(), store_by_pieces_1(), store_expr(), try_apply_stack_adjustment(), use_anchored_address(), use_related_value(), vt_add_function_parameter(), vt_canonicalize_addr(), and vt_initialize().

enum machine_mode promote_decl_mode ( )
Use one of promote_mode or promote_function_mode to find the promoted
   mode of DECL.  If PUNSIGNEDP is not NULL, store there the unsignedness
   of DECL after promotion.   

References current_function_decl, promote_function_mode(), and promote_mode().

Referenced by expand_expr_real_1(), expand_one_register_var(), get_temp_reg(), insert_value_copy_on_edge(), and store_constructor().

enum machine_mode promote_function_mode ( const_tree  type,
enum machine_mode  mode,
int *  punsignedp,
const_tree  funtype,
int  for_return 
)
Return the mode to use to pass or return a scalar of TYPE and MODE.
   PUNSIGNEDP points to the signedness of the type and may be adjusted
   to show what signedness to use on extension operations.

   FOR_RETURN is nonzero if the caller is promoting the return value
   of FNDECL, else it is for promoting args.   

References targetm.

Referenced by assign_parm_find_data_types(), assign_parm_setup_reg(), emit_library_call_value_1(), expand_call(), expand_expr_real_1(), expand_function_end(), expand_value_return(), initialize_argument_information(), promote_decl_mode(), and setup_incoming_promotions().

enum machine_mode promote_mode ( const_tree  type,
enum machine_mode  mode,
int *  punsignedp 
)
Return the mode to use to store a scalar of TYPE and MODE.
   PUNSIGNEDP points to the signedness of the type and may be adjusted
   to show what signedness to use on extension operations.   

References targetm.

Referenced by assign_temp(), default_promote_function_mode(), default_promote_function_mode_always_promote(), expand_cond_expr_using_cmove(), precompute_arguments(), and promote_decl_mode().

static rtx round_push ( )
static
Round the size of a block to be pushed up to the boundary required
   by this machine.  SIZE is the desired size, which need not be constant.   

References expand_binop(), expand_divmod(), expand_mult(), force_operand(), HOST_WIDE_INT, OPTAB_LIB_WIDEN, and plus_constant().

Referenced by allocate_dynamic_stack_space().

int rtx_to_tree_code ( )
Look up the tree code for a given rtx code
   to provide the arithmetic operation for REAL_ARITHMETIC.
   The function returns an int because the caller may not know
   what `enum tree_code' means.   

Referenced by simplify_const_binary_operation().

void set_stack_check_libfunc ( )
void update_nonlocal_goto_save_area ( void  )
Invoke emit_stack_save on the nonlocal_goto_save_area for the current
   function.  This function should be called whenever we allocate or
   deallocate dynamic stack space.   

References cfun, emit_stack_save(), expand_expr(), EXPAND_WRITE, function::nonlocal_goto_save_area, and SAVE_NONLOCAL.

Referenced by allocate_dynamic_stack_space(), expand_call(), and expand_function_start().

rtx use_anchored_address ( )
If X is a memory reference to a member of an object block, try rewriting
   it to use an anchor instead.  Return the new memory reference on success
   and the old one on failure.   

References cse_not_expected, force_reg(), get_section_anchor(), HOST_WIDE_INT, offset, place_block_symbol(), plus_constant(), replace_equiv_address(), and targetm.

Referenced by emit_move_insn(), emit_move_multi_word(), expand_expr_constant(), expand_expr_real_1(), and validize_mem().


Variable Documentation

rtx stack_check_libfunc
static
A front end may want to override GCC's stack checking by providing a
   run-time routine to call to check the stack, so provide a mechanism for
   calling that routine.   

Referenced by probe_stack_range().

bool suppress_reg_args_size
static
Controls the behaviour of {anti_,}adjust_stack.   

Referenced by adjust_stack_1(), and allocate_dynamic_stack_space().