GCC Middle and Back End API Reference
varasm.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "predict.h"
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
#include "regs.h"
#include "emit-rtl.h"
#include "cgraph.h"
#include "diagnostic-core.h"
#include "fold-const.h"
#include "stor-layout.h"
#include "varasm.h"
#include "version.h"
#include "flags.h"
#include "stmt.h"
#include "expr.h"
#include "expmed.h"
#include "optabs.h"
#include "output.h"
#include "langhooks.h"
#include "debug.h"
#include "common/common-target.h"
#include "attribs.h"
#include "asan.h"
#include "rtl-iter.h"
#include "file-prefix-map.h"
#include "alloc-pool.h"
#include "toplev.h"
#include "opts.h"
#include "gt-varasm.h"
Include dependency graph for varasm.cc:

Data Structures

struct  section_hasher
 
struct  object_block_hasher
 
class  addr_const
 
class  constant_descriptor_rtx
 
struct  const_rtx_desc_hasher
 
struct  rtx_constant_pool
 
struct  constant_descriptor_rtx_data
 
struct  const_rtx_data_hasher
 
struct  oc_outer_state
 
struct  oc_local_state
 
struct  tm_clone_hasher
 
struct  tm_alias_pair
 

Macros

#define n_deferred_constants   (crtl->varasm.deferred_constants)
 
#define IN_NAMED_SECTION(DECL)
 
#define CONSTANT_POOL_BEFORE_FUNCTION   1
 
#define TLS_SECTION_ASM_FLAG   'T'
 

Functions

static const char * strip_reg_name (const char *)
 
static bool contains_pointers_p (tree)
 
static void decode_addr_const (tree, class addr_const *)
 
static hashval_t const_hash_1 (const tree)
 
static bool compare_constant (const tree, const tree)
 
static void output_constant_def_contents (rtx)
 
static void output_addressed_constants (tree, int)
 
static unsigned HOST_WIDE_INT output_constant (tree, unsigned HOST_WIDE_INT, unsigned int, bool, bool)
 
static void globalize_decl (tree)
 
static bool decl_readonly_section_1 (enum section_category)
 
static void mark_weak (tree)
 
static void output_constant_pool (const char *, tree)
 
static void handle_vtv_comdat_section (section *, const_tree)
 
static hashval_t hash_section (section *sect)
 
sectionget_unnamed_section (unsigned int flags, void(*callback)(const char *), const char *data)
 
static sectionget_noswitch_section (unsigned int flags, noswitch_section_callback callback)
 
sectionget_section (const char *name, unsigned int flags, tree decl, bool not_existing)
 
static bool use_object_blocks_p (void)
 
static struct object_blockget_block_for_section (section *sect)
 
static rtx create_block_symbol (const char *label, struct object_block *block, HOST_WIDE_INT offset)
 
sectionget_named_section (tree decl, const char *name, int reloc)
 
static bool set_implicit_section (struct symtab_node *n, void *data)
 
void resolve_unique_section (tree decl, int reloc, int flag_function_or_data_sections)
 
static sectionhot_function_section (tree decl)
 
sectionget_named_text_section (tree decl, const char *text_section_name, const char *named_section_suffix)
 
sectiondefault_function_section (tree decl, enum node_frequency freq, bool startup, bool exit)
 
static sectionfunction_section_1 (tree decl, bool force_cold)
 
sectionfunction_section (tree decl)
 
sectioncurrent_function_section (void)
 
sectionunlikely_text_section (void)
 
bool unlikely_text_section_p (section *sect)
 
void switch_to_other_text_partition (void)
 
sectiondefault_function_rodata_section (tree decl, bool relocatable)
 
sectiondefault_no_function_rodata_section (tree, bool)
 
static const char * function_mergeable_rodata_prefix (void)
 
static sectionmergeable_string_section (tree decl, unsigned HOST_WIDE_INT align, unsigned int flags)
 
sectionmergeable_constant_section (machine_mode mode, unsigned HOST_WIDE_INT align, unsigned int flags)
 
void set_user_assembler_name (tree decl, const char *name)
 
int decode_reg_name_and_count (const char *asmspec, int *pnregs)
 
int decode_reg_name (const char *name)
 
bool bss_initializer_p (const_tree decl, bool named)
 
void align_variable (tree decl, bool dont_output_data)
 
static unsigned int get_variable_align (tree decl)
 
int compute_reloc_for_var (tree decl)
 
sectionget_variable_section (tree decl, bool prefer_noswitch_p)
 
static struct object_blockget_block_for_decl (tree decl)
 
static void change_symbol_block (rtx symbol, struct object_block *block)
 
static bool use_blocks_for_decl_p (tree decl)
 
static tree ultimate_transparent_alias_target (tree *alias)
 
static bool eliminable_regno_p (int regnum)
 
void make_decl_rtl (tree decl)
 
rtx make_decl_rtl_for_debug (tree decl)
 
void assemble_asm (tree string)
 
void assemble_addr_to_section (rtx symbol, section *sec)
 
sectionget_cdtor_priority_section (int priority, bool constructor_p)
 
void default_named_section_asm_out_destructor (rtx symbol, int priority)
 
void default_named_section_asm_out_constructor (rtx symbol, int priority)
 
void notice_global_symbol (tree decl)
 
void decide_function_section (tree decl)
 
const char * get_fnname_from_decl (tree decl)
 
void assemble_function_label_raw (FILE *file, const char *name)
 
void assemble_function_label_final (void)
 
void assemble_start_function (tree decl, const char *fnname)
 
void assemble_end_function (tree decl, const char *fnname)
 
void assemble_zeros (unsigned HOST_WIDE_INT size)
 
void assemble_align (unsigned int align)
 
void assemble_string (const char *p, int size)
 
static bool emit_local (tree decl, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded)
 
static bool emit_common (tree decl, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded)
 
static bool emit_tls_common (tree decl, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded)
 
static void assemble_noswitch_variable (tree decl, const char *name, section *sect, unsigned int align)
 
static void assemble_variable_contents (tree decl, const char *name, bool dont_output_data, bool merge_strings)
 
void assemble_undefined_decl (tree decl)
 
void assemble_variable (tree decl, int top_level, int at_end, int dont_output_data)
 
void process_pending_assemble_externals (void)
 
void assemble_external (tree decl)
 
void assemble_external_libcall (rtx fun)
 
void assemble_label (FILE *file, const char *name)
 
void mark_referenced (tree id)
 
void mark_decl_referenced (tree decl)
 
void assemble_name_raw (FILE *file, const char *name)
 
const char * assemble_name_resolve (const char *name)
 
void assemble_name (FILE *file, const char *name)
 
rtx assemble_static_space (unsigned HOST_WIDE_INT size)
 
rtx assemble_trampoline_template (void)
 
static unsigned min_align (unsigned int a, unsigned int b)
 
const char * integer_asm_op (int size, int aligned_p)
 
void assemble_integer_with_op (const char *op, rtx x)
 
bool default_assemble_integer (rtx x, unsigned int size, int aligned_p)
 
bool assemble_integer (rtx x, unsigned int size, unsigned int align, int force)
 
void assemble_real (REAL_VALUE_TYPE d, scalar_float_mode mode, unsigned int align, bool reverse)
 
static void maybe_output_constant_def_contents (struct constant_descriptor_tree *, int)
 
hash_table< tree_descriptor_hasher > * constant_pool_htab (void)
 
static sectionget_constant_section (tree exp, unsigned int align)
 
static HOST_WIDE_INT get_constant_size (tree exp)
 
static struct constant_descriptor_treebuild_constant_desc (tree exp)
 
static constant_descriptor_treeadd_constant_to_table (tree exp, int defer)
 
rtx output_constant_def (tree exp, int defer)
 
static void assemble_constant_contents (tree exp, const char *label, unsigned int align, bool merge_strings)
 
rtx lookup_constant_def (tree exp)
 
tree tree_output_constant_def (tree exp)
 
static hashval_t const_rtx_hash_1 (const_rtx x)
 
static hashval_t const_rtx_hash (rtx x)
 
static struct rtx_constant_poolcreate_constant_pool (void)
 
void init_varasm_status (void)
 
rtx simplify_subtraction (rtx x)
 
rtx force_const_mem (machine_mode in_mode, rtx x)
 
rtx get_pool_constant (const_rtx addr)
 
rtx get_pool_constant_mark (rtx addr, bool *pmarked)
 
fixed_size_mode get_pool_mode (const_rtx addr)
 
bool constant_pool_empty_p (void)
 
static void output_constant_pool_2 (fixed_size_mode mode, rtx x, unsigned int align)
 
static void output_constant_pool_1 (class constant_descriptor_rtx *desc, unsigned int align)
 
static void recompute_pool_offsets (struct rtx_constant_pool *pool)
 
static void mark_constants_in_pattern (rtx insn)
 
static void mark_constants (rtx_insn *insn)
 
static void mark_constant_pool (void)
 
static void output_constant_pool_contents (struct rtx_constant_pool *pool)
 
static int constant_descriptor_rtx_data_cmp (const void *p1, const void *p2)
 
static void optimize_constant_pool (struct rtx_constant_pool *pool)
 
void output_shared_constant_pool (void)
 
int compute_reloc_for_constant (tree exp)
 
bool constructor_static_from_elts_p (const_tree ctor)
 
static tree initializer_constant_valid_p_1 (tree value, tree endtype, tree *cache)
 
static tree narrowing_initializer_constant_valid_p (tree value, tree endtype, tree *cache)
 
tree initializer_constant_valid_p (tree value, tree endtype, bool reverse)
 
bool initializer_constant_valid_for_bitfield_p (const_tree value)
 
static bool check_string_literal (tree string, unsigned HOST_WIDE_INT size)
 
static unsigned HOST_WIDE_INT output_constructor (tree, unsigned HOST_WIDE_INT, unsigned int, bool, oc_outer_state *)
 
static unsigned HOST_WIDE_INT array_size_for_constructor (tree val)
 
static void output_constructor_array_range (oc_local_state *local)
 
static void output_constructor_regular_field (oc_local_state *local)
 
static void output_constructor_bitfield (oc_local_state *local, unsigned int bit_offset)
 
void merge_weak (tree newdecl, tree olddecl)
 
void declare_weak (tree decl)
 
static void weak_finish_1 (tree decl)
 
static tree find_decl (tree target)
 
void weak_finish (void)
 
void do_assemble_alias (tree decl, tree target)
 
void do_assemble_symver (tree decl, tree target)
 
void assemble_alias (tree decl, tree target)
 
void record_tm_clone_pair (tree o, tree n)
 
tree get_tm_clone_pair (tree o)
 
static void dump_tm_clone_pairs (vec< tm_alias_pair > tm_alias_pairs)
 
sectiondefault_clone_table_section (void)
 
static int tm_alias_pair_cmp (const void *x, const void *y)
 
void finish_tm_clone_pairs (void)
 
void default_assemble_visibility (tree decl, int vis)
 
bool maybe_assemble_visibility (tree decl)
 
bool supports_one_only (void)
 
void make_decl_one_only (tree decl, tree comdat_group)
 
void init_varasm_once (void)
 
static bool have_optimized_refs (struct symtab_node *symbol)
 
static bool optimize_dyn_tls_for_decl_p (const_tree decl)
 
enum tls_model decl_default_tls_model (const_tree decl)
 
unsigned int default_section_type_flags (tree decl, const char *name, int reloc)
 
bool have_global_bss_p (void)
 
void default_no_named_section (const char *name, unsigned int flags, tree decl)
 
void default_elf_asm_named_section (const char *name, unsigned int flags, tree decl)
 
void default_coff_asm_named_section (const char *name, unsigned int flags, tree decl)
 
void default_pe_asm_named_section (const char *name, unsigned int flags, tree decl)
 
sectiondefault_select_section (tree decl, int reloc, unsigned HOST_WIDE_INT align)
 
enum section_category categorize_decl_for_section (const_tree decl, int reloc)
 
bool decl_readonly_section (const_tree decl, int reloc)
 
sectiondefault_elf_select_section (tree decl, int reloc, unsigned HOST_WIDE_INT align)
 
void default_unique_section (tree decl, int reloc)
 
static int compute_reloc_for_rtx_1 (const_rtx x)
 
static int compute_reloc_for_rtx (const_rtx x)
 
sectiondefault_select_rtx_section (machine_mode mode, rtx x, unsigned HOST_WIDE_INT align)
 
sectiondefault_elf_select_rtx_section (machine_mode mode, rtx x, unsigned HOST_WIDE_INT align)
 
void default_encode_section_info (tree decl, rtx rtl, int first)
 
const char * default_strip_name_encoding (const char *str)
 
bool default_use_anchors_for_symbol_p (const_rtx symbol)
 
static bool resolution_to_local_definition_p (enum ld_plugin_symbol_resolution resolution)
 
static bool resolution_local_p (enum ld_plugin_symbol_resolution resolution)
 
bool default_binds_local_p_3 (const_tree exp, bool shlib, bool weak_dominate, bool extern_protected_data, bool common_local_p)
 
bool default_binds_local_p (const_tree exp)
 
bool default_binds_local_p_2 (const_tree exp)
 
bool default_binds_local_p_1 (const_tree exp, int shlib)
 
bool decl_binds_to_current_def_p (const_tree decl)
 
bool decl_replaceable_p (tree decl, bool semantic_interposition_p)
 
void default_globalize_decl_name (FILE *stream, tree decl)
 
void default_emit_unwind_label (FILE *stream, tree decl, int for_eh, int empty)
 
void default_emit_except_table_label (FILE *stream)
 
void default_generate_internal_label (char *buf, const char *prefix, unsigned long labelno)
 
void default_internal_label (FILE *stream, const char *prefix, unsigned long labelno)
 
void default_asm_declare_constant_name (FILE *file, const char *name, const_tree exp, HOST_WIDE_INT size)
 
void default_file_start (void)
 
void file_end_indicate_exec_stack (void)
 
void file_end_indicate_split_stack (void)
 
void output_section_asm_op (const char *directive)
 
void switch_to_section (section *new_section, tree decl)
 
void place_block_symbol (rtx symbol)
 
rtx get_section_anchor (struct object_block *block, HOST_WIDE_INT offset, enum tls_model model)
 
static void output_object_block (struct object_block *block)
 
static int output_object_block_compare (const void *x, const void *y)
 
void output_object_blocks (void)
 
void elf_record_gcc_switches (const char *options)
 
void default_elf_asm_output_external (FILE *file, tree decl, const char *name)
 
void default_asm_output_source_filename (FILE *file, const char *name)
 
void output_file_directive (FILE *asm_file, const char *input_name)
 
rtx make_debug_expr_from_rtl (const_rtx exp)
 
static sectionget_elf_initfini_array_priority_section (int priority, bool constructor_p)
 
void default_elf_init_array_asm_out_constructor (rtx symbol, int priority)
 
void default_elf_fini_array_asm_out_destructor (rtx symbol, int priority)
 
void default_asm_output_ident_directive (const char *ident_str)
 
void switch_to_comdat_section (section *sect, tree decl)
 
void varasm_cc_finalize ()
 

Variables

const char * first_global_object_name
 
const char * weak_global_object_name
 
static int const_labelno
 
int size_directive_output
 
tree last_assemble_variable_decl
 
bool first_function_block_is_cold
 
static bool saw_no_split_stack
 
sectiontext_section
 
sectiondata_section
 
sectionreadonly_data_section
 
sectionsdata_section
 
sectionctors_section
 
sectiondtors_section
 
sectionbss_section
 
sectionsbss_section
 
sectiontls_comm_section
 
sectioncomm_section
 
sectionlcomm_section
 
sectionbss_noswitch_section
 
sectionexception_section
 
sectioneh_frame_section
 
sectionin_section
 
bool in_cold_section_p
 
tree cold_function_name = NULL_TREE
 
static sectionunnamed_sections
 
static hash_table< section_hasher > * section_htab
 
static hash_table< object_block_hasher > * object_block_htab
 
static int anchor_labelno
 
static struct rtx_constant_poolshared_constant_pool
 
static tree pending_assemble_externals
 
static rtx pending_libcall_symbols
 
static tree weak_decls
 
static rtx initial_trampoline
 
static hash_table< tree_descriptor_hasher > * const_desc_htab
 
static tree weakref_targets
 
vec< alias_pair, va_gc > * alias_pairs
 
static hash_table< tm_clone_hasher > * tm_clone_hash
 
int trampolines_created
 
static sectionelf_init_array_section
 
static sectionelf_fini_array_section
 

Macro Definition Documentation

◆ CONSTANT_POOL_BEFORE_FUNCTION

#define CONSTANT_POOL_BEFORE_FUNCTION   1
CONSTANT_POOL_BEFORE_FUNCTION may be defined as an expression with
a nonzero value if the constant pool should be output before the
start of the function, or a zero value if the pool should output
after the end of the function.  The default is to put it before the
start.   

Referenced by assemble_end_function(), and assemble_start_function().

◆ IN_NAMED_SECTION

#define IN_NAMED_SECTION ( DECL)
Value:
#define NULL
Definition system.h:50
#define DECL_SECTION_NAME(NODE)
Definition tree.h:3269
#define VAR_OR_FUNCTION_DECL_P(DECL)
Definition tree.h:240
Return a nonzero value if DECL has a section attribute.   

Referenced by get_variable_section().

◆ n_deferred_constants

#define n_deferred_constants   (crtl->varasm.deferred_constants)

◆ TLS_SECTION_ASM_FLAG

#define TLS_SECTION_ASM_FLAG   'T'

Function Documentation

◆ add_constant_to_table()

static constant_descriptor_tree * add_constant_to_table ( tree exp,
int defer )
static
Subroutine of output_constant_def and tree_output_constant_def:
Add a constant to the hash table that tracks which constants
already have labels.   

References build_constant_desc(), const_desc_htab, const_hash_1(), exp(), gcc_assert, constant_descriptor_tree::hash, output_addressed_constants(), and constant_descriptor_tree::value.

Referenced by output_constant_def(), and tree_output_constant_def().

◆ align_variable()

void align_variable ( tree decl,
bool dont_output_data )

◆ array_size_for_constructor()

static unsigned HOST_WIDE_INT array_size_for_constructor ( tree val)
static
Subroutine of output_constructor, used for computing the size of
arrays of unspecified length.  VAL must be a CONSTRUCTOR of an array
type with an unspecified upper bound.   

References bitsize_int, CONSTRUCTOR_ELTS, wi::fits_uhwi_p(), FOR_EACH_CONSTRUCTOR_ELT, gcc_assert, i, NULL_TREE, RAW_DATA_LENGTH, size_binop, wi::to_offset(), TREE_CODE, tree_int_cst_lt(), TREE_OPERAND, TREE_STRING_LENGTH, TREE_TYPE, TYPE_DOMAIN, TYPE_MIN_VALUE, and TYPE_SIZE_UNIT.

Referenced by output_constructor_regular_field().

◆ assemble_addr_to_section()

◆ assemble_alias()

◆ assemble_align()

◆ assemble_asm()

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

References app_enable(), asm_out_file, TREE_CODE, TREE_OPERAND, and TREE_STRING_POINTER.

Referenced by cgraph_order_sort::process().

◆ assemble_constant_contents()

static void assemble_constant_contents ( tree exp,
const char * label,
unsigned int align,
bool merge_strings )
static
Subroutine of output_constant_def_contents.  Output the definition
of constant EXP, which is pointed to by label LABEL.  ALIGN is the
constant's alignment in bits.   

References asm_out_file, exp(), get_constant_size(), output_constant(), and targetm.

Referenced by output_constant_def_contents(), and output_object_block().

◆ assemble_end_function()

void assemble_end_function ( tree decl,
const char * fnname )
Output assembler code associated with defining the size of the
function.  DECL describes the function.  NAME is the function's name.   

References asm_out_file, ASM_OUTPUT_LABEL, cold_function_name, CONSTANT_POOL_BEFORE_FUNCTION, crtl, first_function_block_is_cold, function_section(), IDENTIFIER_POINTER, in_section, NULL_TREE, output_constant_pool(), switch_to_section(), text_section, and unlikely_text_section().

Referenced by rest_of_handle_final().

◆ assemble_external()

void assemble_external ( tree decl)
Output something to declare an external symbol to the assembler,
and qualifiers such as weakness.  (Most assemblers don't need
extern declaration, so we normally output nothing.)  Do nothing if
DECL is not external.   

References hash_set< KeyId, Lazy, Traits >::add(), asm_out_file, DECL_ATTRIBUTES, DECL_EXTERNAL, DECL_P, DECL_WEAK, EXPANSION, FINISHED, gcc_assert, lookup_attribute(), NULL, NULL_TREE, pending_assemble_externals, TARGET_SUPPORTS_WEAK, tree_cons(), TREE_PUBLIC, TREE_STATIC, value_member(), and weak_decls.

Referenced by final_scan_insn_1(), mark_symbol_refs_as_used(), and output_addr_const().

◆ assemble_external_libcall()

◆ assemble_function_label_final()

void assemble_function_label_final ( void )
Finish outputting function label.  Needs to be called when outputting
function label without using assemble_function_label_raw ().   

References asan_function_start(), cfun, first_function_block_is_cold, in_cold_section_p, and SANITIZE_ADDRESS.

Referenced by assemble_function_label_raw().

◆ assemble_function_label_raw()

void assemble_function_label_raw ( FILE * file,
const char * name )
Output function label, possibly with accompanying metadata.  No additional
code or data is output after the label.   

References ASM_OUTPUT_LABEL, assemble_function_label_final(), and symtab_node::name().

◆ assemble_integer()

bool assemble_integer ( rtx x,
unsigned int size,
unsigned int align,
int force )
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.  We must be able to output the constant,
if FORCE is nonzero.   

References assemble_integer(), gcc_assert, GET_CODE, GET_MODE, GET_MODE_CLASS, i, MIN, mode_for_size(), opt_mode< T >::require(), simplify_subreg(), and targetm.

Referenced by assemble_addr_to_section(), assemble_integer(), assemble_real(), assemble_zeros(), dump_tm_clone_pairs(), output_constant(), output_constant_pool_2(), output_constructor(), output_constructor_bitfield(), and output_constructor_regular_field().

◆ assemble_integer_with_op()

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

References asm_out_file, fputc(), and output_addr_const().

Referenced by default_assemble_integer().

◆ assemble_label()

void assemble_label ( FILE * file,
const char * name )
Assemble a label named NAME.   

References ASM_OUTPUT_LABEL, and symtab_node::name().

Referenced by default_asm_declare_constant_name().

◆ assemble_name()

void assemble_name ( FILE * file,
const char * name )
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.   

References assemble_name_raw(), assemble_name_resolve(), and symtab_node::name().

Referenced by default_assemble_visibility(), dw2_asm_output_delta_uleb128(), dw2_asm_output_symname_uleb128(), output_addr_const(), and output_asm_label().

◆ assemble_name_raw()

void assemble_name_raw ( FILE * file,
const char * name )
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).   

References ASM_OUTPUT_LABELREF, and symtab_node::name().

Referenced by assemble_name(), default_elf_asm_named_section(), and default_print_patchable_function_entry().

◆ assemble_name_resolve()

const char * assemble_name_resolve ( const char * name)
Return NAME that should actually be emitted, looking through
transparent aliases.  If NAME refers to an entity that is also
represented as a tree (like a function or variable), mark the entity
as referenced.   

References gcc_assert, IDENTIFIER_POINTER, mark_referenced(), maybe_get_identifier(), symtab_node::name(), targetm, TREE_CHAIN, and ultimate_transparent_alias_target().

Referenced by assemble_name().

◆ assemble_noswitch_variable()

static void assemble_noswitch_variable ( tree decl,
const char * name,
section * sect,
unsigned int align )
static
Assemble DECL given that it belongs in SECTION_NOSWITCH section SECT.
NAME is the name of DECL's SYMBOL_REF.   

References asan_protect_global(), asan_red_zone_size(), noswitch_section::callback, DECL_SIZE_UNIT, error(), symtab_node::name(), section::noswitch, SANITIZE_ADDRESS, and tree_to_uhwi().

Referenced by assemble_variable().

◆ assemble_real()

void assemble_real ( REAL_VALUE_TYPE d,
scalar_float_mode mode,
unsigned int align,
bool reverse )
Assemble the floating-point constant D into an object of size MODE.  ALIGN
is the alignment of the constant in bits.  If REVERSE is true, D is output
in reverse storage order.   

References assemble_integer(), CEIL, flip_storage_order(), GEN_INT, gen_int_mode(), GET_MODE_SIZE(), i, MIN, min_align(), real_to_target(), and sext_hwi().

Referenced by output_constant(), and output_constant_pool_2().

◆ assemble_start_function()

◆ assemble_static_space()

rtx assemble_static_space ( unsigned HOST_WIDE_INT size)
Allocate SIZE bytes writable static space with a gensym name
and return an RTX to refer to its address.   

References asm_out_file, const_labelno, ggc_strdup, symtab_node::name(), NULL_TREE, SYMBOL_FLAG_LOCAL, and SYMBOL_REF_FLAGS.

Referenced by expand_function_start().

◆ assemble_string()

void assemble_string ( const char * p,
int size )
Assemble a string constant with the specified C string as contents.   

References asm_out_file, and ASM_OUTPUT_ASCII.

Referenced by lhd_append_data(), output_constant(), and output_constructor_regular_field().

◆ assemble_trampoline_template()

◆ assemble_undefined_decl()

void assemble_undefined_decl ( tree decl)
Write out assembly for the variable DECL, which is not defined in
the current translation unit.   

References asm_out_file, DECL_RTL, symtab_node::name(), targetm, XEXP, and XSTR.

Referenced by symbol_table::output_variables(), and cgraph_order_sort::process().

◆ assemble_variable()

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).   

References align_variable(), app_disable(), asan_protect_global(), ASAN_RED_ZONE_SIZE, asan_red_zone_size(), asm_out_file, assemble_noswitch_variable(), assemble_variable_contents(), assemble_zeros(), section::common, DECL_ALIGN, DECL_EXTERNAL, DECL_IN_TEXT_SECTION, DECL_INITIAL, DECL_NAME, DECL_PRESERVE_P, DECL_RTL, DECL_RTL_SET_P, DECL_SIZE, DECL_SIZE_UNIT, DECL_THREAD_LOCAL_P, error(), error_mark_node, section_common::flags, floor_log2(), gcc_assert, gcc_checking_assert, GET_CODE, get_variable_align(), get_variable_section(), globalize_decl(), handle_vtv_comdat_section(), last_assemble_variable_decl, layout_decl(), MAX, maybe_assemble_visibility(), MEM_P, named_section::name, symtab_node::name(), section::named, notice_global_symbol(), output_addressed_constants(), output_constant_def_contents(), place_block_symbol(), REG_P, SANITIZE_ADDRESS, SECTION_CODE, SECTION_COMMON, SECTION_MERGE, SECTION_NAMED, SECTION_NOSWITCH, SECTION_STRINGS, SECTION_STYLE, SET_DECL_ALIGN, set_mem_align(), switch_to_section(), SYMBOL_REF_BLOCK, SYMBOL_REF_DECL, SYMBOL_REF_HAS_BLOCK_INFO_P, targetm, TREE_ASM_WRITTEN, TREE_CONSTANT_POOL_ADDRESS_P, TREE_PUBLIC, tree_to_uhwi(), valid_constant_size_p(), VAR_P, XEXP, and XSTR.

Referenced by varpool_node::assemble_decl(), and dw2_output_indirect_constant_1().

◆ assemble_variable_contents()

static void assemble_variable_contents ( tree decl,
const char * name,
bool dont_output_data,
bool merge_strings )
static
A subroutine of assemble_variable.  Output the label and contents of
DECL, whose address is a SYMBOL_REF with name NAME.  DONT_OUTPUT_DATA
is as for assemble_variable.   

References asm_out_file, ASM_OUTPUT_LABEL, assemble_zeros(), symtab_node::decl, DECL_INITIAL, DECL_SIZE_UNIT, error_mark_node, gcc_assert, get_variable_align(), initializer_zerop(), last_assemble_variable_decl, symtab_node::name(), output_constant(), targetm, and tree_to_uhwi().

Referenced by assemble_variable(), and output_object_block().

◆ assemble_zeros()

◆ bss_initializer_p()

bool bss_initializer_p ( const_tree decl,
bool named )
Return true if DECL's initializer is suitable for a BSS section.   

References DECL_COMMON, DECL_INITIAL, DECL_PERSISTENT_P, error_mark_node, initializer_zerop(), NULL, and TREE_READONLY.

Referenced by categorize_decl_for_section(), and get_variable_section().

◆ build_constant_desc()

◆ categorize_decl_for_section()

◆ change_symbol_block()

static void change_symbol_block ( rtx symbol,
struct object_block * block )
static
Make sure block symbol SYMBOL is in block BLOCK.   

References gcc_assert, SYMBOL_REF_BLOCK, and SYMBOL_REF_BLOCK_OFFSET.

Referenced by make_decl_rtl().

◆ check_string_literal()

static bool check_string_literal ( tree string,
unsigned HOST_WIDE_INT size )
static
Check if a STRING_CST fits into the field.
Tolerate only the case when the NUL termination
does not fit into the field.    

References TREE_STRING_LENGTH, tree_to_uhwi(), TREE_TYPE, and TYPE_SIZE_UNIT.

Referenced by output_constant().

◆ compare_constant()

◆ compute_reloc_for_constant()

int compute_reloc_for_constant ( tree exp)

◆ compute_reloc_for_rtx()

static int compute_reloc_for_rtx ( const_rtx x)
static
Like compute_reloc_for_constant, except for an RTX.  The return value
is a mask for which bit 1 indicates a global relocation, and bit 0
indicates a local relocation.  Used by default_select_rtx_section
and default_elf_select_rtx_section.   

References ALL, compute_reloc_for_rtx_1(), FOR_EACH_SUBRTX, and GET_CODE.

Referenced by default_elf_select_rtx_section(), and default_select_rtx_section().

◆ compute_reloc_for_rtx_1()

static int compute_reloc_for_rtx_1 ( const_rtx x)
static
Subroutine of compute_reloc_for_rtx for leaf rtxes.   

References GET_CODE, and SYMBOL_REF_LOCAL_P.

Referenced by compute_reloc_for_rtx().

◆ compute_reloc_for_var()

int compute_reloc_for_var ( tree decl)
Compute reloc for get_variable_section.  The return value
is a mask for which bit 1 indicates a global relocation, and bit 0
indicates a local relocation.   

References compute_reloc_for_constant(), contains_pointers_p(), DECL_INITIAL, error_mark_node, and TREE_TYPE.

Referenced by get_variable_section().

◆ const_hash_1()

◆ const_rtx_hash()

static hashval_t const_rtx_hash ( rtx x)
static
Compute a hash value for X, which should be a constant.   

References ALL, const_rtx_hash_1(), and FOR_EACH_SUBRTX.

Referenced by force_const_mem().

◆ const_rtx_hash_1()

◆ constant_descriptor_rtx_data_cmp()

static int constant_descriptor_rtx_data_cmp ( const void * p1,
const void * p2 )
static
qsort callback to sort constant_descriptor_rtx_data * vector by
decreasing size.   

References gcc_assert, constant_descriptor_rtx_data::hash, and constant_descriptor_rtx_data::size.

Referenced by optimize_constant_pool().

◆ constant_pool_empty_p()

bool constant_pool_empty_p ( void )
Return TRUE if and only if the constant pool has no entries.  Note
that even entries we might end up choosing not to emit are counted
here, so there is the potential for missed optimizations.   

References crtl, and NULL.

◆ constant_pool_htab()

hash_table< tree_descriptor_hasher > * constant_pool_htab ( void )
Constant pool accessor function.   

References const_desc_htab.

Referenced by asan_finish_file().

◆ constructor_static_from_elts_p()

bool constructor_static_from_elts_p ( const_tree ctor)
Whether a constructor CTOR is a valid static constant initializer if all
its elements are.  This used to be internal to initializer_constant_valid_p
and has been exposed to let other functions like categorize_ctor_elements
evaluate the property while walking a constructor for other purposes.   

References TREE_CODE, TREE_CONSTANT, and TREE_TYPE.

Referenced by categorize_ctor_elements_1(), and initializer_constant_valid_p_1().

◆ contains_pointers_p()

static bool contains_pointers_p ( tree type)
static
Return true if type TYPE contains any pointers.   

References contains_pointers_p(), DECL_CHAIN, fields, TREE_CODE, TREE_TYPE, and TYPE_FIELDS.

Referenced by compute_reloc_for_var(), and contains_pointers_p().

◆ create_block_symbol()

static rtx create_block_symbol ( const char * label,
struct object_block * block,
HOST_WIDE_INT offset )
static
Create a symbol with label LABEL and place it at byte offset
OFFSET in BLOCK.  OFFSET can be negative if the symbol's offset
is not yet known.  LABEL must be a garbage-collected string.   

References block_symbol::block, ggc_internal_alloc(), offset, PUT_CODE, PUT_MODE(), RTX_HDR_SIZE, object_block::size, SYMBOL_FLAG_HAS_BLOCK_INFO, SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET, SYMBOL_REF_FLAGS, and XSTR.

Referenced by build_constant_desc(), force_const_mem(), get_section_anchor(), and make_decl_rtl().

◆ create_constant_pool()

◆ current_function_section()

section * current_function_section ( void )

◆ decide_function_section()

void decide_function_section ( tree decl)
If not using flag_reorder_blocks_and_partition, decide early whether the
current function goes into the cold section, so that targets can use
current_function_section during RTL expansion.  DECL describes the
function.   

References current_function_decl, DECL_SECTION_NAME, first_function_block_is_cold, cgraph_node::frequency, cgraph_node::get(), in_cold_section_p, and NODE_FREQUENCY_UNLIKELY_EXECUTED.

Referenced by init_function_start().

◆ decl_binds_to_current_def_p()

bool decl_binds_to_current_def_p ( const_tree decl)
Return true when references to DECL must bind to current definition in
final executable.

The condition is usually equivalent to whether the function binds to the
current module (shared library or executable), that is to binds_local_p.
We use this fact to avoid need for another target hook and implement
the logic using binds_local_p and just special cases where
decl_binds_to_current_def_p is stronger than binds_local_p.  In particular
the weak definitions (that can be overwritten at linktime by other
definition from different object file) and when resolution info is available
we simply use the knowledge passed to us by linker plugin.   

References DECL_COMDAT_GROUP, DECL_COMMON, DECL_EXTERNAL, DECL_INITIAL, DECL_P, DECL_WEAK, error_mark_node, gcc_assert, symtab_node::get(), NULL, resolution_to_local_definition_p(), targetm, and TREE_PUBLIC.

Referenced by align_variable(), base_object_writable(), symtab_node::binds_to_current_def_p(), symtab_node::can_increase_alignment_p(), can_replace_by_local_alias(), compare_base_symbol_refs(), decl_replaceable_p(), default_use_anchors_for_symbol_p(), symtab_node::equal_address_to(), fndecl_abi(), get_range_strlen_tree(), get_variable_align(), maybe_instrument_pointer_overflow(), maybe_optimize_ubsan_ptr_ifn(), ipa_icf::sem_function::merge(), ipa_icf::sem_variable::merge(), symtab_node::noninterposable_alias(), symtab_node::noninterposable_alias(), optimize_weakref(), ptrs_compare_unequal(), rest_of_clean_state(), self_recursive_call_p(), and set_uids_in_ptset().

◆ decl_default_tls_model()

◆ decl_readonly_section()

bool decl_readonly_section ( const_tree decl,
int reloc )
Decide whether DECL needs to be in a writable section.
RELOC is the same as for SELECT_SECTION.   

References categorize_decl_for_section(), and decl_readonly_section_1().

Referenced by default_select_section(), and readonly_data_expr().

◆ decl_readonly_section_1()

◆ decl_replaceable_p()

bool decl_replaceable_p ( tree decl,
bool semantic_interposition_p )
A replaceable function or variable is one which may be replaced
at link-time with an entirely different definition, provided that the
replacement has the same type.  For example, functions declared
with __attribute__((weak)) on most systems are replaceable.
If SEMANTIC_INTERPOSITION_P is false allow interposition only on
symbols explicitly declared weak.

COMDAT functions are not replaceable, since all definitions of the
function must be equivalent.  It is important that COMDAT functions
not be treated as replaceable so that use of C++ template
instantiations is not penalized.   

References decl_binds_to_current_def_p(), DECL_COMDAT, DECL_P, DECL_WEAK, gcc_assert, and TREE_PUBLIC.

Referenced by varpool_node::ctor_useable_for_folding_p(), cgraph_node::get_availability(), and varpool_node::get_availability().

◆ declare_weak()

◆ decode_addr_const()

◆ decode_reg_name()

int decode_reg_name ( const char * name)
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.   

References count, and decode_reg_name_and_count().

Referenced by handle_common_deferred_options(), and make_decl_rtl().

◆ decode_reg_name_and_count()

int decode_reg_name_and_count ( const char * asmspec,
int * pnregs )
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' or `redzone' and is not
recognized,
or -3 if ASMSPEC is `cc' and is not recognized,
or -4 if ASMSPEC is `memory' and is not recognized,
or -5 if ASMSPEC is `redzone' and is not recognized.
Accept an exact spelling or a decimal number.
Prefixes such as % are optional.   

References i, symtab_node::name(), reg_names, strip_reg_name(), and table.

Referenced by decode_reg_name(), expand_asm_stmt(), and fix_register().

◆ default_asm_declare_constant_name()

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.   

References assemble_label().

◆ default_asm_output_ident_directive()

void default_asm_output_ident_directive ( const char * ident_str)
Default TARGET_ASM_OUTPUT_IDENT hook.

This is a bit of a cheat.  The real default is a no-op, but this
hook is the default for all targets with a .ident directive.   

References asm_out_file, build_string(), symbol_table::finalize_toplevel_asm(), NULL, PARSING, symbol_table::state, and symtab.

◆ default_asm_output_source_filename()

void default_asm_output_source_filename ( FILE * file,
const char * name )
The default hook for TARGET_ASM_OUTPUT_SOURCE_FILENAME.   

References output_quoted_string().

◆ default_assemble_integer()

bool default_assemble_integer ( rtx x,
unsigned int size,
int aligned_p )
The default implementation of the asm_out.integer target hook.   

References assemble_integer_with_op(), integer_asm_op(), and POINTER_SIZE_UNITS.

◆ default_assemble_visibility()

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.   

References asm_out_file, assemble_name(), DECL_ARTIFICIAL, DECL_ASSEMBLER_NAME, IDENTIFIER_POINTER, symtab_node::name(), NULL, type(), ultimate_transparent_alias_target(), and warning().

◆ default_binds_local_p()

bool default_binds_local_p ( const_tree exp)
Assume ELF-ish defaults, since that's pretty much the most liberal
wrt cross-module name binding.   

References default_binds_local_p_3(), and exp().

◆ default_binds_local_p_1()

bool default_binds_local_p_1 ( const_tree exp,
int shlib )

References default_binds_local_p_3(), and exp().

◆ default_binds_local_p_2()

bool default_binds_local_p_2 ( const_tree exp)
Similar to default_binds_local_p, but common symbol may be local and
extern protected data is non-local.   

References default_binds_local_p_3(), and exp().

◆ default_binds_local_p_3()

bool default_binds_local_p_3 ( const_tree exp,
bool shlib,
bool weak_dominate,
bool extern_protected_data,
bool common_local_p )
COMMON_LOCAL_P is true means that the linker can guarantee that an
uninitialized common symbol in the executable will still be defined
(through COPY relocation) in the executable.   

References DECL_ATTRIBUTES, DECL_COMMON, DECL_EXTERNAL, DECL_INITIAL, DECL_P, DECL_VISIBILITY, DECL_VISIBILITY_SPECIFIED, DECL_WEAK, error_mark_node, exp(), cgraph_node::get(), symtab_node::get(), lookup_attribute(), NULL, resolution_local_p(), resolution_to_local_definition_p(), targetm, TREE_CODE, TREE_PUBLIC, VISIBILITY_DEFAULT, and VISIBILITY_PROTECTED.

Referenced by default_binds_local_p(), default_binds_local_p_1(), and default_binds_local_p_2().

◆ default_clone_table_section()

section * default_clone_table_section ( void )
Provide a default for the tm_clone_table section.   

References get_named_section(), and NULL.

◆ default_coff_asm_named_section()

void default_coff_asm_named_section ( const char * name,
unsigned int flags,
tree decl )

◆ default_elf_asm_named_section()

◆ default_elf_asm_output_external()

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.   

References DECL_ASSEMBLER_NAME, DECL_VISIBILITY_SPECIFIED, maybe_assemble_visibility(), targetm, and TREE_SYMBOL_REFERENCED.

◆ default_elf_fini_array_asm_out_destructor()

void default_elf_fini_array_asm_out_destructor ( rtx symbol,
int priority )
Use .fini_array section for destructors.  

References assemble_addr_to_section(), and get_elf_initfini_array_priority_section().

◆ default_elf_init_array_asm_out_constructor()

void default_elf_init_array_asm_out_constructor ( rtx symbol,
int priority )
Use .init_array section for constructors.  

References assemble_addr_to_section(), and get_elf_initfini_array_priority_section().

◆ default_elf_select_rtx_section()

◆ default_elf_select_section()

◆ default_emit_except_table_label()

void default_emit_except_table_label ( FILE * stream)
Default function to output a label to divide up the exception table.
The default is to do nothing.  A target that needs/wants to divide
up the table must provide it's own function to do this.   

◆ default_emit_unwind_label()

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.   

◆ default_encode_section_info()

void default_encode_section_info ( tree decl,
rtx rtl,
int first )

◆ default_file_start()

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.   

References asm_out_file, output_file_directive(), and targetm.

◆ default_function_rodata_section()

section * default_function_rodata_section ( tree decl,
bool relocatable )
Return the read-only or relocated read-only data section
associated with function DECL.   

References alloca, DECL_COMDAT_GROUP, DECL_SECTION_NAME, get_section(), symtab_node::name(), readonly_data_section, SECTION_LINKONCE, SECTION_RELRO, SECTION_WRITE, and startswith().

◆ default_function_section()

section * default_function_section ( tree decl,
enum node_frequency freq,
bool startup,
bool exit )
Choose named function section based on its frequency.   

References cgraph_node::get(), symtab_node::get(), get_named_text_section(), NODE_FREQUENCY_HOT, NODE_FREQUENCY_UNLIKELY_EXECUTED, NULL, and opt_for_fn.

◆ default_generate_internal_label()

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.   

◆ default_globalize_decl_name()

void default_globalize_decl_name ( FILE * stream,
tree decl )
Default function to output code that will globalize a label.  A
target must define GLOBAL_ASM_OP or provide its own function to
globalize a label.   
Default function to output code that will globalize a declaration.   

References DECL_RTL, targetm, XEXP, and XSTR.

◆ default_internal_label()

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 alloca, and ASM_OUTPUT_INTERNAL_LABEL.

◆ default_named_section_asm_out_constructor()

void default_named_section_asm_out_constructor ( rtx symbol,
int priority )

◆ default_named_section_asm_out_destructor()

void default_named_section_asm_out_destructor ( rtx symbol,
int priority )

◆ default_no_function_rodata_section()

section * default_no_function_rodata_section ( tree ,
bool  )
Return the read-only data section associated with function DECL
for targets where that section should be always the single
readonly data section.   

References readonly_data_section.

◆ default_no_named_section()

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.   

References gcc_unreachable.

◆ default_pe_asm_named_section()

void default_pe_asm_named_section ( const char * name,
unsigned int flags,
tree decl )

◆ default_section_type_flags()

unsigned int default_section_type_flags ( tree decl,
const char * name,
int reloc )
Select a set of attributes for section NAME based on the properties
of DECL and whether or not RELOC indicates that DECL's initializer
might contain runtime relocations.

We make the section read-only and executable for a function decl,
read-only for a const data decl, and writable for a non-const data decl.   

References categorize_decl_for_section(), DECL_COMDAT_GROUP, DECL_P, decl_readonly_section_1(), DECL_THREAD_LOCAL_P, SECCAT_DATA_REL_RO, SECCAT_DATA_REL_RO_LOCAL, SECTION_BSS, SECTION_CODE, SECTION_ENTSIZE, SECTION_LINKONCE, SECTION_NOTYPE, SECTION_RELRO, SECTION_TLS, SECTION_WRITE, startswith(), TREE_CODE, and VAR_P.

◆ default_select_rtx_section()

section * default_select_rtx_section ( machine_mode mode,
rtx x,
unsigned HOST_WIDE_INT align )

◆ default_select_section()

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

References data_section, DECL_P, decl_readonly_section(), readonly_data_section, TREE_CODE, TREE_CONSTANT, and TREE_READONLY.

◆ default_strip_name_encoding()

const char * default_strip_name_encoding ( const char * str)
By default, we do nothing for encode_section_info, so we need not
do anything but discard the '*' marker.   

◆ default_unique_section()

◆ default_use_anchors_for_symbol_p()

◆ do_assemble_alias()

◆ do_assemble_symver()

void do_assemble_symver ( tree decl,
tree target )

◆ dump_tm_clone_pairs()

static void dump_tm_clone_pairs ( vec< tm_alias_pair > tm_alias_pairs)
static

◆ elf_record_gcc_switches()

void elf_record_gcc_switches ( const char * options)
This function provides a possible implementation of the
TARGET_ASM_RECORD_GCC_SWITCHES target hook for ELF targets.  When triggered
by -frecord-gcc-switches it creates a new mergeable, string section in the
assembler output file called TARGET_ASM_RECORD_GCC_SWITCHES_SECTION which
contains the switches in ASCII format.

FIXME: This code does not correctly handle double quote characters
that appear inside strings, (it strips them rather than preserving them).
FIXME: ASM_OUTPUT_ASCII, as defined in config/elfos.h will not emit NUL
characters - instead it treats them as sub-string separators.  Since
we want to emit NUL strings terminators into the object file we have to use
ASM_OUTPUT_SKIP.   

References asm_out_file, ASM_OUTPUT_ASCII, get_section(), NULL, SECTION_DEBUG, SECTION_ENTSIZE, SECTION_MERGE, SECTION_STRINGS, switch_to_section(), and targetm.

◆ eliminable_regno_p()

static bool eliminable_regno_p ( int regnum)
static
Return true if REGNUM is mentioned in ELIMINABLE_REGS as a from
register number.   

References i.

Referenced by make_decl_rtl().

◆ emit_common()

static bool emit_common ( tree decl,
const char * name,
unsigned HOST_WIDE_INT size,
unsigned HOST_WIDE_INT rounded )
static
A noswitch_section_callback for bss_noswitch_section.   
A noswitch_section_callback for comm_section.   

References asm_out_file, get_variable_align(), and symtab_node::name().

Referenced by init_varasm_once().

◆ emit_local()

static bool emit_local ( tree decl,
const char * name,
unsigned HOST_WIDE_INT size,
unsigned HOST_WIDE_INT rounded )
static
A noswitch_section_callback for lcomm_section.   

References asm_out_file, symtab_node::definition_alignment(), symtab_node::get(), and symtab_node::name().

Referenced by init_varasm_once().

◆ emit_tls_common()

static bool emit_tls_common ( tree decl,
const char * name,
unsigned HOST_WIDE_INT size,
unsigned HOST_WIDE_INT rounded )
static
A noswitch_section_callback for tls_comm_section.   

References asm_out_file, symtab_node::name(), and sorry().

Referenced by init_varasm_once().

◆ file_end_indicate_exec_stack()

void file_end_indicate_exec_stack ( void )

◆ file_end_indicate_split_stack()

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.   

References get_section(), NULL, saw_no_split_stack, SECTION_DEBUG, and switch_to_section().

◆ find_decl()

static tree find_decl ( tree target)
static
Fiven an assembly name, find the decl it is associated with.   

References symtab_node::decl, symtab_node::get_for_asmname(), and NULL_TREE.

Referenced by assemble_alias(), and weak_finish().

◆ finish_tm_clone_pairs()

void finish_tm_clone_pairs ( void )

◆ force_const_mem()

◆ function_mergeable_rodata_prefix()

static const char * function_mergeable_rodata_prefix ( void )
static
A subroutine of mergeable_string_section and mergeable_constant_section.   

References current_function_decl, named_section::name, section::named, SECTION_NAMED, SECTION_STYLE, and targetm.

Referenced by mergeable_constant_section(), and mergeable_string_section().

◆ function_section()

section * function_section ( tree decl)
Return the section for function DECL.

If DECL is NULL_TREE, return the text section.  We can be passed
NULL_TREE under some circumstances by dbxout.cc at least.   

References first_function_block_is_cold, and function_section_1().

Referenced by assemble_end_function(), assemble_start_function(), dwarf2out_begin_prologue(), find_empty_loc_ranges_at_text_label(), and output_fde().

◆ function_section_1()

static section * function_section_1 ( tree decl,
bool force_cold )
static
Return the section for function DECL.

If DECL is NULL_TREE, return the text section.  We can be passed
NULL_TREE under some circumstances by dbxout.cc at least.

If FORCE_COLD is true, return cold function section ignoring
the frequency info of cgraph_node.   

References DECL_SECTION_NAME, symtab_node::definition_alignment(), cgraph_node::frequency, cgraph_node::get(), symtab_node::get(), get_named_section(), hot_function_section(), NODE_FREQUENCY_NORMAL, NODE_FREQUENCY_UNLIKELY_EXECUTED, NULL, NULL_TREE, cgraph_node::only_called_at_exit, cgraph_node::only_called_at_startup, and targetm.

Referenced by current_function_section(), function_section(), unlikely_text_section(), and unlikely_text_section_p().

◆ get_block_for_decl()

◆ get_block_for_section()

static struct object_block * get_block_for_section ( section * sect)
static
Return the object_block structure for section SECT.  Create a new
structure if we haven't created one already.  Return null if SECT
itself is null.  Return also null for mergeable sections since
section anchors can't be used in mergeable sections anyway,
because the linker might move objects around, and using the
object blocks infrastructure in that case is both a waste and a
maintenance burden.   

References section::common, section_common::flags, ggc_cleared_alloc(), hash_section(), NULL, object_block_htab, object_block::sect, and SECTION_MERGE.

Referenced by build_constant_desc(), force_const_mem(), and get_block_for_decl().

◆ get_cdtor_priority_section()

section * get_cdtor_priority_section ( int priority,
bool constructor_p )
Return the numbered .ctors.N (if CONSTRUCTOR_P) or .dtors.N (if
not) section for PRIORITY.   

References get_section(), MAX_INIT_PRIORITY, NULL, and SECTION_WRITE.

Referenced by default_named_section_asm_out_constructor(), and default_named_section_asm_out_destructor().

◆ get_constant_section()

static section * get_constant_section ( tree exp,
unsigned int align )
static
Return the section into which constant EXP should be placed.   

References compute_reloc_for_constant(), exp(), and targetm.

Referenced by build_constant_desc(), and output_constant_def_contents().

◆ get_constant_size()

static HOST_WIDE_INT get_constant_size ( tree exp)
static

◆ get_elf_initfini_array_priority_section()

static section * get_elf_initfini_array_priority_section ( int priority,
bool constructor_p )
static

◆ get_fnname_from_decl()

const char * get_fnname_from_decl ( tree decl)
Get the function's name, as described by its RTL.  This may be
different from the DECL_NAME name used in the source file.   

References DECL_RTL, gcc_assert, GET_CODE, MEM_P, XEXP, and XSTR.

Referenced by output_function_exception_table(), and rest_of_handle_final().

◆ get_named_section()

section * get_named_section ( tree decl,
const char * name,
int reloc )
Return a section with a particular name and with whatever SECTION_*
flags section_type_flags deems appropriate.  The name of the section
is taken from NAME if nonnull, otherwise it is taken from DECL's
DECL_SECTION_NAME.  DECL is the decl associated with the section
(see the section comment for details) and RELOC is as for
section_type_flags.   

References DECL_P, DECL_SECTION_NAME, gcc_assert, get_section(), NULL, and targetm.

Referenced by default_clone_table_section(), default_elf_select_rtx_section(), default_elf_select_section(), function_section_1(), get_named_text_section(), get_variable_section(), and hot_function_section().

◆ get_named_text_section()

section * get_named_text_section ( tree decl,
const char * text_section_name,
const char * named_section_suffix )
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".   

References alloca, DECL_ASSEMBLER_NAME, DECL_COMDAT_GROUP, DECL_SECTION_NAME, symtab_node::get(), get_named_section(), IDENTIFIER_POINTER, NULL, and targetm.

Referenced by default_function_section().

◆ get_noswitch_section()

static section * get_noswitch_section ( unsigned int flags,
noswitch_section_callback callback )
static
Return a SECTION_NOSWITCH section with the given fields.   

References noswitch_section::callback, noswitch_section::common, section_common::flags, ggc_alloc(), section::noswitch, and SECTION_NOSWITCH.

Referenced by init_varasm_once().

◆ get_pool_constant()

rtx get_pool_constant ( const_rtx addr)
Given a constant pool SYMBOL_REF, return the corresponding constant.   

References SYMBOL_REF_CONSTANT.

Referenced by avoid_constant_pool_reference(), get_some_local_dynamic_name(), mark_jump_label_1(), noce_try_abs(), plus_constant(), replace_label(), and rtx_referenced_p().

◆ get_pool_constant_mark()

rtx get_pool_constant_mark ( rtx addr,
bool * pmarked )
Given a constant pool SYMBOL_REF, return the corresponding constant
and whether it has been output or not.   

References constant_descriptor_rtx::constant, constant_descriptor_rtx::mark, and SYMBOL_REF_CONSTANT.

Referenced by const_ok_for_output_1().

◆ get_pool_mode()

fixed_size_mode get_pool_mode ( const_rtx addr)

◆ get_section()

section * get_section ( const char * name,
unsigned int flags,
tree decl,
bool not_existing )
Return the named section structure associated with NAME.  Create
a new section with the given fields if no such structure exists.
When NOT_EXISTING, then fail if the section already exists.  Return
the existing section if the SECTION_RETAIN bit doesn't match.  Set
the SECTION_WRITE | SECTION_RELRO bits on the existing section
if one of the section flags is SECTION_WRITE | SECTION_RELRO and the
other has none of these flags in named sections and either the section
hasn't been declared yet or has been declared as writable.   

References named_section::common, section::common, named_section::decl, DECL_ATTRIBUTES, DECL_P, DECL_SOURCE_LOCATION, error(), section_common::flags, ggc_alloc(), ggc_strdup, inform(), internal_error(), lookup_attribute(), named_section::name, section::named, NULL, SECTION_BSS, SECTION_CODE, SECTION_DECLARED, SECTION_ENTSIZE, section_htab, SECTION_LINKONCE, SECTION_NAMED, SECTION_NOTYPE, SECTION_OVERRIDE, SECTION_RELRO, SECTION_RETAIN, SECTION_TLS, and SECTION_WRITE.

Referenced by build_gcov_info_var_registration(), default_elf_select_rtx_section(), default_function_rodata_section(), default_named_section_asm_out_constructor(), default_named_section_asm_out_destructor(), default_print_patchable_function_entry(), elf_record_gcc_switches(), file_end_indicate_exec_stack(), file_end_indicate_split_stack(), get_cdtor_priority_section(), get_elf_initfini_array_priority_section(), get_named_section(), init_btf_sections(), init_ctf_sections(), lhd_begin_section(), mergeable_constant_section(), mergeable_string_section(), output_comdat_type_unit(), output_comp_unit(), switch_to_eh_frame_section(), switch_to_exception_section(), and switch_to_frame_table_section().

◆ get_section_anchor()

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.   

References anchor_labelno, object_block::anchors, begin(), create_block_symbol(), end(), GET_MODE_BITSIZE(), ggc_strdup, HOST_WIDE_INT_1U, offset, ptr_mode, SYMBOL_FLAG_ANCHOR, SYMBOL_FLAG_LOCAL, SYMBOL_FLAG_TLS_SHIFT, SYMBOL_REF_BLOCK_OFFSET, SYMBOL_REF_FLAGS, SYMBOL_REF_TLS_MODEL, targetm, vec_safe_insert(), and vec_safe_length().

Referenced by use_anchored_address().

◆ get_tm_clone_pair()

tree get_tm_clone_pair ( tree o)

References NULL_TREE, and tm_clone_hash.

Referenced by ipa_tm_insert_gettmclone_call().

◆ get_unnamed_section()

section * get_unnamed_section ( unsigned int flags,
void(* callback )(const char *),
const char * data )

◆ get_variable_align()

static unsigned int get_variable_align ( tree decl)
static
Return DECL_ALIGN (decl), possibly increased for optimization purposes
beyond what align_variable returned.   

References BITS_PER_WORD, DECL_ALIGN, decl_binds_to_current_def_p(), DECL_INITIAL, DECL_THREAD_LOCAL_P, DECL_USER_ALIGN, error_mark_node, targetm, TREE_PUBLIC, and TREE_TYPE.

Referenced by assemble_variable(), assemble_variable_contents(), emit_common(), get_variable_section(), and place_block_symbol().

◆ get_variable_section()

◆ globalize_decl()

static void globalize_decl ( tree decl)
static

◆ handle_vtv_comdat_section()

static void handle_vtv_comdat_section ( section * sect,
const_tree decl )
static
This function ensures that vtable_map variables are not only
in the comdat section, but that each variable has its own unique
comdat name.  Without this the variables end up in the same section
with a single comdat name.   

References DECL_NAME, and switch_to_comdat_section().

Referenced by assemble_variable(), and output_object_block().

◆ hash_section()

static hashval_t hash_section ( section * sect)
static

◆ have_global_bss_p()

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.   

References bss_noswitch_section, and targetm.

◆ have_optimized_refs()

static bool have_optimized_refs ( struct symtab_node * symbol)
static
Determine whether SYMBOL is used in any optimized function.   

References symtab_node::decl, dyn_cast(), i, symtab_node::iterate_referring(), opt_for_fn, and ipa_ref::referring.

Referenced by optimize_dyn_tls_for_decl_p().

◆ hot_function_section()

static section * hot_function_section ( tree decl)
static
Return the hot section for function DECL.  Return text_section for
null DECLs.   

References DECL_SECTION_NAME, get_named_section(), NULL, NULL_TREE, and text_section.

Referenced by function_section_1().

◆ init_varasm_once()

◆ init_varasm_status()

void init_varasm_status ( void )
Initialize constant pool hashing for a new function.   

References create_constant_pool(), and crtl.

Referenced by prepare_function_start(), read_rtl_function_body(), and read_rtl_function_body_from_file_range().

◆ initializer_constant_valid_for_bitfield_p()

bool initializer_constant_valid_for_bitfield_p ( const_tree value)
Return true if VALUE is a valid constant-valued expression
for use in initializing a static bit-field; one that can be
an element of a "constant" initializer.   

References CONSTRUCTOR_ELTS, FOR_EACH_CONSTRUCTOR_VALUE, initializer_constant_valid_for_bitfield_p(), TREE_CODE, and TREE_OPERAND.

Referenced by immediate_const_ctor_p(), and initializer_constant_valid_for_bitfield_p().

◆ initializer_constant_valid_p()

tree initializer_constant_valid_p ( tree value,
tree endtype,
bool reverse )
Return nonzero if VALUE is a valid constant-valued expression
for use in initializing a static variable; one that can be an
element of a "constant" initializer.

Return null_pointer_node if the value is absolute;
if it is relocatable, return the variable that determines the relocation.
We assume that VALUE has been folded as much as possible;
therefore, we do not need to check for such things as
arithmetic-combinations of integers.   

References AGGREGATE_TYPE_P, initializer_constant_valid_p_1(), NULL, null_pointer_node, NULL_TREE, and VECTOR_TYPE_P.

Referenced by categorize_ctor_elements_1(), tree_switch_conversion::switch_conversion::check_final_bb(), gimplify_init_constructor(), rtl_for_decl_init(), and tree_add_const_value_attribute().

◆ initializer_constant_valid_p_1()

static tree initializer_constant_valid_p_1 ( tree value,
tree endtype,
tree * cache )
static
Helper function of initializer_constant_valid_p.
Return nonzero if VALUE is a valid constant-valued expression
for use in initializing a static variable; one that can be an
element of a "constant" initializer.

Return null_pointer_node if the value is absolute;
if it is relocatable, return the variable that determines the relocation.
We assume that VALUE has been folded as much as possible;
therefore, we do not need to check for such things as
arithmetic-combinations of integers.

Use CACHE (pointer to 2 tree values) for caching if non-NULL.   

References AGGREGATE_TYPE_P, BITS_PER_WORD, cache, CASE_CONVERT, CONSTRUCTOR_ELTS, constructor_static_from_elts_p(), DECL_STATIC_CHAIN, error_mark_node, FOR_EACH_CONSTRUCTOR_VALUE, initializer_constant_valid_p_1(), integer_zerop(), INTEGRAL_TYPE_P, narrowing_initializer_constant_valid_p(), NULL, null_pointer_node, NULL_TREE, operand_equal_p(), POINTER_SIZE, POINTER_TYPE_P, SCALAR_FLOAT_TYPE_P, staticp(), TREE_CODE, TREE_CONSTANT, TREE_NO_TRAMPOLINE, TREE_OPERAND, TREE_STATIC, TREE_TYPE, TYPE_MODE, TYPE_PRECISION, TYPE_REVERSE_STORAGE_ORDER, and TYPE_UNSIGNED.

Referenced by initializer_constant_valid_p(), initializer_constant_valid_p_1(), and narrowing_initializer_constant_valid_p().

◆ integer_asm_op()

const char * integer_asm_op ( int size,
int aligned_p )
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.   

References asm_int_op::di, asm_int_op::hi, NULL, asm_int_op::pdi, asm_int_op::psi, asm_int_op::pti, asm_int_op::si, targetm, and asm_int_op::ti.

Referenced by default_assemble_integer(), default_print_patchable_function_entry(), dw2_asm_output_data(), and dw2_assemble_integer().

◆ lookup_constant_def()

rtx lookup_constant_def ( tree exp)
Look up EXP in the table of constant descriptors.  Return the rtl
if it has been emitted, else null.   

References const_desc_htab, const_hash_1(), exp(), constant_descriptor_tree::hash, NULL_RTX, constant_descriptor_tree::rtl, and constant_descriptor_tree::value.

Referenced by cst_pool_loc_descr(), decode_addr_const(), and expand_debug_expr().

◆ make_debug_expr_from_rtl()

◆ make_decl_one_only()

void make_decl_one_only ( tree decl,
tree comdat_group )

◆ make_decl_rtl()

void make_decl_rtl ( tree decl)
Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL.  DECL should
have static storage duration.  In other words, it should not be an
automatic variable, including PARM_DECLs.

There is, however, one exception: this function handles variables
explicitly placed in a particular register by the user.

This is never called for PARM_DECL nodes.   

References accessible_reg_set, adjust_address_nv, asm_out_file, change_symbol_block(), create_block_symbol(), DECL_ASSEMBLER_NAME, DECL_COMMON, DECL_EXTERNAL, DECL_HARD_REGISTER, DECL_IN_CONSTANT_POOL, DECL_INITIAL, DECL_MODE, DECL_NAME, DECL_REGISTER, DECL_RTL, DECL_RTL_SET_P, DECL_SECTION_NAME, DECL_WEAK, decode_reg_name(), eliminable_regno_p(), error(), error_mark_node, gcc_assert, gen_raw_REG(), gen_rtx_MEM(), get_block_for_decl(), GET_CODE, GET_MODE, globalize_reg(), HARD_FRAME_POINTER_REGNUM, hard_regno_nregs(), IDENTIFIER_POINTER, in_hard_reg_set_p(), MEM_P, symtab_node::name(), NULL, NULL_TREE, operand_reg_set, ORIGINAL_REGNO, output_constant_def(), REG_USERVAR_P, SET_DECL_ASSEMBLER_NAME, SET_DECL_RTL, set_mem_attributes(), SET_SYMBOL_REF_DECL, SYMBOL_REF_HAS_BLOCK_INFO_P, SYMBOL_REF_WEAK, targetm, TREE_CODE, TREE_PUBLIC, TREE_STATIC, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ADDR_SPACE, use_blocks_for_decl_p(), use_object_blocks_p(), VAR_P, warning(), and XEXP.

Referenced by rt_bb_visited::check(), symtab_node::copy_visibility_from(), create_odr_indicator(), do_assemble_alias(), symtab_node::make_decl_local(), and rest_of_decl_compilation().

◆ make_decl_rtl_for_debug()

rtx make_decl_rtl_for_debug ( tree decl)
Like make_decl_rtl, but inhibit creation of new alias sets when
calling make_decl_rtl.  Also, reset DECL_RTL before returning the
rtl.   

References DECL_RTL, DECL_RTL_SET_P, NULL, and SET_DECL_RTL.

Referenced by expand_debug_expr(), and rtl_for_decl_location().

◆ mark_constant_pool()

static void mark_constant_pool ( void )
static
Look through the instructions for this function, and mark all the
entries in POOL which are actually being used.  Emit deferred constants
which have indeed been used.   

References crtl, get_insns(), mark_constants(), n_deferred_constants, and NEXT_INSN().

Referenced by output_constant_pool().

◆ mark_constants()

static void mark_constants ( rtx_insn * insn)
static
Look through appropriate parts of INSN, marking all entries in the
constant pool which are actually being used.  Entries that are only
referenced by other constants are also marked as used.  Emit
deferred strings that are used.   

References dyn_cast(), i, INSN_P, mark_constants_in_pattern(), and PATTERN().

Referenced by mark_constant_pool().

◆ mark_constants_in_pattern()

static void mark_constants_in_pattern ( rtx insn)
static

◆ mark_decl_referenced()

void mark_decl_referenced ( tree decl)

◆ mark_referenced()

void mark_referenced ( tree id)
Set the symbol_referenced flag for ID.   

References TREE_SYMBOL_REFERENCED.

Referenced by assemble_name_resolve().

◆ mark_weak()

static void mark_weak ( tree decl)
static

◆ maybe_assemble_visibility()

bool maybe_assemble_visibility ( tree decl)
A helper function to call assemble_visibility when needed for a decl.   

References DECL_VISIBILITY, targetm, and VISIBILITY_DEFAULT.

Referenced by assemble_start_function(), assemble_variable(), default_elf_asm_output_external(), and do_assemble_alias().

◆ maybe_output_constant_def_contents()

static void maybe_output_constant_def_contents ( struct constant_descriptor_tree * desc,
int defer )
static
Subroutine of output_constant_def: Decide whether or not we need to
output the constant DESC now, and if so, do it.   

References cfun, exp(), n_deferred_constants, output_constant_def_contents(), constant_descriptor_tree::rtl, TREE_ASM_WRITTEN, constant_descriptor_tree::value, and XEXP.

Referenced by output_constant_def().

◆ merge_weak()

void merge_weak ( tree newdecl,
tree olddecl )

◆ mergeable_constant_section()

section * mergeable_constant_section ( machine_mode mode,
unsigned HOST_WIDE_INT align,
unsigned int flags )

◆ mergeable_string_section()

static section * mergeable_string_section ( tree decl,
unsigned HOST_WIDE_INT align,
unsigned int flags )
static

◆ min_align()

static unsigned min_align ( unsigned int a,
unsigned int b )
inlinestatic
A and B are either alignments or offsets.  Return the minimum alignment
that may be assumed after adding the two together.   

References a, b, and least_bit_hwi().

Referenced by alter_reg(), assemble_real(), create_intersect_range_checks(), gen_reg_rtx(), output_constant(), output_constructor_array_range(), output_constructor_regular_field(), and shorten_branches().

◆ narrowing_initializer_constant_valid_p()

static tree narrowing_initializer_constant_valid_p ( tree value,
tree endtype,
tree * cache )
static
A subroutine of initializer_constant_valid_p.  VALUE is a MINUS_EXPR,
PLUS_EXPR or POINTER_PLUS_EXPR.  This looks for cases of VALUE
which are valid when ENDTYPE is an integer of any size; in
particular, this does not accept a pointer minus a constant.  This
returns null_pointer_node if the VALUE is an absolute constant
which can be used to initialize a static variable.  Otherwise it
returns NULL.   

References cache, CONVERT_EXPR_P, error_mark_node, GET_MODE_SIZE(), initializer_constant_valid_p_1(), INTEGRAL_TYPE_P, NULL, null_pointer_node, NULL_TREE, operand_equal_p(), SCALAR_INT_MODE_P, SCALAR_INT_TYPE_MODE, TREE_CODE, TREE_OPERAND, TREE_TYPE, and TYPE_MODE.

Referenced by initializer_constant_valid_p_1().

◆ notice_global_symbol()

void notice_global_symbol ( tree decl)
DECL is an object (either VAR_DECL or FUNCTION_DECL) which is going
to be output to assembler.
Set first_global_object_name and weak_global_object_name as appropriate.   

References DECL_ASSEMBLER_NAME, DECL_COMMON, DECL_EXTERNAL, DECL_HARD_REGISTER, DECL_INITIAL, DECL_NAME, DECL_ONE_ONLY, DECL_WEAK, error_mark_node, first_global_object_name, ggc_strdup, IDENTIFIER_POINTER, targetm, TREE_CODE, TREE_PUBLIC, ultimate_transparent_alias_target(), VAR_P, and weak_global_object_name.

Referenced by assemble_start_function(), assemble_variable(), varpool_node::finalize_decl(), and cgraph_node::finalize_function().

◆ optimize_constant_pool()

◆ optimize_dyn_tls_for_decl_p()

static bool optimize_dyn_tls_for_decl_p ( const_tree decl)
static
Check if promoting general-dynamic TLS access model to local-dynamic is
desirable for DECL.   

References cfun, symtab_node::get(), have_optimized_refs(), IPA, symbol_table::state, and symtab.

Referenced by decl_default_tls_model().

◆ output_addressed_constants()

static void output_addressed_constants ( tree exp,
int defer )
static
Find all the constants whose addresses are referenced inside of EXP,
and make sure assembler code with a label has been output for each one.
Indicate whether an ADDR_EXPR has been encountered.   

References CASE_CONVERT, CONSTANT_CLASS_P, CONSTRUCTOR_ELTS, DECL_INITIAL, exp(), FOR_EACH_CONSTRUCTOR_VALUE, gcc_fallthrough, handled_component_p(), output_addressed_constants(), output_constant_def(), TREE_CODE, and TREE_OPERAND.

Referenced by add_constant_to_table(), assemble_variable(), output_addressed_constants(), and output_constant_def_contents().

◆ output_constant()

static unsigned HOST_WIDE_INT output_constant ( tree exp,
unsigned HOST_WIDE_INT size,
unsigned int align,
bool reverse,
bool merge_strings )
static
Output assembler code for constant EXP, 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 at least SIZE bytes of assembler data, padding at the end
with zeros if necessary.  SIZE must always be specified.  The returned
value is the actual number of bytes of assembler data generated, which
may be bigger than SIZE if the object contains a variable length field.

SIZE is important for structure constructors,
since trailing members may have been omitted from the constructor.
It is also important for initialization of arrays from string constants
since the full length of the string constant might not be wanted.
It is also needed for initialization of unions, where the initializer's
type is just one member, and that may not be as long as the union.

There a case in which we would fail to output exactly SIZE bytes:
for a structure constructor that wants to produce more than SIZE bytes.
But such constructors will never be generated for any possible input.

ALIGN is the alignment of the data in bits.

If REVERSE is true, EXP is output in reverse storage order.   

References bitint_info::abi_limb_mode, as_a(), asm_out_file, assemble_integer(), assemble_real(), assemble_string(), assemble_zeros(), bitint_info::big_endian, build1(), build_int_cst(), build_nonstandard_integer_type(), CEIL, check_string_literal(), CONSTRUCTOR_ELTS, CONVERT_EXPR_P, error(), exp(), expand_expr(), EXPAND_INITIALIZER, flip_storage_order(), fold_convert, wide_int_storage::from(), gcc_assert, gcc_checking_assert, gcc_unreachable, GET_MODE_ALIGNMENT, GET_MODE_PRECISION(), GET_MODE_SIZE(), HOST_BITS_PER_WIDE_INT, i, int_size_in_bytes(), bitint_info::limb_mode, MIN, min_align(), NULL, NULL_RTX, output_constant(), output_constructor(), POINTER_TYPE_P, wi::rshift(), SCALAR_FLOAT_TYPE_MODE, SCALAR_INT_TYPE_MODE, SCALAR_TYPE_MODE, targetm, wi::to_wide(), TREE_CODE, TREE_IMAGPART, TREE_INT_CST_ELT, TREE_INT_CST_EXT_NUNITS, tree_int_cst_sgn(), TREE_OPERAND, TREE_REAL_CST, TREE_REALPART, TREE_STRING_LENGTH, TREE_STRING_POINTER, tree_to_shwi(), TREE_TYPE, TYPE_ADDR_SPACE, TYPE_MODE, TYPE_PRECISION, TYPE_SIGN, UNSIGNED, vec_safe_is_empty(), VECTOR_CST_ELT, VECTOR_CST_NELTS, and wide_int_to_tree().

Referenced by assemble_constant_contents(), assemble_variable_contents(), output_constant(), output_constructor_array_range(), and output_constructor_regular_field().

◆ output_constant_def()

rtx output_constant_def ( tree exp,
int defer )
Return an rtx representing a reference to constant data in memory
for the constant expression EXP.

If assembler code for such a constant has already been output,
return an rtx to refer to it.
Otherwise, output such a constant in memory
and generate an rtx for it.

If DEFER is nonzero, this constant can be deferred and output only
if referenced in the function after all optimizations.

`const_desc_table' records which constants already have label strings.   

References add_constant_to_table(), exp(), maybe_output_constant_def_contents(), and constant_descriptor_tree::rtl.

Referenced by expand_expr_constant(), make_decl_rtl(), and output_addressed_constants().

◆ output_constant_def_contents()

◆ output_constant_pool()

static void output_constant_pool ( const char * fnname,
tree fndecl )
static
Mark all constants that are used in the current function, then write
out the function's private constant pool.   

References asm_out_file, crtl, mark_constant_pool(), rtx_constant_pool::offset, output_constant_pool_contents(), and recompute_pool_offsets().

Referenced by assemble_end_function(), and assemble_start_function().

◆ output_constant_pool_1()

◆ output_constant_pool_2()

◆ output_constant_pool_contents()

◆ output_constructor()

◆ output_constructor_array_range()

◆ output_constructor_bitfield()

◆ output_constructor_regular_field()

◆ output_file_directive()

void output_file_directive ( FILE * asm_file,
const char * input_name )
Output a file name in the form wanted by System V.   

References NULL, remap_debug_filename(), and targetm.

Referenced by default_file_start().

◆ output_object_block()

◆ output_object_block_compare()

static int output_object_block_compare ( const void * x,
const void * y )
static
A callback for qsort to compare object_blocks.   

References section::common, f1, f2, section_common::flags, named_section::name, section::named, object_block::sect, SECTION_NAMED, and y.

Referenced by output_object_blocks().

◆ output_object_blocks()

void output_object_blocks ( void )
Output the definitions of all object_blocks.   

References FOR_EACH_HASH_TABLE_ELEMENT, FOR_EACH_VEC_ELT, i, object_block_htab, output_object_block(), and output_object_block_compare().

Referenced by compile_file().

◆ output_section_asm_op()

void output_section_asm_op ( const char * directive)
Output DIRECTIVE (a C string) followed by a newline.  This is used as
a get_unnamed_section callback.   

References asm_out_file.

Referenced by init_varasm_once().

◆ output_shared_constant_pool()

void output_shared_constant_pool ( void )
Write the contents of the shared constant pool.   

References optimize_constant_pool(), output_constant_pool_contents(), shared_constant_pool, and TARGET_SUPPORTS_ALIASES.

Referenced by compile_file().

◆ place_block_symbol()

◆ process_pending_assemble_externals()

◆ recompute_pool_offsets()

static void recompute_pool_offsets ( struct rtx_constant_pool * pool)
static
Recompute the offsets of entries in POOL, and the overall size of
POOL.  Do this after calling mark_constant_pool to ensure that we
are computing the offset values for the pool which we will actually
emit.   

References constant_descriptor_rtx::align, rtx_constant_pool::first, GET_MODE_SIZE(), constant_descriptor_rtx::mark, constant_descriptor_rtx::mode, constant_descriptor_rtx::next, constant_descriptor_rtx::offset, and rtx_constant_pool::offset.

Referenced by output_constant_pool().

◆ record_tm_clone_pair()

◆ resolution_local_p()

static bool resolution_local_p ( enum ld_plugin_symbol_resolution resolution)
static
Return true when RESOLUTION indicate that symbol will be bound locally
within current executable or DSO.   

Referenced by default_binds_local_p_3().

◆ resolution_to_local_definition_p()

static bool resolution_to_local_definition_p ( enum ld_plugin_symbol_resolution resolution)
static
Return true when RESOLUTION indicate that symbol will be bound to the
definition provided by current .o file.   

Referenced by decl_binds_to_current_def_p(), and default_binds_local_p_3().

◆ resolve_unique_section()

void resolve_unique_section ( tree decl,
int reloc,
int flag_function_or_data_sections )

◆ set_implicit_section()

static bool set_implicit_section ( struct symtab_node * n,
void * data )
static
Worker for resolve_unique_section.   

References symtab_node::implicit_section.

Referenced by resolve_unique_section().

◆ set_user_assembler_name()

void set_user_assembler_name ( tree decl,
const char * name )
The user has asked for a DECL to have a particular name.  Set (or
change) it in such a way that we don't prefix an underscore to
it.   

References alloca, symbol_table::change_decl_assembler_name(), get_identifier(), symtab_node::name(), NULL_RTX, SET_DECL_RTL, and symtab.

Referenced by set_builtin_user_assembler_name(), and set_user_assembler_libfunc().

◆ simplify_subtraction()

rtx simplify_subtraction ( rtx x)
Given a MINUS expression, simplify it if both sides
include the same symbol.   

References r, and simplify_rtx().

Referenced by output_addr_const().

◆ strip_reg_name()

static const char * strip_reg_name ( const char * name)
static
Given NAME, a putative register name, discard any customary prefixes.   

References symtab_node::name().

Referenced by decode_reg_name_and_count().

◆ supports_one_only()

bool supports_one_only ( void )
Returns true if the target configuration supports defining public symbols
so that one of them will be chosen at link time instead of generating a
multiply-defined symbol error, whether through the use of weak symbols or
a target-specific mechanism for having duplicates discarded.   

References SUPPORTS_ONE_ONLY, and TARGET_SUPPORTS_WEAK.

◆ switch_to_comdat_section()

void switch_to_comdat_section ( section * sect,
tree decl )
Switch to a COMDAT section with COMDAT name of decl.

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)".   

References named_section::common, DECL_COMDAT_GROUP, section_common::flags, IDENTIFIER_POINTER, in_section, named_section::name, section::named, NULL, SECTION_LINKONCE, switch_to_section(), TARGET_PECOFF, targetm, and TREE_CODE.

Referenced by default_print_patchable_function_entry(), and handle_vtv_comdat_section().

◆ switch_to_other_text_partition()

void switch_to_other_text_partition ( void )
Switch to the other function partition (if inside of hot section
into cold section, otherwise into the hot section).   

References current_function_section(), in_cold_section_p, and switch_to_section().

◆ switch_to_section()

void switch_to_section ( section * new_section,
tree decl )
Emit assembly code to switch to section NEW_SECTION.  Do nothing if
the current section is NEW_SECTION.   

References unnamed_section::callback, named_section::common, section::common, unnamed_section::data, named_section::decl, DECL_ATTRIBUTES, DECL_P, DECL_SOURCE_LOCATION, section_common::flags, gcc_unreachable, in_section, inform(), lookup_attribute(), named_section::name, section::named, SECTION_DECLARED, SECTION_NAMED, SECTION_NOSWITCH, SECTION_RETAIN, SECTION_STYLE, SECTION_UNNAMED, targetm, section::unnamed, and warning().

Referenced by assemble_addr_to_section(), assemble_end_function(), assemble_start_function(), assemble_trampoline_template(), assemble_variable(), symbol_table::compile(), default_print_patchable_function_entry(), dump_tm_clone_pairs(), dwarf2out_begin_prologue(), dwarf2out_switch_text_section(), elf_record_gcc_switches(), dwarf_file_hasher::equal(), file_end_indicate_exec_stack(), file_end_indicate_split_stack(), final_scan_insn_1(), find_empty_loc_ranges_at_text_label(), lhd_begin_section(), lhd_end_section(), output_btf_header(), output_comdat_type_unit(), output_comp_unit(), output_constant_def_contents(), output_constant_pool_contents(), output_ctf_header(), output_fde(), output_function_exception_table(), output_object_block(), output_pubtables(), output_ranges(), output_rnglists(), output_skeleton_debug_sections(), profile_function(), run_rtl_passes(), switch_to_comdat_section(), switch_to_eh_frame_section(), switch_to_exception_section(), switch_to_frame_table_section(), and switch_to_other_text_partition().

◆ tm_alias_pair_cmp()

static int tm_alias_pair_cmp ( const void * x,
const void * y )
static
Helper comparison function for qsorting by the DECL_UID stored in
alias_pair->emitted_diags.   

References tm_alias_pair::uid, and y.

Referenced by finish_tm_clone_pairs().

◆ tree_output_constant_def()

tree tree_output_constant_def ( tree exp)
Return a tree representing a reference to constant data in memory
for the constant expression EXP.

This is the counterpart of output_constant_def at the Tree level.   

References add_constant_to_table(), exp(), varpool_node::finalize_decl(), constant_descriptor_tree::rtl, SYMBOL_REF_DECL, and XEXP.

Referenced by expand_expr_real_1(), gimple_lower_bitint(), gimplify_init_constructor(), and gimplify_init_ctor_eval().

◆ ultimate_transparent_alias_target()

static tree ultimate_transparent_alias_target ( tree * alias)
inlinestatic
Follow the IDENTIFIER_TRANSPARENT_ALIAS chain starting at *ALIAS
until we find an identifier that is not itself a transparent alias.
Modify the alias passed to it by reference (and all aliases on the
way to the ultimate target), such that they do not have to be
followed again, and return the ultimate target of the alias
chain.   

References symtab_node::alias, gcc_assert, IDENTIFIER_TRANSPARENT_ALIAS, TREE_CHAIN, and ultimate_transparent_alias_target().

Referenced by assemble_alias(), assemble_name_resolve(), default_assemble_visibility(), default_unique_section(), do_assemble_alias(), do_assemble_symver(), globalize_decl(), notice_global_symbol(), ultimate_transparent_alias_target(), and weak_finish().

◆ unlikely_text_section()

section * unlikely_text_section ( void )
Tell assembler to switch to unlikely-to-be-executed text section.   

References current_function_decl, and function_section_1().

Referenced by assemble_end_function(), assemble_start_function(), and find_empty_loc_ranges_at_text_label().

◆ unlikely_text_section_p()

bool unlikely_text_section_p ( section * sect)
When called within a function context, return true if the function
has been assigned a cold text section and if SECT is that section.
When called outside a function context, return true if SECT is the
default cold section.   

References current_function_decl, and function_section_1().

◆ use_blocks_for_decl_p()

static bool use_blocks_for_decl_p ( tree decl)
static
Return true if it is possible to put DECL in an object_block.   

References symtab_node::alias, DECL_INITIAL, symtab_node::get(), NULL, targetm, TREE_CODE, and VAR_P.

Referenced by categorize_decl_for_section(), and make_decl_rtl().

◆ use_object_blocks_p()

static bool use_object_blocks_p ( void )
static
Return true if the current compilation mode benefits from having
objects grouped into blocks.   

Referenced by build_constant_desc(), categorize_decl_for_section(), force_const_mem(), and make_decl_rtl().

◆ varasm_cc_finalize()

◆ weak_finish()

◆ weak_finish_1()

static void weak_finish_1 ( tree decl)
static

Variable Documentation

◆ alias_pairs

◆ anchor_labelno

int anchor_labelno
static
The next number to use for internal anchor labels.   

Referenced by get_section_anchor(), and varasm_cc_finalize().

◆ bss_noswitch_section

section* bss_noswitch_section
A SECTION_NOSWITCH section used for declaring global BSS variables.
May be null.   

Referenced by get_variable_section(), have_global_bss_p(), init_varasm_once(), and varasm_cc_finalize().

◆ bss_section

◆ cold_function_name

tree cold_function_name = NULL_TREE
The following global holds the "function name" for the code in the
cold section of a function, if hot/cold function splitting is enabled
and there was actually code that went into the cold section.  A
pseudo function name is needed for the cold section of code for some
debugging tools that perform symbolization.  

Referenced by assemble_end_function(), assemble_start_function(), final_scan_insn_1(), and varasm_cc_finalize().

◆ comm_section

◆ const_desc_htab

◆ const_labelno

int const_labelno
static
Number for making the label on the next
constant that is stored in memory.   

Referenced by assemble_start_function(), assemble_static_space(), build_constant_desc(), force_const_mem(), and varasm_cc_finalize().

◆ ctors_section

section* ctors_section

◆ data_section

◆ dtors_section

section* dtors_section

◆ eh_frame_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.   

Referenced by switch_to_eh_frame_section(), and varasm_cc_finalize().

◆ elf_fini_array_section

section* elf_fini_array_section
static

◆ elf_init_array_section

section* elf_init_array_section
static

◆ exception_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.   

Referenced by switch_to_exception_section(), and varasm_cc_finalize().

◆ first_function_block_is_cold

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 assemble_end_function(), assemble_function_label_final(), assemble_start_function(), decide_function_section(), dw2_output_call_site_table(), dw_loc_list(), function_section(), and varasm_cc_finalize().

◆ first_global_object_name

const char* first_global_object_name
Output variables, constants and external declarations, for GNU compiler.
   Copyright (C) 1987-2024 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 file handles generation of all the assembler code
*except* the instructions of a function.
This includes declarations of variables and their initial values.

We also output the assembler code for constants stored in memory
and are responsible for combining constants with the same value.   
The (assembler) name of the first globally-visible object output.   

Referenced by coverage_compute_profile_id(), get_file_function_name(), notice_global_symbol(), and varasm_cc_finalize().

◆ in_cold_section_p

◆ in_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.   

Referenced by assemble_end_function(), assemble_zeros(), default_print_patchable_function_entry(), lhd_begin_section(), output_constant_pool_1(), switch_to_comdat_section(), switch_to_section(), and varasm_cc_finalize().

◆ initial_trampoline

rtx initial_trampoline
static
Assemble the static constant template for function entry trampolines.
This is done at most once per compilation.
Returns an RTX for the address of the template.   

Referenced by assemble_trampoline_template(), and varasm_cc_finalize().

◆ last_assemble_variable_decl

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.   

Referenced by assemble_variable(), assemble_variable_contents(), rest_of_decl_compilation(), and varasm_cc_finalize().

◆ lcomm_section

◆ object_block_htab

hash_table<object_block_hasher>* object_block_htab
static
A table of object_blocks, indexed by section.   

Referenced by get_block_for_section(), init_varasm_once(), output_object_blocks(), and varasm_cc_finalize().

◆ pending_assemble_externals

tree pending_assemble_externals
static
We delay assemble_external processing until
the compilation unit is finalized.  This is the best we can do for
right now (i.e. stage 3 of GCC 4.0) - the right thing is to delay
it all the way to final.  See PR 17982 for further discussion.   

Referenced by assemble_external(), process_pending_assemble_externals(), and varasm_cc_finalize().

◆ pending_libcall_symbols

rtx pending_libcall_symbols
static
A similar list of pending libcall symbols.  We only want to declare
symbols that are actually used in the final assembly.   

Referenced by assemble_external_libcall(), process_pending_assemble_externals(), and varasm_cc_finalize().

◆ readonly_data_section

◆ saw_no_split_stack

bool saw_no_split_stack
static
Whether we saw any functions with no_split_stack.   

Referenced by assemble_start_function(), file_end_indicate_split_stack(), and varasm_cc_finalize().

◆ sbss_section

section* sbss_section

◆ sdata_section

section* sdata_section

◆ section_htab

hash_table<section_hasher>* section_htab
static
Hash table of named sections.   

Referenced by get_section(), init_varasm_once(), and varasm_cc_finalize().

◆ shared_constant_pool

struct rtx_constant_pool* shared_constant_pool
static
A pool of constants that can be shared between functions.   

Referenced by force_const_mem(), init_varasm_once(), output_shared_constant_pool(), and varasm_cc_finalize().

◆ size_directive_output

int size_directive_output
Carry information from ASM_DECLARE_OBJECT_NAME
to ASM_FINISH_DECLARE_OBJECT.   

Referenced by varasm_cc_finalize().

◆ text_section

◆ tls_comm_section

section* tls_comm_section
Various forms of common section.  All are guaranteed to be nonnull.   

Referenced by get_variable_section(), init_varasm_once(), and varasm_cc_finalize().

◆ tm_clone_hash

◆ trampolines_created

int trampolines_created
This is a generic routine suitable for use as TARGET_ASM_FILE_END
which emits a special section directive used to indicate whether or
not this object file needs an executable stack.  This is primarily
a GNU extension to ELF but could be used on other targets.   

Referenced by expand_builtin_init_trampoline(), file_end_indicate_exec_stack(), and varasm_cc_finalize().

◆ unnamed_sections

section* unnamed_sections
static
A linked list of all the unnamed sections.   

Referenced by get_unnamed_section(), and varasm_cc_finalize().

◆ weak_decls

tree weak_decls
static
This TREE_LIST contains any weak symbol declarations waiting
to be emitted.   

Referenced by assemble_external(), do_assemble_alias(), globalize_decl(), merge_weak(), varasm_cc_finalize(), and weak_finish().

◆ weak_global_object_name

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

Referenced by get_file_function_name(), notice_global_symbol(), and varasm_cc_finalize().

◆ weakref_targets

tree weakref_targets
static
This TREE_LIST contains weakref targets.   

Referenced by do_assemble_alias(), globalize_decl(), varasm_cc_finalize(), and weak_finish().