summaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/gcc/final.c b/gcc/final.c
index ed1327dc0a4..7ccc8f5debe 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -114,12 +114,6 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#define JUMP_TABLES_IN_TEXT_SECTION 0
#endif
-#if defined(READONLY_DATA_SECTION) || defined(READONLY_DATA_SECTION_ASM_OP)
-#define HAVE_READONLY_DATA_SECTION 1
-#else
-#define HAVE_READONLY_DATA_SECTION 0
-#endif
-
/* Bitflags used by final_scan_insn. */
#define SEEN_BB 1
#define SEEN_NOTE 2
@@ -887,7 +881,8 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
next = next_nonnote_insn (insn);
/* ADDR_VECs only take room if read-only data goes into the text
section. */
- if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION)
+ if (JUMP_TABLES_IN_TEXT_SECTION
+ || readonly_data_section == text_section)
if (next && JUMP_P (next))
{
rtx nextbody = PATTERN (next);
@@ -1050,7 +1045,8 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
{
/* This only takes room if read-only data goes into the text
section. */
- if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION)
+ if (JUMP_TABLES_IN_TEXT_SECTION
+ || readonly_data_section == text_section)
insn_lengths[uid] = (XVECLEN (body,
GET_CODE (body) == ADDR_DIFF_VEC)
* GET_MODE_SIZE (GET_MODE (body)));
@@ -1251,7 +1247,8 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
PUT_MODE (body, CASE_VECTOR_SHORTEN_MODE (min_addr - rel_addr,
max_addr - rel_addr,
body));
- if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION)
+ if (JUMP_TABLES_IN_TEXT_SECTION
+ || readonly_data_section == text_section)
{
insn_lengths[uid]
= (XVECLEN (body, 1) * GET_MODE_SIZE (GET_MODE (body)));
@@ -1468,13 +1465,13 @@ profile_function (FILE *file ATTRIBUTE_UNUSED)
if (! NO_PROFILE_COUNTERS)
{
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
- data_section ();
+ switch_to_section (data_section);
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
targetm.asm_out.internal_label (file, "LP", current_function_funcdef_no);
assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, align, 1);
}
- current_function_section (current_function_decl);
+ switch_to_section (current_function_section ());
#if defined(ASM_OUTPUT_REG_PUSH)
if (sval && svrtx != NULL_RTX && REG_P (svrtx))
@@ -1717,15 +1714,15 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
not already writing to the cold section we need to change
to it. */
- if (last_text_section == in_text)
+ if (last_text_section == text_section)
{
(*debug_hooks->switch_text_section) ();
- unlikely_text_section ();
+ switch_to_section (unlikely_text_section ());
}
else
{
(*debug_hooks->switch_text_section) ();
- text_section ();
+ switch_to_section (text_section);
}
break;
@@ -1939,7 +1936,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
{
int log_align;
- targetm.asm_out.function_rodata_section (current_function_decl);
+ switch_to_section (targetm.asm_out.function_rodata_section
+ (current_function_decl));
#ifdef ADDR_VEC_ALIGN
log_align = ADDR_VEC_ALIGN (next);
@@ -1949,7 +1947,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
ASM_OUTPUT_ALIGN (file, log_align);
}
else
- current_function_section (current_function_decl);
+ switch_to_section (current_function_section ());
#ifdef ASM_OUTPUT_CASE_LABEL
ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn),
@@ -2006,9 +2004,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
#endif
if (! JUMP_TABLES_IN_TEXT_SECTION)
- targetm.asm_out.function_rodata_section (current_function_decl);
+ switch_to_section (targetm.asm_out.function_rodata_section
+ (current_function_decl));
else
- current_function_section (current_function_decl);
+ switch_to_section (current_function_section ());
if (app_on)
{
@@ -2066,7 +2065,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
#endif
#endif
- current_function_section (current_function_decl);
+ switch_to_section (current_function_section ());
break;
}