section *dtors_section;
section *bss_section;
section *sbss_section;
-section *init_section;
-section *fini_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
been selected or if we lose track of what the current section is. */
section *in_section;
-/* The last text section used by asm_out_file. */
-section *last_text_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;
#endif /* BSS_SECTION_ASM_OP */
+#ifndef USE_SELECT_SECTION_FOR_FUNCTIONS
+/* Return the hot section for function DECL. Return text_section for
+ null DECLs. */
+
+static section *
+hot_function_section (tree decl)
+{
+ if (decl != NULL_TREE
+ && DECL_SECTION_NAME (decl) != NULL_TREE
+ && targetm.have_named_sections)
+ return get_named_section (decl, NULL, 0);
+ else
+ return text_section;
+}
+#endif
+
/* Return the section for function DECL.
If DECL is NULL_TREE, return the text section. We can be passed
#ifdef USE_SELECT_SECTION_FOR_FUNCTIONS
return targetm.asm_out.select_section (decl, reloc, DECL_ALIGN (decl));
#else
- if (decl != NULL_TREE
- && DECL_SECTION_NAME (decl) != NULL_TREE
- && targetm.have_named_sections)
- return get_named_section (decl, NULL, 0);
- else
- return text_section;
+ return hot_function_section (decl);
#endif
}
current_function_section (void)
{
#ifdef USE_SELECT_SECTION_FOR_FUNCTIONS
- int reloc = 0;
-
- if (unlikely_text_section_p (last_text_section))
- reloc = 1;
-
- return targetm.asm_out.select_section (current_function_decl, reloc,
+ return targetm.asm_out.select_section (current_function_decl,
+ in_cold_section_p,
DECL_ALIGN (current_function_decl));
#else
- if (last_text_section)
- return last_text_section;
- return function_section (current_function_decl);
+ return (in_cold_section_p
+ ? unlikely_text_section ()
+ : hot_function_section (current_function_decl));
#endif
}
if (flag_reorder_blocks_and_partition)
{
- unlikely_text_section ();
+ switch_to_section (unlikely_text_section ());
assemble_align (FUNCTION_BOUNDARY);
ASM_OUTPUT_LABEL (asm_out_file, cfun->cold_section_label);
first_function_block_is_cold = true;
}
- last_text_section = NULL;
+ in_cold_section_p = first_function_block_is_cold;
/* Switch to the correct text section for the start of the function. */
section *save_text_section;
save_text_section = in_section;
- unlikely_text_section ();
+ switch_to_section (unlikely_text_section ());
ASM_OUTPUT_LABEL (asm_out_file, cfun->cold_section_end_label);
if (first_function_block_is_cold)
switch_to_section (text_section);
switch (GET_MODE_CLASS (mode))
{
case MODE_FLOAT:
+ case MODE_DECIMAL_FLOAT:
{
REAL_VALUE_TYPE r;
case ADDR_EXPR:
case FDESC_EXPR:
value = staticp (TREE_OPERAND (value, 0));
- /* "&(*a).f" is like unto pointer arithmetic. If "a" turns out to
- be a constant, this is old-skool offsetof-like nonsense. */
- if (value
- && TREE_CODE (value) == INDIRECT_REF
- && TREE_CONSTANT (TREE_OPERAND (value, 0)))
- return null_pointer_node;
- /* Taking the address of a nested function involves a trampoline. */
- if (value
- && TREE_CODE (value) == FUNCTION_DECL
- && ((decl_function_context (value) && !DECL_NO_STATIC_CHAIN (value))
- || DECL_DLLIMPORT_P (value)))
- return NULL_TREE;
+ if (value)
+ {
+ /* "&(*a).f" is like unto pointer arithmetic. If "a" turns out to
+ be a constant, this is old-skool offsetof-like nonsense. */
+ if (TREE_CODE (value) == INDIRECT_REF
+ && TREE_CONSTANT (TREE_OPERAND (value, 0)))
+ return null_pointer_node;
+ /* Taking the address of a nested function involves a trampoline. */
+ if (TREE_CODE (value) == FUNCTION_DECL
+ && ((decl_function_context (value)
+ && !DECL_NO_STATIC_CHAIN (value))
+ || DECL_DLLIMPORT_P (value)))
+ return NULL_TREE;
+ /* "&{...}" requires a temporary to hold the constructed
+ object. */
+ if (TREE_CODE (value) == CONSTRUCTOR)
+ return NULL_TREE;
+ }
return value;
case VIEW_CONVERT_EXPR:
i = size_binop (MINUS_EXPR, convert (sizetype, max_index),
convert (sizetype,
TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (val)))));
- i = size_binop (PLUS_EXPR, i, convert (sizetype, integer_one_node));
+ i = size_binop (PLUS_EXPR, i, build_int_cst (sizetype, 1));
/* Multiply by the array element unit size to find number of bytes. */
i = size_binop (MULT_EXPR, i, TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (val))));
SBSS_SECTION_ASM_OP);
#endif
-#ifdef INIT_SECTION_ASM_OP
- init_section = get_unnamed_section (SECTION_CODE, output_section_asm_op,
- INIT_SECTION_ASM_OP);
-#endif
-
-#ifdef FINI_SECTION_ASM_OP
- fini_section = get_unnamed_section (SECTION_CODE, output_section_asm_op,
- FINI_SECTION_ASM_OP);
-#endif
-
targetm.asm_out.init_sections ();
if (readonly_data_section == NULL)
prefix = one_only ? ".gnu.linkonce.s2." : ".sdata2.";
break;
case SECCAT_DATA:
+ prefix = one_only ? ".gnu.linkonce.d." : ".data.";
+ break;
case SECCAT_DATA_REL:
+ prefix = one_only ? ".gnu.linkonce.d.rel." : ".data.rel.";
+ break;
case SECCAT_DATA_REL_LOCAL:
+ prefix = one_only ? ".gnu.linkonce.d.rel.local." : ".data.rel.local.";
+ break;
case SECCAT_DATA_REL_RO:
+ prefix = one_only ? ".gnu.linkonce.d.rel.ro." : ".data.rel.ro.";
+ break;
case SECCAT_DATA_REL_RO_LOCAL:
- prefix = one_only ? ".gnu.linkonce.d." : ".data.";
+ prefix = one_only ? ".gnu.linkonce.d.rel.ro.local."
+ : ".data.rel.ro.local.";
break;
case SECCAT_SDATA:
prefix = one_only ? ".gnu.linkonce.s." : ".sdata.";
if (new_section->common.flags & SECTION_FORGET)
in_section = NULL;
else
- {
- in_section = new_section;
- if (new_section->common.flags & SECTION_CODE)
- last_text_section = in_section;
- }
+ in_section = new_section;
if (new_section->common.flags & SECTION_NAMED)
{