OSDN Git Service

2004-04-11 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 11 Apr 2004 06:21:05 +0000 (06:21 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 11 Apr 2004 06:21:05 +0000 (06:21 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80593 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/mips/iris5.h
gcc/config/rs6000/sysv4.h
gcc/defaults.h
gcc/doc/tm.texi
gcc/varasm.c

index dd10d4e..839e648 100644 (file)
@@ -1,3 +1,21 @@
+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
index 4114c92..0e7eaad 100644 (file)
@@ -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                                                           \
index 39497e9..1e0ac37 100644 (file)
@@ -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\""
index efd28af..697ed8e 100644 (file)
@@ -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
index 1d413e0..39ddcc3 100644 (file)
@@ -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
index c35c9b7..780bba8 100644 (file)
@@ -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",