GCC Middle and Back End API Reference
output.h File Reference

Go to the source code of this file.

Data Structures

struct  section_common
struct  named_section
struct  unnamed_section
struct  noswitch_section
union  section

Typedefs

typedef void(* unnamed_section_callback )(const void *)
typedef bool(* noswitch_section_callback )(tree decl, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded)

Enumerations

enum  section_category {
  SECCAT_TEXT, SECCAT_RODATA, SECCAT_RODATA_MERGE_STR, SECCAT_RODATA_MERGE_STR_INIT,
  SECCAT_RODATA_MERGE_CONST, SECCAT_SRODATA, SECCAT_DATA, SECCAT_DATA_REL,
  SECCAT_DATA_REL_LOCAL, SECCAT_DATA_REL_RO, SECCAT_DATA_REL_RO_LOCAL, SECCAT_SDATA,
  SECCAT_TDATA, SECCAT_BSS, SECCAT_SBSS, SECCAT_TBSS
}

Functions

void init_final (const char *)
void app_enable (void)
void app_disable (void)
int dbr_sequence_length (void)
void init_insn_lengths (void)
int get_attr_length (rtx)
int get_attr_min_length (rtx)
void shorten_branches (rtx)
void final_start_function (rtx, FILE *, int)
void final_end_function (void)
void final (rtx, FILE *, int)
rtx final_scan_insn (rtx, FILE *, int, int, int *)
rtx alter_subreg (rtx *, bool)
void output_operand (rtx, int)
void output_operand_lossage (const char *,...) ATTRIBUTE_PRINTF_1
void output_asm_insn (const char *, rtx *)
int insn_current_reference_address (rtx)
int label_to_alignment (rtx)
int label_to_max_skip (rtx)
void output_asm_label (rtx)
void mark_symbol_refs_as_used (rtx)
void output_address (rtx)
void output_addr_const (FILE *, rtx)
void fprint_whex (FILE *, unsigned HOST_WIDE_INT)
void fprint_ul (FILE *, unsigned long)
int sprint_ul (char *, unsigned long)
void asm_fprintf (FILE *file, const char *p,...) ATTRIBUTE_ASM_FPRINTF(2
void int leaf_function_p (void)
int final_forward_branch_p (rtx)
int only_leaf_regs_used (void)
void leaf_renumber_regs_insn (rtx)
const char * get_insn_template (int, rtx)
void weak_finish (void)
int decode_reg_name (const char *)
int decode_reg_name_and_count (const char *, int *)
void do_assemble_alias (tree, tree)
void default_assemble_visibility (tree, int)
void assemble_asm (tree)
void assemble_start_function (tree, const char *)
void assemble_end_function (tree, const char *)
void assemble_variable (tree, int, int, int)
void assemble_vtv_preinit_initializer (tree)
void align_variable (tree decl, bool dont_output_data)
void assemble_external (tree)
void assemble_zeros (unsigned HOST_WIDE_INT)
void assemble_align (int)
void assemble_string (const char *, int)
void assemble_external_libcall (rtx)
void assemble_label (FILE *, const char *)
void assemble_name_raw (FILE *, const char *)
void assemble_name (FILE *, const char *)
const char * integer_asm_op (int, int)
void assemble_integer_with_op (const char *, rtx)
bool default_assemble_integer (rtx, unsigned int, int)
bool assemble_integer (rtx, unsigned, unsigned, int)
sectionget_named_text_section (tree, const char *, const char *)
void assemble_real (REAL_VALUE_TYPE, enum machine_mode, unsigned)
void assemble_addr_to_section (rtx, section *)
int get_pool_size (void)
rtx peephole (rtx)
void output_shared_constant_pool (void)
void output_object_blocks (void)
void output_quoted_string (FILE *, const char *)
void output_constant (tree, unsigned HOST_WIDE_INT, unsigned int)
bool decl_readonly_section (const_tree, int)
int compute_reloc_for_constant (tree)
void default_function_pro_epilogue (FILE *, HOST_WIDE_INT)
void default_function_switched_text_sections (FILE *, tree, bool)
void no_asm_to_stream (FILE *)
sectionget_unnamed_section (unsigned int, void(*)(const void *), const void *)
sectionget_section (const char *, unsigned int, tree)
sectionget_named_section (tree, const char *, int)
sectionget_variable_section (tree, bool)
void place_block_symbol (rtx)
rtx get_section_anchor (struct object_block *, HOST_WIDE_INT, enum tls_model)
sectionmergeable_constant_section (enum machine_mode, unsigned HOST_WIDE_INT, unsigned int)
sectionfunction_section (tree)
sectionunlikely_text_section (void)
sectioncurrent_function_section (void)
sectionget_cdtor_priority_section (int, bool)
bool unlikely_text_section_p (section *)
void switch_to_section (section *)
void output_section_asm_op (const void *)
void record_tm_clone_pair (tree, tree)
void finish_tm_clone_pairs (void)
tree get_tm_clone_pair (tree)
void default_asm_output_source_filename (FILE *, const char *)
void output_file_directive (FILE *, const char *)
unsigned int default_section_type_flags (tree, const char *, int)
bool have_global_bss_p (void)
bool bss_initializer_p (const_tree)
void default_no_named_section (const char *, unsigned int, tree)
void default_elf_asm_named_section (const char *, unsigned int, tree)
enum section_category categorize_decl_for_section (const_tree, int)
void default_coff_asm_named_section (const char *, unsigned int, tree)
void default_pe_asm_named_section (const char *, unsigned int, tree)
void default_named_section_asm_out_destructor (rtx, int)
void default_dtor_section_asm_out_destructor (rtx, int)
void default_named_section_asm_out_constructor (rtx, int)
void default_ctor_section_asm_out_constructor (rtx, int)
sectiondefault_select_section (tree, int, unsigned HOST_WIDE_INT)
sectiondefault_elf_select_section (tree, int, unsigned HOST_WIDE_INT)
void default_unique_section (tree, int)
sectiondefault_function_rodata_section (tree)
sectiondefault_no_function_rodata_section (tree)
sectiondefault_clone_table_section (void)
sectiondefault_select_rtx_section (enum machine_mode, rtx, unsigned HOST_WIDE_INT)
sectiondefault_elf_select_rtx_section (enum machine_mode, rtx, unsigned HOST_WIDE_INT)
void default_encode_section_info (tree, rtx, int)
const char * default_strip_name_encoding (const char *)
void default_asm_output_anchor (rtx)
bool default_use_anchors_for_symbol_p (const_rtx)
bool default_binds_local_p (const_tree)
bool default_binds_local_p_1 (const_tree, int)
void default_globalize_label (FILE *, const char *)
void default_globalize_decl_name (FILE *, tree)
void default_emit_unwind_label (FILE *, tree, int, int)
void default_emit_except_table_label (FILE *)
void default_generate_internal_label (char *, const char *, unsigned long)
void default_internal_label (FILE *, const char *, unsigned long)
void default_asm_declare_constant_name (FILE *, const char *, const_tree, HOST_WIDE_INT)
void default_file_start (void)
void file_end_indicate_exec_stack (void)
void file_end_indicate_split_stack (void)
void default_elf_asm_output_external (FILE *file, tree, const char *)
void default_elf_asm_output_limited_string (FILE *, const char *)
void default_elf_asm_output_ascii (FILE *, const char *, unsigned int)
void default_elf_internal_label (FILE *, const char *, unsigned long)
void default_elf_init_array_asm_out_constructor (rtx, int)
void default_elf_fini_array_asm_out_destructor (rtx, int)
int maybe_assemble_visibility (tree)
int default_address_cost (rtx, enum machine_mode, addr_space_t, bool)
void output_stack_usage (void)

Variables

rtx final_sequence
int sdb_begin_function_line
FILE * asm_out_file
const char * first_global_object_name
const char * weak_global_object_name
rtx current_insn_predicate
rtx current_output_insn
rtx this_is_asm_operands
int size_directive_output
tree last_assemble_variable_decl
bool first_function_block_is_cold
const char * user_label_prefix
sectiontext_section
sectiondata_section
sectionreadonly_data_section
sectionsdata_section
sectionctors_section
sectiondtors_section
sectionbss_section
sectionsbss_section
sectionexception_section
sectioneh_frame_section
sectiontls_comm_section
sectioncomm_section
sectionlcomm_section
sectionbss_noswitch_section
sectionin_section
bool in_cold_section_p

Typedef Documentation

typedef bool(* noswitch_section_callback)(tree decl, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded)
   A callback that writes the assembly code for a decl in a
   SECTION_NOSWITCH section.  DECL is the decl that should be assembled
   and NAME is the name of its SYMBOL_REF.  SIZE is the size of the decl
   in bytes and ROUNDED is that size rounded up to the next
   BIGGEST_ALIGNMENT / BITS_PER_UNIT boundary.

   Return true if the callback used DECL_ALIGN to set the object's
   alignment.  A false return value implies that we are relying
   on the rounded size to align the decl.  
typedef void(* unnamed_section_callback)(const void *)
   A callback that writes the assembly code for switching to an unnamed
   section.  The argument provides callback-specific data.  

Enumeration Type Documentation

   A helper function for default_elf_select_section and
   default_elf_unique_section.  Categorizes the DECL.  
Enumerator:
SECCAT_TEXT 
SECCAT_RODATA 
SECCAT_RODATA_MERGE_STR 
SECCAT_RODATA_MERGE_STR_INIT 
SECCAT_RODATA_MERGE_CONST 
SECCAT_SRODATA 
SECCAT_DATA 
SECCAT_DATA_REL 
     To optimize loading of shared programs, define following subsections
     of data section:
        _REL    Contains data that has relocations, so they get grouped
                together and dynamic linker will visit fewer pages in memory.
        _RO     Contains data that is otherwise read-only.  This is useful
                with prelinking as most relocations won't be dynamically
                linked and thus stay read only.
        _LOCAL  Marks data containing relocations only to local objects.
                These relocations will get fully resolved by prelinking.  
SECCAT_DATA_REL_LOCAL 
SECCAT_DATA_REL_RO 
SECCAT_DATA_REL_RO_LOCAL 
SECCAT_SDATA 
SECCAT_TDATA 
SECCAT_BSS 
SECCAT_SBSS 
SECCAT_TBSS 

Function Documentation

void align_variable ( tree  decl,
bool  dont_output_data 
)
   Compute the alignment of variable specified by DECL.
   DONT_OUTPUT_DATA is from assemble_variable.  

Referenced by cgraph_variable_initializer_availability().

rtx alter_subreg ( rtx ,
bool   
)
   Replace a SUBREG with a REG or a MEM, based on the thing it is a
   subreg of.  
void app_disable ( void  )
   Disable APP processing of subsequent output.
   Called from varasm.c before most kinds of output.  
void app_enable ( void  )
   Enable APP processing of subsequent output.
   Used before the output from an `asm' statement.  
void asm_fprintf ( FILE *  file,
const char *  p,
  ... 
)
void assemble_addr_to_section ( rtx  ,
section  
)
   Write the address of the entity given by SYMBOL to SEC.  
void assemble_align ( int  )
   Assemble an alignment pseudo op for an ALIGN-bit boundary.  

Referenced by default_ctor_section_asm_out_constructor(), and weak_finish_1().

void assemble_asm ( tree  )
   Output a string of literal assembler code
   for an `asm' keyword used between functions.  

Referenced by expand_all_functions().

void assemble_end_function ( tree  ,
const char *   
)
   Output assembler code associated with defining the size of the
   function.  DECL describes the function.  NAME is the function's name.  
void assemble_external ( tree  )
   Queue for outputting something to declare an external symbol to the
   assembler.  (Most assemblers don't need this, so we normally output
   nothing.)  Do nothing if DECL is not external.  
void assemble_external_libcall ( rtx  )
   Similar, for calling a library function FUN.  
bool assemble_integer ( rtx  ,
unsigned  ,
unsigned  ,
int   
)
   Assemble the integer constant X into an object of SIZE bytes.  ALIGN is
   the alignment of the integer in bits.  Return 1 if we were able to output
   the constant, otherwise 0.  If FORCE is nonzero the constant must
   be outputable. 

Referenced by assemble_static_space(), dw2_asm_output_data_sleb128(), final_start_function(), initializer_constant_valid_p_1(), output_constant(), and output_constructor_regular_field().

void assemble_integer_with_op ( const char *  ,
rtx   
)
   Use directive OP to assemble an integer object X.  Print OP at the
   start of the line, followed immediately by the value of X.  

Referenced by ultimate_transparent_alias_target().

void assemble_label ( FILE *  ,
const char *   
)
   Assemble a label named NAME.  
void assemble_name ( FILE *  ,
const char *   
)
   Like assemble_name_raw, but should be used when NAME might refer to
   an entity that is also represented as a tree (like a function or
   variable).  If NAME does refer to such an entity, that entity will
   be marked as referenced.  

Referenced by sdbout_begin_block().

void assemble_name_raw ( FILE *  ,
const char *   
)
   Output to FILE (an assembly file) a reference to NAME.  If NAME
   starts with a *, the rest of NAME is output verbatim.  Otherwise
   NAME is transformed in a target-specific way (usually by the
   addition of an underscore).  
void assemble_real ( REAL_VALUE_TYPE  ,
enum  machine_mode,
unsigned   
)
   Assemble the floating-point constant D into an object of size MODE.  

Referenced by const_desc_rtx_eq(), and initializer_constant_valid_p_1().

void assemble_start_function ( tree  ,
const char *   
)
   Output assembler code for the constant pool of a function and associated
   with defining the name of the function.  DECL describes the function.
   NAME is the function's name.  For the constant pool, we use the current
   constant pool data.  
void assemble_string ( const char *  ,
int   
)
   Assemble a string constant with the specified C string as contents.  

Referenced by initializer_constant_valid_p_1(), and lhd_builtin_function().

void assemble_variable ( tree  decl,
int  top_level,
int  at_end,
int  dont_output_data 
)
   Assemble everything that is needed for a variable or function declaration.
   Not used for automatic variables, and not used for function definitions.
   Should not be called for variables of incomplete structure type.

   TOP_LEVEL is nonzero if this variable has file scope.
   AT_END is nonzero if this is the special handling, at end of compilation,
   to define things that have had only tentative definitions.
   DONT_OUTPUT_DATA if nonzero means don't actually output the
   initial value (that will be done by the caller).  
     This function is supposed to handle VARIABLES.  Ensure we have one.  
     Emulated TLS had better not get this far.  
     Normally no need to say anything here for external references,
     since assemble_external is called by the language-specific code
     when a declaration is first seen.  
     Do nothing for global register variables.  
     If type was incomplete when the variable was declared,
     see if it is complete now.  
     Still incomplete => don't allocate it; treat the tentative defn
     (which is what it must have been) as an `extern' reference.  
     The first declaration of a variable that comes through this function
     decides whether it is global (in C, has external linkage)
     or local (in C, has internal linkage).  So do nothing more
     if this function has already run.  
     Make sure targetm.encode_section_info is invoked before we set
     ASM_WRITTEN.  
     Do no output if -fsyntax-only.  
     If this symbol belongs to the tree constant pool, output the constant
     if it hasn't already been written.  
     Compute the alignment of this data.  
     First make the assembler name(s) global if appropriate.  
     Output any data that we will need to use the address of.  
     dbxout.c needs to know this.  
     If the decl is part of an object_block, make sure that the decl
     has been positioned within its block, but do not write out its
     definition yet.  output_object_blocks will do that later.  
         The following bit of code ensures that vtable_map 
         variables are not only in the comdat section, but that
         each variable has its own unique comdat name.  If this
         code is removed, the variables end up in the same section
         with a single comdat name.

         FIXME:  resolve_unique_section needs to deal better with
         decls with both DECL_SECTION_NAME and DECL_ONE_ONLY.  Once
         that is fixed, this if-else statement can be replaced with
         a single call to "switch_to_section (sect)".  
void assemble_vtv_preinit_initializer ( tree  )
   Put the vtable verification constructor initialization function
   into the preinit array.  
void assemble_zeros ( unsigned  HOST_WIDE_INT)
bool bss_initializer_p ( const_tree  )
enum section_category categorize_decl_for_section ( const_tree  ,
int   
)

Referenced by make_decl_one_only().

int compute_reloc_for_constant ( tree  )
   This can be used to compute RELOC for the function above, when
   given a constant expression.  

Referenced by compare_constant().

section* current_function_section ( void  )
   Return the section for the current function, take IN_COLD_SECTION_P
   into account.  
int dbr_sequence_length ( void  )
   Return the number of slots filled in the current
   delayed branch sequence (we don't count the insn needing the
   delay slot).   Zero if not in a delayed branch sequence.  

References label_alignment::alignment, and label_alignment::max_skip.

bool decl_readonly_section ( const_tree  ,
int   
)
   Decide whether DECL needs to be in a writable section.
   RELOC is the same as for SELECT_SECTION.  
int decode_reg_name ( const char *  )
   Decode an `asm' spec for a declaration as a register name.
   Return the register number, or -1 if nothing specified,
   or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized,
   or -3 if ASMSPEC is `cc' and is not recognized,
   or -4 if ASMSPEC is `memory' and is not recognized.
   Accept an exact spelling or a decimal number.
   Prefixes such as % are optional.  
int decode_reg_name_and_count ( const char *  ,
int *   
)
   Similar to decode_reg_name, but takes an extra parameter that is a
   pointer to the number of (internal) registers described by the
   external name.  
int default_address_cost ( rtx  ,
enum  machine_mode,
addr_space_t  ,
bool   
)
void default_asm_declare_constant_name ( FILE *  file,
const char *  name,
const_tree  exp,
HOST_WIDE_INT  size 
)
   The default implementation of ASM_DECLARE_CONSTANT_NAME.  
void default_asm_output_anchor ( rtx  )
void default_asm_output_source_filename ( FILE *  ,
const char *   
)
bool default_assemble_integer ( rtx  x,
unsigned int  size,
int  aligned_p 
)
   The default implementation of the asm_out.integer target hook.  
     Avoid GAS bugs for large values.  Specifically negative values whose
     absolute value fits in a bfd_vma, but not in a bfd_signed_vma.  

References const_hash_1(), fixed_hash(), and real_hash().

void default_assemble_visibility ( tree  decl,
int  vis 
)
   Emit an assembler directive to set symbol for DECL visibility to
   the visibility type VIS, which must not be VISIBILITY_DEFAULT.  
bool default_binds_local_p ( const_tree  )
bool default_binds_local_p_1 ( const_tree  ,
int   
)
section* default_clone_table_section ( void  )
   Provide a default for the tm_clone_table section.  
void default_coff_asm_named_section ( const char *  ,
unsigned  int,
tree   
)
void default_ctor_section_asm_out_constructor ( rtx  ,
int   
)
void default_dtor_section_asm_out_destructor ( rtx  ,
int   
)
void default_elf_asm_named_section ( const char *  ,
unsigned  int,
tree   
)
     If we have already declared this section, we can use an
     abbreviated form to switch back to it -- unless this section is
     part of a COMDAT groups, in which case GAS requires the full
     declaration every time.  
         On platforms that use "@" as the assembly comment character,
         use "%" instead.  
void default_elf_asm_output_ascii ( FILE *  ,
const char *  ,
unsigned  int 
)
void default_elf_asm_output_external ( FILE *  file,
tree  decl,
const char *  name 
)
   Emit text to declare externally defined symbols. It is needed to
   properly support non-default visibility.  
     We output the name if and only if TREE_SYMBOL_REFERENCED is
     set in order to avoid putting out names that are never really
     used. 
void default_elf_asm_output_limited_string ( FILE *  ,
const char *   
)
void default_elf_fini_array_asm_out_destructor ( rtx  ,
int   
)
void default_elf_init_array_asm_out_constructor ( rtx  ,
int   
)
void default_elf_internal_label ( FILE *  ,
const char *  ,
unsigned  long 
)
section* default_elf_select_rtx_section ( enum  machine_mode,
rtx  ,
unsigned  HOST_WIDE_INT 
)
     ??? Handle small data here somehow.  

References constant_descriptor_rtx::align, and constant_descriptor_rtx::mode.

section* default_elf_select_section ( tree  decl,
int  reloc,
unsigned HOST_WIDE_INT  align 
)
   Select a section based on the above categorization.  
         We're not supposed to be called on FUNCTION_DECLs.  

References decl_binds_to_current_def_p().

void default_emit_except_table_label ( FILE *  )
void default_emit_unwind_label ( FILE *  stream,
tree  decl,
int  for_eh,
int  empty 
)
   Default function to output a label for unwind information.  The
   default is to do nothing.  A target that needs nonlocal labels for
   unwind information must provide its own function to do this.  
void default_encode_section_info ( tree  ,
rtx  ,
int   
)
void default_file_start ( void  )
   This is the default behavior at the beginning of a file.  It's
   controlled by two other target-hook toggles.  
void default_function_pro_epilogue ( FILE *  file,
HOST_WIDE_INT  size 
)
   Default target function prologue and epilogue assembler output.  
   Default target function prologue and epilogue assembler output.

   If not overridden for epilogue code, then the function body itself
   contains return instructions wherever needed.  

Referenced by reemit_insn_block_notes().

section* default_function_rodata_section ( tree  )
void default_function_switched_text_sections ( FILE *  ,
tree  ,
bool   
)
   Default target function switched text sections.  

References app_on, and asm_out_file.

void default_generate_internal_label ( char *  buf,
const char *  prefix,
unsigned long  labelno 
)
   This is how to output an internal numbered label where PREFIX is
   the class of label and LABELNO is the number within the class.  
void default_globalize_decl_name ( FILE *  ,
tree   
)
void default_globalize_label ( FILE *  ,
const char *   
)
void default_internal_label ( FILE *  stream,
const char *  prefix,
unsigned long  labelno 
)
   This is how to output an internal numbered label where PREFIX is
   the class of label and LABELNO is the number within the class.  

References len, and limit.

void default_named_section_asm_out_constructor ( rtx  ,
int   
)
void default_named_section_asm_out_destructor ( rtx  ,
int   
)
section* default_no_function_rodata_section ( tree  )
void default_no_named_section ( const char *  name,
unsigned int  flags,
tree  decl 
)
   Output assembly to switch to section NAME with attribute FLAGS.
   Four variants for common object file formats.  
     Some object formats don't support named sections at all.  The
     front-end should already have flagged this as an error.  

References targetm.

void default_pe_asm_named_section ( const char *  ,
unsigned  int,
tree   
)
         Functions may have been compiled at various levels of
         optimization so we can't use `same_size' here.
         Instead, have the linker pick one.  
unsigned int default_section_type_flags ( tree  ,
const char *  ,
int   
)
section* default_select_rtx_section ( enum  machine_mode,
rtx  ,
unsigned  HOST_WIDE_INT 
)

References offset.

section* default_select_section ( tree  decl,
int  reloc,
unsigned HOST_WIDE_INT  align 
)
   The lame default section selector.  

References resolution_local_p(), resolution_to_local_definition_p(), and varpool_get_node().

const char* default_strip_name_encoding ( const char *  )
void default_unique_section ( tree  ,
int   
)
bool default_use_anchors_for_symbol_p ( const_rtx  )
void do_assemble_alias ( tree  ,
tree   
)
void file_end_indicate_exec_stack ( void  )
void file_end_indicate_split_stack ( void  )
   Emit a special section directive to indicate that this object file
   was compiled with -fsplit-stack.  This is used to let the linker
   detect calls between split-stack code and non-split-stack code, so
   that it can modify the split-stack code to allocate a sufficiently
   large stack.  We emit another special section if there are any
   functions in this file which have the no_split_stack attribute, to
   prevent the linker from warning about being unable to convert the
   functions if they call non-split-stack code.  
void final ( rtx  ,
FILE *  ,
int   
)
   Output assembler code for some insns: all or part of a function.  
void final_end_function ( void  )
   Output assembler code for the end of a function.
   For clarity, args are same as those of `final_start_function'
   even though not all of them are needed.  
     Finally, output the function epilogue:
     code to restore the stack frame and return to the caller.  
     And debug output.  
int final_forward_branch_p ( rtx  )
   Return 1 if branch is a forward branch.
   Uses insn_shuid array, so it works only in the final pass.  May be used by
   output templates to add branch prediction hints, for example.  
rtx final_scan_insn ( rtx  insn,
FILE *  file,
int  optimize_p,
int  nopeepholes,
int *  seen 
)
   The final scan for one insn, INSN.  Args are same as in `final', except
   that INSN is the insn being scanned.  Value returned is the next insn to
   be scanned.  
   The final scan for one insn, INSN.
   Args are same as in `final', except that INSN
   is the insn being scanned.
   Value returned is the next insn to be scanned.

   NOPEEPHOLES is the flag to disallow peephole processing (currently
   used for within delayed branch sequence output).

   SEEN is used to track the end of the prologue, for emitting
   debug information.  We force the emission of a line note after
   both NOTE_INSN_PROLOGUE_END and NOTE_INSN_FUNCTION_BEG, or
   at the beginning of the second basic block, whichever comes
   first.  
     Ignore deleted insns.  These can occur when we split insns (due to a
     template of "#") while not optimizing.  
                 Output debugging info about the symbol-block beginning.  
                 Mark this block as output.  
                 End of a symbol-block.  
             Emit the label.  We may have deleted the CODE_LABEL because
             the label could be proved to be unreachable, though still
             referenced (in the form of having its address taken.  
             Similarly, but need to use different namespace for it.  
         The target port might emit labels in the output function for
         some insn, e.g. sh.c output_branchy_insn.  
         If this label is followed by a jump-table, make sure we put
         the label in the read-only section.  Also possibly write the
         label and jump table together.  
             In this case, the case vector is being moved by the
             target, so don't output the label at all.  Leave that
             to the back end macros.  
           Reset this early so it is correct for ASM statements.  
           An INSN, JUMP_INSN or CALL_INSN.
           First check for special kinds that recog doesn't recognize.  
             If there is a REG_CC_SETTER note on this insn, it means that
             the setting of the condition code was done in the delay slot
             of the insn that branched here.  So recover the cc status
             from the insn that set it.  
           Detect insns that are really jump-tables
           and output them as such.  
           Output this line note if it is the first or the last line
           note in a row.  
               There's no telling what that did to the condition codes.  
           Detect `asm' construct with operands.  
               There's no telling what that did to the condition codes.  
               Get out the operand values.  
               Inhibit dying on what would otherwise be compiler bugs.  
               Output the insn using them.  
               A delayed-branch sequence 
               The first insn in this SEQUENCE might be a JUMP_INSN that will
               force the restoration of a comparison that was previously
               thought unnecessary.  If that happens, cancel this sequence
               and cause that insn to be restored.  
                   We loop in case any instruction in a delay slot gets
                   split.  
               If the insn requiring the delay slot was a CALL_INSN, the
               insns in the delay slot are actually executed before the
               called function.  Hence we don't preserve any CC-setting
               actions in these insns and the CC must be marked as being
               clobbered by the function.  
           We have a real machine instruction as rtl.  
           Check for redundant test and compare instructions
           (when the condition codes are already set up as desired).
           This is done only when optimizing; if not optimizing,
           it should be possible for the user to alter a variable
           with the debugger in between statements
           and the next statement should reexamine the variable
           to compute the condition codes.  
                       Don't delete insn if it has an addressing side-effect.  
                           or if anything in it is volatile.  
                           We don't really delete the insn; just ignore it.  
           If this is a conditional branch, maybe modify it
           if the cc's are in a nonstandard state
           so that it accomplishes the same thing that it would
           do straightforwardly if the cc's were set up normally.  
               This function may alter the contents of its argument
               and clear some of the cc_status.flags bits.
               It may also return 1 meaning condition now always true
               or -1 meaning condition now always false
               or 2 meaning condition nontrivial but altered.  
               If condition now has fixed value, replace the IF_THEN_ELSE
               with its then-operand or its else-operand.  
               The jump is now either unconditional or a no-op.
               If it has become a no-op, don't try to output it.
               (It would not be recognized.)  
                 Replace (set (pc) (return)) with (return).  
               Rerecognize the instruction if it has changed.  
           If this is a conditional trap, maybe modify it if the cc's
           are in a nonstandard state so that it accomplishes the same
           thing that it would do straightforwardly if the cc's were
           set up normally.  
               This function may alter the contents of its argument
               and clear some of the cc_status.flags bits.
               It may also return 1 meaning condition now always true
               or -1 meaning condition now always false
               or 2 meaning condition nontrivial but altered.  
               If TRAP_CONDITION has become always false, delete the
               instruction.  
               If TRAP_CONDITION has become always true, replace
               TRAP_CONDITION with const_true_rtx.  
               Rerecognize the instruction if it has changed.  
           Make same adjustments to instructions that examine the
           condition codes without jumping and instructions that
           handle conditional moves (if this machine has either one).  
           Do machine-specific peephole optimizations if desired.  
               When peepholing, if there were notes within the peephole,
               emit them before the peephole.  
                   Put the notes in the proper position for a later
                   rescan.  For example, the SH target can do this
                   when generating a far jump in a delayed branch
                   sequence.  
               PEEPHOLE might have changed this.  
           Try to recognize the instruction.
           If successful, verify that the operands satisfy the
           constraints for the instruction.  Crash if they don't,
           since `reload' should have changed them so that they do.  
           Dump the insn in the assembly for debugging (-dAP).
           If the final dump is requested as slim RTL, dump slim
           RTL to the assembly file also.  
           Some target machines need to prescan each insn before
           it is output.  
           Update `cc_status' for this instruction.
           The instruction's output routine may change it further.
           If the output routine for a jump insn needs to depend
           on the cc status, it should look at cc_prev_status.  
           Find the proper template for this insn.  
           If the C code returns 0, it means that it is a jump insn
           which follows a deleted test insn, and that test insn
           needs to be reinserted.  
               We have already processed the notes between the setter and
               the user.  Make sure we don't process them again, this is
               particularly important if one of the notes is a block
               scope note or an EH note.  
           If the template is the string "#", it means that this insn must
           be split.  
               If we didn't split the insn, go away.  
               If we have a length attribute, this instruction should have
               been split in shorten_branches, to ensure that we would have
               valid length info for the splitees.  
           ??? This will put the directives in the wrong place if
           get_insn_template outputs assembly directly.  However calling it
           before get_insn_template breaks if the insns is split.  
           Output assembler code from the template.  
           Some target machines need to postscan each insn after
           it is output.  

References debug_hooks.

void final_start_function ( rtx  first,
FILE *  file,
int  optimize_p 
)
   Output assembler code for the start of a function,
   and initialize some of the variables in this file
   for the new function.  The label for the function and associated
   assembler pseudo-ops have already been output in
   `assemble_start_function'.  
   Output assembler code for the start of a function,
   and initialize some of the variables in this file
   for the new function.  The label for the function and associated
   assembler pseudo-ops have already been output in `assemble_start_function'.

   FIRST is the first insn of the rtl for the function being compiled.
   FILE is the file to write assembler code to.
   OPTIMIZE_P is nonzero if we should eliminate redundant
     test and compare insns.  
     The Sun386i and perhaps other machines don't work right
     if the profiling code comes after the prologue.  
     If debugging, assign block numbers to all of the blocks in this
     function.  
         We never actually put out begin/end notes for the top-level
         block in the function.  But, conceptually, that block is
         always needed.  
         Issue a warning 
     First output the function prologue: code to set up the stack frame.  
     If the machine represents the prologue as RTL, the profiling code must
     be emitted when NOTE_INSN_PROLOGUE_END is scanned.  

References assemble_integer(), data_section, floor_log2(), switch_to_section(), and targetm.

void finish_tm_clone_pairs ( void  )
     We need a determenistic order for the .tm_clone_table, otherwise
     we will get bootstrap comparison failures, so dump the hash table
     to a vector, sort it, and dump the vector.  
     Dump the hashtable to a vector.  
     Sort it.  
     Dump it.  

Referenced by emit_debug_global_declarations().

void fprint_ul ( FILE *  ,
unsigned  long 
)
void fprint_whex ( FILE *  ,
unsigned  HOST_WIDE_INT 
)
section* function_section ( tree  )
int get_attr_length ( rtx  )
   Obtain the current length of an insn.  If branch shortening has been done,
   get its actual length.  Otherwise, get its maximum length.  
int get_attr_min_length ( rtx  )
   Obtain the current length of an insn.  If branch shortening has been done,
   get its actual length.  Otherwise, get its minimum length.  
section* get_cdtor_priority_section ( int  ,
bool   
)
   Return the numbered .ctors.N (if CONSTRUCTOR_P) or .dtors.N (if
   not) section for PRIORITY.  
const char* get_insn_template ( int  ,
rtx   
)
   Locate the proper template for the given insn-code.  
section* get_named_section ( tree  ,
const char *  ,
int   
)
section* get_named_text_section ( tree  decl,
const char *  text_section_name,
const char *  named_section_suffix 
)
   Return section for TEXT_SECITON_NAME if DECL or DECL_SECTION_NAME (DECL)
   is NULL.  
   Return section for TEXT_SECTION_NAME if DECL or DECL_SECTION_NAME (DECL)
   is NULL.

   When DECL_SECTION_NAME is non-NULL and it is implicit section and
   NAMED_SECTION_SUFFIX is non-NULL, then produce section called
   concatenate the name with NAMED_SECTION_SUFFIX.
   Otherwise produce "TEXT_SECTION_NAME.IMPLICIT_NAME".  
             Do not try to split gnu_linkonce functions.  This gets somewhat
             slipperly.  

References get_named_text_section(), NODE_FREQUENCY_HOT, and NODE_FREQUENCY_UNLIKELY_EXECUTED.

Referenced by get_named_text_section().

int get_pool_size ( void  )
   Return the size of the constant pool.  
section* get_section ( const char *  ,
unsigned  int,
tree   
)
rtx get_section_anchor ( struct object_block block,
HOST_WIDE_INT  offset,
enum tls_model  model 
)
   Return the anchor that should be used to address byte offset OFFSET
   from the first object in BLOCK.  MODEL is the TLS model used
   to access it.  
     Work out the anchor's offset.  Use an offset of 0 for the first
     anchor so that we don't pessimize the case where we take the address
     of a variable at the beginning of the block.  This is particularly
     useful when a block has only one variable assigned to it.

     We try to place anchors RANGE bytes apart, so there can then be
     anchors at +/-RANGE, +/-2 * RANGE, and so on, up to the limits of
     a ptr_mode offset.  With some target settings, the lowest such
     anchor might be out of range for the lowest ptr_mode offset;
     likewise the highest anchor for the highest offset.  Use anchors
     at the extreme ends of the ptr_mode range in such cases.

     All arithmetic uses unsigned integers in order to avoid
     signed overflow.  
     Do a binary search to see if there's already an anchor we can use.
     Set BEGIN to the new anchor's index if not.  
     Create a new anchor with a unique label.  
     Insert it at index BEGIN.  
tree get_tm_clone_pair ( tree  )
section* get_unnamed_section ( unsigned int  flags,
void(*)(const void *)  callback,
const void *  data 
)
   Return a new unnamed section with the given fields.  
section* get_variable_section ( tree  ,
bool   
)
bool have_global_bss_p ( void  )
   Return true if the target supports some form of global BSS,
   either through bss_noswitch_section, or by selecting a BSS
   section in TARGET_ASM_SELECT_SECTION.  
void init_final ( const char *  )
   Initialize data in final at the beginning of a compilation.  
void init_insn_lengths ( void  )
   Indicate that branch shortening hasn't yet been done.  
int insn_current_reference_address ( rtx  )
   Compute a worst-case reference address of a branch so that it
   can be safely used in the presence of aligned labels.
   Defined in final.c.  
const char* integer_asm_op ( int  ,
int   
)
   Return the assembler directive for creating a given kind of integer
   object.  SIZE is the number of bytes in the object and ALIGNED_P
   indicates whether it is known to be aligned.  Return NULL if the
   assembly dialect has no such directive.

   The returned string should be printed at the start of a new line and
   be followed immediately by the object's initial value.  

Referenced by ultimate_transparent_alias_target().

int label_to_alignment ( rtx  )
   Find the alignment associated with a CODE_LABEL.
   Defined in final.c.  
int label_to_max_skip ( rtx  )
   Find the alignment maximum skip associated with a CODE_LABEL.
   Defined in final.c.  
void int leaf_function_p ( void  )
   Return nonzero if this function has no function calls.  

Referenced by split_live_ranges_for_shrink_wrap().

void leaf_renumber_regs_insn ( rtx  )
   Scan IN_RTX and its subexpressions, and renumber all regs into those
   available in leaf functions.  
void mark_symbol_refs_as_used ( rtx  )
   Marks SYMBOL_REFs in x as referenced through use of assemble_external.  
int maybe_assemble_visibility ( tree  )

Referenced by decide_function_section().

section* mergeable_constant_section ( enum machine_mode  mode,
unsigned HOST_WIDE_INT  align,
unsigned int  flags 
)
   Return the section to use for constant merging.  

References strip_reg_name(), and strlen().

void no_asm_to_stream ( FILE *  )
   Default target hook that outputs nothing to a stream.  
int only_leaf_regs_used ( void  )
   Return 1 if this function uses only the registers that can be
   safely renumbered.  
   On some machines, a function with no call insns
   can run faster if it doesn't create its own register window.
   When output, the leaf function should use only the "output"
   registers.  Ordinarily, the function would be compiled to use
   the "input" registers to find its arguments; it is a candidate
   for leaf treatment if it uses only the "input" registers.
   Leaf function treatment means renumbering so the function
   uses the "output" registers instead.  
   Return 1 if this function uses only the registers that can be
   safely renumbered.  
void output_addr_const ( FILE *  ,
rtx   
)
   Print an integer constant expression in assembler syntax.
   Addition and subtraction are the only arithmetic
   that may appear in these expressions.  
void output_address ( rtx  )
   Print a memory reference operand for address X
   using machine-dependent assembler syntax.  
void output_asm_insn ( const char *  ,
rtx  
)
   Output a string of assembler code, substituting insn operands.
   Defined in final.c.  
void output_asm_label ( rtx  )
   Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol.  
void output_constant ( tree  ,
unsigned  HOST_WIDE_INT,
unsigned  int 
)
   Output assembler code for constant EXP to FILE, with no label.
   This includes the pseudo-op such as ".int" or ".byte", and a newline.
   Assumes output_addressed_constants has been done on EXP already.

   Generate exactly SIZE bytes of assembler data, padding at the end
   with zeros if necessary.  SIZE must always be specified.

   ALIGN is the alignment in bits that may be assumed for the data.  

Referenced by assemble_string(), and initializer_constant_valid_p_1().

void output_file_directive ( FILE *  ,
const char *   
)
void output_object_blocks ( void  )
   Output the definitions of all object_blocks.  

Referenced by emit_debug_global_declarations().

void output_operand ( rtx  ,
int   
)
   Print an operand using machine-dependent assembler syntax.  
void output_operand_lossage ( const char *  ,
  ... 
)
   Report inconsistency between the assembler template and the operands.
   In an `asm', it's the user's fault; otherwise, the compiler's fault.  
void output_quoted_string ( FILE *  ,
const char *   
)
void output_section_asm_op ( const void *  )
void output_shared_constant_pool ( void  )
   Write the contents of the shared constant pool.  

Referenced by emit_debug_global_declarations().

void output_stack_usage ( void  )
   Output stack usage information.  
     Add the maximum amount of space pushed onto the stack.  
     Now on to the tricky part: dynamic stack allocation.  
         Add the size even in the unbounded case, this can't hurt.  
         We don't want to print the full qualified name because it can be long,
         so we strip the scope prefix, but we may need to deal with the suffix
         created by the compiler.  
rtx peephole ( rtx  )
void place_block_symbol ( rtx  )
void record_tm_clone_pair ( tree  ,
tree   
)
void shorten_branches ( rtx  )
   Make a pass over all insns and compute their actual lengths by shortening
   any branches of variable length if possible.  
int sprint_ul ( char *  ,
unsigned  long 
)
section* unlikely_text_section ( void  )
   Tell assembler to switch to unlikely-to-be-executed text section.  

References get_section(), memcpy(), and strlen().

Referenced by default_ctor_section_asm_out_constructor().

bool unlikely_text_section_p ( section )
void weak_finish ( void  )
   Functions in varasm.c.  
   Emit any pending weak declarations.  
   Emit any pending weak declarations.  
           Remove alias_decl from the weak list, but leave entries for
           the target alone.  
             Use ASM_WEAKEN_LABEL only if ASM_WEAKEN_DECL is not
             defined, otherwise we and weak_finish_1 would use
             different macros.  
           Remove the alias and the target from the pending weak list
           so that we do not emit any .weak directives for the former,
           nor multiple .weak directives for the latter.  
           Remove other weakrefs to the same target, to speed things up.  

Referenced by emit_debug_global_declarations().


Variable Documentation

section* bss_noswitch_section
   A SECTION_NOSWITCH section used for declaring global BSS variables.
   May be null.  
section* bss_section
section* comm_section
section* ctors_section
rtx current_insn_predicate
   Nonnull if the insn currently being emitted was a COND_EXEC pattern.  
rtx current_output_insn
   Last insn processed by final_scan_insn.  
section* data_section

Referenced by final_start_function().

section* dtors_section
section* eh_frame_section
   The section that holds the DWARF2 frame unwind information, when known.
   The section is set either by the target's init_sections hook or by the
   first call to switch_to_eh_frame_section.  
section* exception_section
   The section that holds the main exception table, when known.  The section
   is set either by the target's init_sections hook or by the first call to
   switch_to_exception_section.  
rtx final_sequence
   When outputting delayed branch sequences, this rtx holds the
   sequence being output.  It is null when no delayed branch
   sequence is being output, so it can be used as a test in the
   insn output code.

   This variable is defined  in final.c.  
   If we are outputting an insn sequence, this contains the sequence rtx.
   Zero otherwise.  
bool first_function_block_is_cold
   The following global variable indicates if the first basic block
   in a function belongs to the cold partition or not.  

Referenced by default_ctor_section_asm_out_constructor().

const char * first_global_object_name
   The first global object in the file.  

Referenced by make_decl_rtl_for_debug().

bool in_cold_section_p
   True if code for the current function is currently being directed
   at the cold section.  
section* in_section
   asm_out_file's current section.  This is NULL if no section has yet
   been selected or if we lose track of what the current section is.  
tree last_assemble_variable_decl
   The last decl for which assemble_variable was called,
   if it did ASM_DECLARE_OBJECT_NAME.
   If the last call to assemble_variable didn't do that,
   this holds 0.  
section* lcomm_section
section* readonly_data_section
section* sbss_section
section* sdata_section
int sdb_begin_function_line
   The line number of the beginning of the current function.  Various
   md code needs this so that it can output relative linenumbers.  
   Line number of beginning of current function, minus one.
   Negative means not in a function or not using sdb.  
int size_directive_output
   Carry information from ASM_DECLARE_OBJECT_NAME
   to ASM_FINISH_DECLARE_OBJECT.  
section* text_section
   Special well-known sections.  
   Well-known sections, each one associated with some sort of *_ASM_OP.  

Referenced by resolve_unique_section().

rtx this_is_asm_operands
   Nonzero while outputting an `asm' with operands.
   This means that inconsistencies are the user's fault, so don't die.
   The precise value is the insn being output, to pass to error_for_asm.  
section* tls_comm_section
   Various forms of common section.  All are guaranteed to be nonnull.  
const char* user_label_prefix
   User label prefix in effect for this compilation.  

Referenced by crash_signal(), and decl_assembler_name().

const char * weak_global_object_name
   The first weak object in the file.  

Referenced by make_decl_rtl_for_debug().