Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/perseant-stdc-iso10646]: src/external/gpl3/gcc/dist/gcc 1419816
details: https://anonhg.NetBSD.org/src/rev/54213d6f40fb
branches: perseant-stdc-iso10646
changeset: 850663:54213d6f40fb
user: joerg <joerg%NetBSD.org@localhost>
date: Mon Jul 17 19:53:11 2017 +0000
description:
1419816
diffstat:
external/gpl3/gcc/dist/gcc/varasm.c | 7766 +++++++++++++++++++++++++++++++++++
1 files changed, 7766 insertions(+), 0 deletions(-)
diffs (truncated from 7770 to 300 lines):
diff -r 2ead95ba6a93 -r 54213d6f40fb external/gpl3/gcc/dist/gcc/varasm.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl3/gcc/dist/gcc/varasm.c Mon Jul 17 19:53:11 2017 +0000
@@ -0,0 +1,7766 @@
+/* Output variables, constants and external declarations, for GNU compiler.
+ Copyright (C) 1987-2015 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. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "rtl.h"
+#include "hash-set.h"
+#include "machmode.h"
+#include "vec.h"
+#include "double-int.h"
+#include "input.h"
+#include "alias.h"
+#include "symtab.h"
+#include "wide-int.h"
+#include "inchash.h"
+#include "tree.h"
+#include "fold-const.h"
+#include "stor-layout.h"
+#include "stringpool.h"
+#include "varasm.h"
+#include "flags.h"
+#include "hard-reg-set.h"
+#include "function.h"
+#include "hashtab.h"
+#include "statistics.h"
+#include "real.h"
+#include "fixed-value.h"
+#include "insn-config.h"
+#include "expmed.h"
+#include "dojump.h"
+#include "explow.h"
+#include "calls.h"
+#include "emit-rtl.h"
+#include "stmt.h"
+#include "expr.h"
+#include "regs.h"
+#include "output.h"
+#include "diagnostic-core.h"
+#include "ggc.h"
+#include "langhooks.h"
+#include "tm_p.h"
+#include "debug.h"
+#include "target.h"
+#include "common/common-target.h"
+#include "targhooks.h"
+#include "predict.h"
+#include "dominance.h"
+#include "cfg.h"
+#include "basic-block.h"
+#include "hash-map.h"
+#include "is-a.h"
+#include "plugin-api.h"
+#include "ipa-ref.h"
+#include "cgraph.h"
+#include "asan.h"
+#include "rtl-iter.h"
+#include "tree-chkp.h"
+
+#ifdef XCOFF_DEBUGGING_INFO
+#include "xcoffout.h" /* Needed for external data
+ declarations for e.g. AIX 4.x. */
+#endif
+
+/* The (assembler) name of the first globally-visible object output. */
+extern GTY(()) const char *first_global_object_name;
+extern GTY(()) const char *weak_global_object_name;
+
+const char *first_global_object_name;
+const char *weak_global_object_name;
+
+struct addr_const;
+struct constant_descriptor_rtx;
+struct rtx_constant_pool;
+
+#define n_deferred_constants (crtl->varasm.deferred_constants)
+
+/* Number for making the label on the next
+ constant that is stored in memory. */
+
+static GTY(()) int const_labelno;
+
+/* Carry information from ASM_DECLARE_OBJECT_NAME
+ to ASM_FINISH_DECLARE_OBJECT. */
+
+int size_directive_output;
+
+/* 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. */
+
+tree last_assemble_variable_decl;
+
+/* The following global variable indicates if the first basic block
+ in a function belongs to the cold partition or not. */
+
+bool first_function_block_is_cold;
+
+/* Whether we saw any functions with no_split_stack. */
+
+static bool saw_no_split_stack;
+
+static const char *strip_reg_name (const char *);
+static int contains_pointers_p (tree);
+#ifdef ASM_OUTPUT_EXTERNAL
+static bool incorporeal_function_p (tree);
+#endif
+static void decode_addr_const (tree, struct addr_const *);
+static hashval_t const_hash_1 (const tree);
+static int compare_constant (const tree, const tree);
+static void output_constant_def_contents (rtx);
+static void output_addressed_constants (tree);
+static unsigned HOST_WIDE_INT output_constant (tree, unsigned HOST_WIDE_INT,
+ unsigned int);
+static void globalize_decl (tree);
+static bool decl_readonly_section_1 (enum section_category);
+#ifdef BSS_SECTION_ASM_OP
+#ifdef ASM_OUTPUT_ALIGNED_BSS
+static void asm_output_aligned_bss (FILE *, tree, const char *,
+ unsigned HOST_WIDE_INT, int)
+ ATTRIBUTE_UNUSED;
+#endif
+#endif /* BSS_SECTION_ASM_OP */
+static void mark_weak (tree);
+static void output_constant_pool (const char *, tree);
+
+/* Well-known sections, each one associated with some sort of *_ASM_OP. */
+section *text_section;
+section *data_section;
+section *readonly_data_section;
+section *sdata_section;
+section *ctors_section;
+section *dtors_section;
+section *bss_section;
+section *sbss_section;
+
+/* Various forms of common section. All are guaranteed to be nonnull. */
+section *tls_comm_section;
+section *comm_section;
+section *lcomm_section;
+
+/* A SECTION_NOSWITCH section used for declaring global BSS variables.
+ May be null. */
+section *bss_noswitch_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. */
+section *exception_section;
+
+/* The section that holds the DWARF2 frame unwind information, when known.
+ The section is set either by the target's init_sections hook or by the
+ first call to switch_to_eh_frame_section. */
+section *eh_frame_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. */
+section *in_section;
+
+/* True if code for the current function is currently being directed
+ at the cold section. */
+bool in_cold_section_p;
+
+/* A linked list of all the unnamed sections. */
+static GTY(()) section *unnamed_sections;
+
+/* Return a nonzero value if DECL has a section attribute. */
+#define IN_NAMED_SECTION(DECL) \
+ ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
+ && DECL_SECTION_NAME (DECL) != NULL)
+
+struct section_hasher : ggc_hasher<section *>
+{
+ typedef const char *compare_type;
+
+ static hashval_t hash (section *);
+ static bool equal (section *, const char *);
+};
+
+/* Hash table of named sections. */
+static GTY(()) hash_table<section_hasher> *section_htab;
+
+struct object_block_hasher : ggc_hasher<object_block *>
+{
+ typedef const section *compare_type;
+
+ static hashval_t hash (object_block *);
+ static bool equal (object_block *, const section *);
+};
+
+/* A table of object_blocks, indexed by section. */
+static GTY(()) hash_table<object_block_hasher> *object_block_htab;
+
+/* The next number to use for internal anchor labels. */
+static GTY(()) int anchor_labelno;
+
+/* A pool of constants that can be shared between functions. */
+static GTY(()) struct rtx_constant_pool *shared_constant_pool;
+
+/* Helper routines for maintaining section_htab. */
+
+bool
+section_hasher::equal (section *old, const char *new_name)
+{
+ return strcmp (old->named.name, new_name) == 0;
+}
+
+hashval_t
+section_hasher::hash (section *old)
+{
+ return htab_hash_string (old->named.name);
+}
+
+/* Return a hash value for section SECT. */
+
+static hashval_t
+hash_section (section *sect)
+{
+ if (sect->common.flags & SECTION_NAMED)
+ return htab_hash_string (sect->named.name);
+ return sect->common.flags;
+}
+
+/* Helper routines for maintaining object_block_htab. */
+
+inline bool
+object_block_hasher::equal (object_block *old, const section *new_section)
+{
+ return old->sect == new_section;
+}
+
+hashval_t
+object_block_hasher::hash (object_block *old)
+{
+ return hash_section (old->sect);
+}
+
+/* Return a new unnamed section with the given fields. */
+
+section *
+get_unnamed_section (unsigned int flags, void (*callback) (const void *),
+ const void *data)
+{
+ section *sect;
+
+ sect = ggc_alloc<section> ();
+ sect->unnamed.common.flags = flags | SECTION_UNNAMED;
+ sect->unnamed.callback = callback;
+ sect->unnamed.data = data;
+ sect->unnamed.next = unnamed_sections;
+
+ unnamed_sections = sect;
+ return sect;
+}
+
+/* Return a SECTION_NOSWITCH section with the given fields. */
+
+static section *
+get_noswitch_section (unsigned int flags, noswitch_section_callback callback)
+{
+ section *sect;
+
+ sect = ggc_alloc<section> ();
+ sect->noswitch.common.flags = flags | SECTION_NOSWITCH;
+ sect->noswitch.callback = callback;
+
+ return sect;
+}
+
+/* Return the named section structure associated with NAME. Create
Home |
Main Index |
Thread Index |
Old Index