Commit 34982294 by Andrew Pinski Committed by Andrew Pinski

varasm.c (text_section): Use TEXT_SECTION_ASM_OP and ASM_OUTPUT_ALIGN instead of…

varasm.c (text_section): Use TEXT_SECTION_ASM_OP and ASM_OUTPUT_ALIGN instead of SECTION_FORMAT_STRING...

2004-04-11  Andrew Pinski  <pinskia@physics.uc.edu>

        * varasm.c (text_section): Use TEXT_SECTION_ASM_OP and
        ASM_OUTPUT_ALIGN instead of SECTION_FORMAT_STRING
        and NORMAL_TEXT_SECTION_NAME.
        (unlikely_text_section): Check targetm.have_named_sections
        instead of TARGET_ASM_NAMED_SECTION and use TEXT_SECTION_ASM_OP
        instead of SECTION_FORMAT_STRING.
        * config/mips/iris5.h (current_section_name): Add
        in_unlikely_executed_text case and move the abort into the switch.
        * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME): Remove.
        (NORMAL_TEXT_SECTION_NAME): Remove.
        (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
        (SECTION_FORMAT_STRING): Remove.
        * defaults.h (SECTION_FORMAT_STRING): Remove.
        * tm.texi (NORMAL_TEXT_SECTION_NAME): Remove.
        (SECTION_FORMAT_STRING): Remove.

From-SVN: r80593
parent 0333e091
2004-04-11 Andrew Pinski <pinskia@physics.uc.edu>
* varasm.c (text_section): Use TEXT_SECTION_ASM_OP and
ASM_OUTPUT_ALIGN instead of SECTION_FORMAT_STRING
and NORMAL_TEXT_SECTION_NAME.
(unlikely_text_section): Check targetm.have_named_sections
instead of TARGET_ASM_NAMED_SECTION and use TEXT_SECTION_ASM_OP
instead of SECTION_FORMAT_STRING.
* config/mips/iris5.h (current_section_name): Add
in_unlikely_executed_text case and move the abort into the switch.
* config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME): Remove.
(NORMAL_TEXT_SECTION_NAME): Remove.
(UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
(SECTION_FORMAT_STRING): Remove.
* defaults.h (SECTION_FORMAT_STRING): Remove.
* tm.texi (NORMAL_TEXT_SECTION_NAME): Remove.
(SECTION_FORMAT_STRING): Remove.
2004-04-10 Joseph S. Myers <jsm@polyomino.org.uk>
* c-typeck.c (common_type): Prefer long long to long when same
......
......@@ -213,6 +213,7 @@ current_section_name (void) \
switch (in_section) \
{ \
case no_section: return NULL; \
case in_unlikely_executed_text: \
case in_text: return ".text"; \
case in_data: return ".data"; \
case in_bss: return ".bss"; \
......@@ -223,8 +224,8 @@ current_section_name (void) \
return ".rdata"; \
case in_named: \
return in_named_name; \
default: abort(); \
} \
abort (); \
} \
\
unsigned int \
......
......@@ -434,11 +434,6 @@ do { \
#define BSS_SECTION_ASM_OP "\t.section\t\".bss\""
#define HOT_TEXT_SECTION_NAME ".text"
#define NORMAL_TEXT_SECTION_NAME ".text"
#define UNLIKELY_EXECUTED_TEXT_SECTION_NAME ".text.unlikely"
#define SECTION_FORMAT_STRING ".section\t\"%s\"\n\t.align 2\n"
/* Override elfos.h definition. */
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
......
......@@ -631,10 +631,6 @@ You Lose! You must define PREFERRED_DEBUGGING_TYPE!
#define UNLIKELY_EXECUTED_TEXT_SECTION_NAME "text.unlikely"
#endif
#ifndef SECTION_FORMAT_STRING
#define SECTION_FORMAT_STRING "\t.section\t%s\n\t.align 2\n"
#endif
#ifndef HAS_LONG_COND_BRANCH
#define HAS_LONG_COND_BRANCH 0
#endif
......
......@@ -5802,13 +5802,6 @@ frequently executed functions of the program. If not defined, GCC will provide
a default definition if the target supports named sections.
@end defmac
@defmac NORMAL_TEXT_SECTION_NAME
If defined, a C string constant for the name of the section containing code
that does not go into the ``unlikely executed text'' partition. This is used
as part of the optimization that partitions hot and cold basic blocks into
separate sections in the .o and executable files.
@end defmac
@defmac UNLIKELY_EXECUTED_TEXT_SECTION_NAME
If defined, a C string constant for the name of the section containing unlikely
executed functions in the program.
......@@ -5860,12 +5853,6 @@ finalization code. If not defined, GCC will assume such a section does
not exist.
@end defmac
@defmac SECTION_FORMAT_STRING
If defined, format string used by fprintf to write out the
text section headers for the hot and cold sections of the
assembly file, when hot and cold partitioning is being performed.
@end defmac
@defmac CRT_CALL_STATIC_FUNCTION (@var{section_op}, @var{function})
If defined, an ASM statement that switches to a different section
via @var{section_op}, calls @var{function}, and switches back to
......
......@@ -208,7 +208,8 @@ text_section (void)
if (in_section != in_text)
{
in_section = in_text;
fprintf (asm_out_file, SECTION_FORMAT_STRING, NORMAL_TEXT_SECTION_NAME);
fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
ASM_OUTPUT_ALIGN (asm_out_file, 2);
}
}
......@@ -221,15 +222,15 @@ unlikely_text_section (void)
&& (in_section != in_named
|| strcmp (in_named_name, UNLIKELY_EXECUTED_TEXT_SECTION_NAME) != 0))
{
#ifdef TARGET_ASM_NAMED_SECTION
named_section (NULL_TREE, UNLIKELY_EXECUTED_TEXT_SECTION_NAME, 0);
if (targetm.have_named_sections)
named_section (NULL_TREE, UNLIKELY_EXECUTED_TEXT_SECTION_NAME, 0);
else
{
in_section = in_unlikely_executed_text;
fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
ASM_OUTPUT_ALIGN (asm_out_file, 2);
}
#else
in_section = in_unlikely_executed_text;
fprintf (asm_out_file, SECTION_FORMAT_STRING,
UNLIKELY_EXECUTED_TEXT_SECTION_NAME);
#endif /* ifdef TARGET_ASM_NAMED_SECTION */
if (!unlikely_section_label_printed)
{
fprintf (asm_out_file, "__%s_unlikely_section:\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment