]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
system.h (SELECT_RTX_SECTION): Poison.
authorRichard Henderson <rth@gcc.gnu.org>
Sat, 18 May 2002 23:47:22 +0000 (16:47 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 18 May 2002 23:47:22 +0000 (16:47 -0700)
* system.h (SELECT_RTX_SECTION): Poison.
* target-def.h (TARGET_ASM_SELECT_RTX_SECTION): New.
* target.h (select_rtx_section): New.
* varasm.c (output_constant_pool): Use it.
(default_select_rtx_section, default_elf_select_rtx_section): New.
* output.h: Declare them.

* config/darwin.h (SELECT_RTX_SECTION): Move ...
* config/darwin.c (machopic_select_rtx_section): ... here.
* config/darwin-protos.h: Update.

* config/nextstep.h (SELECT_RTX_SECTION): Move ...
* config/nextstep.c (machopic_select_rtx_section): ... here.
(nextstep_select_section): Rename variable to avoid macro clash.
* config/nextstep-protos.h: Update.

* config/elfos.h, config/svr3.h, config/arm/aof.h, config/c4x/c4x.h,
config/i386/dgux.h, config/i386/osfrose.h, config/i386/sco5.h,
config/i386/svr3gas.h, config/i860/paragon.h, config/ia64/aix.h,
config/m32r/m32r.h, config/m68k/dpx2.h, config/m68k/lynx.h,
config/m68k/m68k.h, config/m68k/tower-as.h, config/m88k/dgux.h,
config/mcore/mcore-pe.h, config/mips/mips.h, config/mmix/mmix.h,
config/pa/pa-linux.h, config/pa/pa.h, config/romp/romp.h,
config/rs6000/lynx.h, config/rs6000/sysv4.h, config/s390/linux.h,
config/sparc/sysv4.h, config/xtensa/elf.h, config/xtensa/linux.h
(SELECT_RTX_SECTION): Remove.

* config/darwin.h, config/elfos.h, config/nextstep.h,
config/ia64/aix.h, config/ia64/sysv4.h, config/alpha/alpha.c,
config/mips/mips.c, config/romp/romp.c, config/rs6000/sysv4.h,
config/rs6000/xcoff.h, config/s390/s390.c, config/sparc/aout.h,
config/sparc/lynx.h, config/xtensa/xtensa.c
(TARGET_ASM_SELECT_RTX_SECTION): New.

* config/alpha/elf.h (SELECT_RTX_SECTION): Move ...
* config/alpha/alpha.c (alpha_elf_select_rtx_section): ... here.
* config/ia64/sysv4.h (SELECT_RTX_SECTION): Move ...
* config/ia64/ia64.c (ia64_select_rtx_section): ... here.
(ia64_aix_select_rtx_section): New.
* config/mips/iris6.h (READONLY_DATA_SECTION_ASM_OP): Undef before
redefining.
* config/mips/mips.c (mips_select_rtx_section): Make static.
Support ELF SHF_MERGE features.
* config/mips/mips-protos.h: Update.
* config/rs6000/xcoff.h (SELECT_RTX_SECTION): Move ...
* config/rs6000/rs6000.c (rs6000_xcoff_select_rtx_section): ... here.
(rs6000_elf_select_rtx_section): Rename from rs6000_select_rtx_section;
make static, fall back to default_elf_select_rtx_section.
* config/rs6000/rs6000-protos.h: Update.
* config/sparc/sparc.h (SELECT_RTX_SECTION): Move ...
* config/sparc/sparc.c (sparc_aout_select_rtx_section): ... here.
* config/sparc/sunos4.h (on_exit): Declare only if IN_LIBGCC2.
* config/romp/romp.c (romp_select_rtx_section): New.
* config/s390/s390.c (s390_select_rtx_section): New.
* config/xtensa/xtensa.c: Include output.h.  Shuffle local function
declarations before target macro definition.
(xtensa_emit_call): Use static buffer.
(xtensa_select_rtx_section): New.
* config/xtensa/xtensa.h (MAX_INT_TYPE_SIZE): Remove.
(IMPLICIT_FIX_EXPR, EASY_DIV_EXPR): Remove.
(ASM_OUTPUT_POOL_PROLOGUE): Update call to resolve_unique_section.

* doc/tm.texi (TARGET_ASM_SELECT_RTX_SECTION): Update from
SELECT_RTX_SECTION docs.

From-SVN: r53600

64 files changed:
gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/config/alpha/elf.h
gcc/config/arm/aof.h
gcc/config/avr/avr.h
gcc/config/c4x/c4x.h
gcc/config/d30v/d30v.h
gcc/config/darwin-protos.h
gcc/config/darwin.c
gcc/config/darwin.h
gcc/config/elfos.h
gcc/config/i386/dgux.h
gcc/config/i386/osfrose.h
gcc/config/i386/sco5.h
gcc/config/i386/svr3gas.h
gcc/config/i860/paragon.h
gcc/config/ia64/aix.h
gcc/config/ia64/ia64.c
gcc/config/ia64/sysv4.h
gcc/config/m32r/m32r.h
gcc/config/m68k/dpx2.h
gcc/config/m68k/lynx.h
gcc/config/m68k/m68k.h
gcc/config/m68k/tower-as.h
gcc/config/m88k/dgux.h
gcc/config/mcore/mcore-pe.h
gcc/config/mips/iris6.h
gcc/config/mips/mips-protos.h
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/mmix/mmix.h
gcc/config/nextstep-protos.h
gcc/config/nextstep.c
gcc/config/nextstep.h
gcc/config/pa/pa-linux.h
gcc/config/pa/pa.h
gcc/config/romp/romp.c
gcc/config/romp/romp.h
gcc/config/rs6000/lynx.h
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/sysv4.h
gcc/config/rs6000/xcoff.h
gcc/config/s390/linux.h
gcc/config/s390/s390.c
gcc/config/sparc/aout.h
gcc/config/sparc/lynx.h
gcc/config/sparc/sparc.c
gcc/config/sparc/sparc.h
gcc/config/sparc/sunos4.h
gcc/config/sparc/sysv4.h
gcc/config/stormy16/stormy16.h
gcc/config/svr3.h
gcc/config/v850/v850.h
gcc/config/xtensa/elf.h
gcc/config/xtensa/linux.h
gcc/config/xtensa/xtensa.c
gcc/config/xtensa/xtensa.h
gcc/doc/tm.texi
gcc/output.h
gcc/system.h
gcc/target-def.h
gcc/target.h
gcc/varasm.c

index 4e0c1efb748b5c4f31f8d4460fd5f539bbd4434d..13616ecc1323b5cd0699da604f1ed2a777b3f9f0 100644 (file)
@@ -1,4 +1,71 @@
-Sun May 19 00:24:23 CEST 2002  Jan HUbicka  <jh@suse.cz>
+2002-05-18  Richard Henderson  <rth@redhat.com>
+
+       * system.h (SELECT_RTX_SECTION): Poison.
+       * target-def.h (TARGET_ASM_SELECT_RTX_SECTION): New.
+       * target.h (select_rtx_section): New.
+       * varasm.c (output_constant_pool): Use it.
+       (default_select_rtx_section, default_elf_select_rtx_section): New.
+       * output.h: Declare them.
+
+       * config/darwin.h (SELECT_RTX_SECTION): Move ...
+       * config/darwin.c (machopic_select_rtx_section): ... here.
+       * config/darwin-protos.h: Update.
+
+       * config/nextstep.h (SELECT_RTX_SECTION): Move ...
+       * config/nextstep.c (machopic_select_rtx_section): ... here.
+       (nextstep_select_section): Rename variable to avoid macro clash.
+       * config/nextstep-protos.h: Update.
+
+       * config/elfos.h, config/svr3.h, config/arm/aof.h, config/c4x/c4x.h,
+       config/i386/dgux.h, config/i386/osfrose.h, config/i386/sco5.h,
+       config/i386/svr3gas.h, config/i860/paragon.h, config/ia64/aix.h,
+       config/m32r/m32r.h, config/m68k/dpx2.h, config/m68k/lynx.h, 
+       config/m68k/m68k.h, config/m68k/tower-as.h, config/m88k/dgux.h,
+       config/mcore/mcore-pe.h, config/mips/mips.h, config/mmix/mmix.h,
+       config/pa/pa-linux.h, config/pa/pa.h, config/romp/romp.h, 
+       config/rs6000/lynx.h, config/rs6000/sysv4.h, config/s390/linux.h,
+       config/sparc/sysv4.h, config/xtensa/elf.h, config/xtensa/linux.h
+       (SELECT_RTX_SECTION): Remove.
+
+       * config/darwin.h, config/elfos.h, config/nextstep.h,
+       config/ia64/aix.h, config/ia64/sysv4.h, config/alpha/alpha.c,
+       config/mips/mips.c, config/romp/romp.c, config/rs6000/sysv4.h,
+       config/rs6000/xcoff.h, config/s390/s390.c, config/sparc/aout.h,
+       config/sparc/lynx.h, config/xtensa/xtensa.c
+       (TARGET_ASM_SELECT_RTX_SECTION): New.
+
+       * config/alpha/elf.h (SELECT_RTX_SECTION): Move ...
+       * config/alpha/alpha.c (alpha_elf_select_rtx_section): ... here.
+       * config/ia64/sysv4.h (SELECT_RTX_SECTION): Move ...
+       * config/ia64/ia64.c (ia64_select_rtx_section): ... here.
+       (ia64_aix_select_rtx_section): New.
+       * config/mips/iris6.h (READONLY_DATA_SECTION_ASM_OP): Undef before
+       redefining.
+       * config/mips/mips.c (mips_select_rtx_section): Make static.
+       Support ELF SHF_MERGE features. 
+       * config/mips/mips-protos.h: Update.
+       * config/rs6000/xcoff.h (SELECT_RTX_SECTION): Move ...
+       * config/rs6000/rs6000.c (rs6000_xcoff_select_rtx_section): ... here.
+       (rs6000_elf_select_rtx_section): Rename from rs6000_select_rtx_section;
+       make static, fall back to default_elf_select_rtx_section.
+       * config/rs6000/rs6000-protos.h: Update.
+       * config/sparc/sparc.h (SELECT_RTX_SECTION): Move ...
+       * config/sparc/sparc.c (sparc_aout_select_rtx_section): ... here.
+       * config/sparc/sunos4.h (on_exit): Declare only if IN_LIBGCC2.
+       * config/romp/romp.c (romp_select_rtx_section): New.
+       * config/s390/s390.c (s390_select_rtx_section): New.
+       * config/xtensa/xtensa.c: Include output.h.  Shuffle local function
+       declarations before target macro definition.
+       (xtensa_emit_call): Use static buffer.
+       (xtensa_select_rtx_section): New.
+       * config/xtensa/xtensa.h (MAX_INT_TYPE_SIZE): Remove.
+       (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR): Remove.
+       (ASM_OUTPUT_POOL_PROLOGUE): Update call to resolve_unique_section.
+
+       * doc/tm.texi (TARGET_ASM_SELECT_RTX_SECTION): Update from
+       SELECT_RTX_SECTION docs.
+
+Sun May 19 00:24:23 CEST 2002  Jan Hubicka  <jh@suse.cz>
 
        * i386.md (movsi/movdi): Fix template.
        (sse2 patterns): Set attributes consistently.
index 33a6419a887a09878dfb4f83ad4f680990d8a6af..eb2eff23711f8fc14fb975ebdc39556063fa295b 100644 (file)
@@ -164,6 +164,11 @@ static int alpha_use_dfa_pipeline_interface
 static int alpha_multipass_dfa_lookahead
   PARAMS ((void));
 
+#ifdef OBJECT_FORMAT_ELF
+static void alpha_elf_select_rtx_section
+  PARAMS ((enum machine_mode, rtx, unsigned HOST_WIDE_INT));
+#endif
+
 #if TARGET_ABI_UNICOSMK
 static void alpha_init_machine_status
   PARAMS ((struct function *p));
@@ -234,6 +239,11 @@ static void unicosmk_unique_section PARAMS ((tree, int));
 #define TARGET_ASM_UNALIGNED_DI_OP "\t.align 0\n\t.quad\t"
 #endif
 
+#ifdef OBJECT_FORMAT_ELF
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define        TARGET_ASM_SELECT_RTX_SECTION  alpha_elf_select_rtx_section
+#endif
+
 #undef TARGET_ASM_FUNCTION_END_PROLOGUE
 #define TARGET_ASM_FUNCTION_END_PROLOGUE alpha_output_function_end_prologue
 
@@ -4841,7 +4851,6 @@ alpha_adjust_cost (insn, link, dep_insn, cost)
      rtx dep_insn;
      int cost;
 {
-  rtx set, set_src;
   enum attr_type insn_type, dep_insn_type;
 
   /* If the dependence is an anti-dependence, there is no cost.  For an
@@ -8072,6 +8081,26 @@ check_float_value (mode, d, overflow)
   return 0;
 }
 \f
+#ifdef OBJECT_FORMAT_ELF
+
+/* Switch to the section to which we should output X.  The only thing
+   special we do here is to honor small data.  */
+
+static void
+alpha_elf_select_rtx_section (mode, x, align)
+     enum machine_mode mode;
+     rtx x;
+     unsigned HOST_WIDE_INT align;
+{
+  if (TARGET_SMALL_DATA && GET_MODE_SIZE (mode) <= g_switch_value)
+    /* ??? Consider using mergable sdata sections.  */
+    sdata_section ();
+  else
+    default_elf_select_rtx_section (mode, x, align);
+}
+
+#endif /* OBJECT_FORMAT_ELF */
+\f
 #if TARGET_ABI_OPEN_VMS
 
 /* Return the VMS argument type corresponding to MODE.  */
index 3e8d1e06f9bb765a9cca084c31a8d8d66a62ab22..722ff5e42a8f7fdfcb35fa483003c35a382b5486 100644 (file)
@@ -258,22 +258,6 @@ void FN ()                                 \
 
 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
 
-/* A C statement or statements to switch to the appropriate
-   section for output of RTX in mode MODE.  RTX is some kind
-   of constant in RTL.  The argument MODE is redundant except
-   in the case of a `const_int' rtx.  Currently, these always
-   go into the const section.  */
-
-#undef  SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN)                           \
-do {                                                                   \
-  if (TARGET_SMALL_DATA && GET_MODE_SIZE (MODE) <= g_switch_value)     \
-     /* ??? Consider .sdata.{lit4,lit8} as SHF_MERGE|SHF_ALPHA_GPREL.  */ \
-    sdata_section ();                                                  \
-  else                                                                 \
-    mergeable_constant_section((MODE), (ALIGN), 0);                    \
-} while (0)
-
 /* Define the strings used for the special svr4 .type and .size directives.
    These strings generally do not vary from one system running svr4 to
    another, but if a given system (e.g. m88k running svr) needs to use
index f110ea215d13c79993ee3bb307273ecf4251da95..3760527db42dcee9540480d61be030948cb73165 100644 (file)
@@ -54,8 +54,6 @@ Boston, MA 02111-1307, USA.  */
    addressing across such boundaries.  */
 #define TEXT_SECTION_ASM_OP aof_text_section ()
 
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) text_section ();
-
 #define DATA_SECTION_ASM_OP aof_data_section ()
 
 #define EXTRA_SECTIONS in_zero_init, in_common
index dcba8567e40f632f6f4d27c7ecddc8796a66fb47..7e74c2298839906b931e61316d3b063a106b9b35 100644 (file)
@@ -1791,16 +1791,6 @@ progmem_section (void)                                                         \
    If these items should be placed in the text section, this macro
    should not be defined.  */
 
-/* `SELECT_RTX_SECTION (MODE, RTX, ALIGN)'
-   A C statement or statements to switch to the appropriate section
-   for output of RTX in mode MODE.  You can assume that RTX is some
-   kind of constant in RTL.  The argument MODE is redundant except in
-   the case of a `const_int' rtx.  Select the section by calling
-   `text_section' or one of the alternatives for other sections.
-
-   Do not define this macro if you put all constants in the read-only
-   data section.  */
-
 #define JUMP_TABLES_IN_TEXT_SECTION 0
 /* Define this macro if jump tables (for `tablejump' insns) should be
    output in the text section, along with the assembler instructions.
index ed2b4cb13c2f432d1fba6a661912ef902fa91750..ee5e38e710a4c4b1ef8ddffd74282e411350315b 100644 (file)
@@ -1735,15 +1735,6 @@ fini_section ()                                                  \
 # endif
 #endif /* ! HOST_WIDE_INT_PRINT_HEX */
 
-/* A C statement or statements to switch to the appropriate
-   section for output of RTX in mode MODE.  RTX is some kind
-   of constant in RTL.  The argument MODE is redundant except
-   in the case of a `const_int' rtx.  Currently, these always
-   go into the const section.  */
-
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) readonly_data_section()
-
-
 /* Overall Framework of an Assembler File.  */
 /* We need to have a data section we can identify so that we can set
    the DP register back to a data pointer in the small memory model.
index a0b17e241626e6d4c69318058dfefcadda7afaa7..e66ba674d535eaae8b48af74493ff4e0645617dd 100644 (file)
@@ -2747,18 +2747,6 @@ extern const char *d30v_branch_cost_string;
    Defined in svr4.h.  */
 /* #define EXTRA_SECTION_FUNCTIONS */
 
-/* A C statement or statements to switch to the appropriate section for output
-   of RTX in mode MODE.  You can assume that RTX is some kind of constant in
-   RTL.  The argument MODE is redundant except in the case of a `const_int'
-   rtx.  Select the section by calling `text_section' or one of the
-   alternatives for other sections.
-
-   Do not define this macro if you put all constants in the read-only data
-   section.
-
-   Defined in svr4.h.  */
-/* #define SELECT_RTX_SECTION(MODE, RTX, ALIGN) */
-
 /* Define this macro if jump tables (for `tablejump' insns) should be output in
    the text section, along with the assembler instructions.  Otherwise, the
    readonly data section is used.
index 9a9c9538572a9e4570acc2fbad08efe3d531452b..c72b0dd1b3a9a7836dfbec6c72942d70f206d316 100644 (file)
@@ -70,9 +70,48 @@ extern void darwin_exception_section PARAMS ((void));
 extern void darwin_eh_frame_section PARAMS ((void));
 extern void machopic_select_section PARAMS ((tree, int,
                                             unsigned HOST_WIDE_INT));
+extern void machopic_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                                unsigned HOST_WIDE_INT));
 
 #ifdef GCC_C_PRAGMA_H
 extern void darwin_pragma_ignore PARAMS ((cpp_reader *));
 extern void darwin_pragma_options PARAMS ((cpp_reader *));
 extern void darwin_pragma_unused PARAMS ((cpp_reader *));
 #endif
+
+/* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o.  */
+extern void const_section PARAMS ((void));
+extern void const_data_section PARAMS ((void));
+extern void cstring_section PARAMS ((void));
+extern void literal4_section PARAMS ((void));
+extern void literal8_section PARAMS ((void));
+extern void constructor_section PARAMS ((void));
+extern void mod_init_section PARAMS ((void));
+extern void mod_term_section PARAMS ((void));
+extern void destructor_section PARAMS ((void));
+extern void objc_class_section PARAMS ((void));
+extern void objc_meta_class_section PARAMS ((void));
+extern void objc_category_section PARAMS ((void));
+extern void objc_class_vars_section PARAMS ((void));
+extern void objc_instance_vars_section PARAMS ((void));
+extern void objc_cls_meth_section PARAMS ((void));
+extern void objc_inst_meth_section PARAMS ((void));
+extern void objc_cat_cls_meth_section PARAMS ((void));
+extern void objc_cat_inst_meth_section PARAMS ((void));
+extern void objc_selector_refs_section PARAMS ((void));
+extern void objc_selector_fixup_section PARAMS ((void));
+extern void objc_symbols_section PARAMS ((void));
+extern void objc_module_info_section PARAMS ((void));
+extern void objc_protocol_section PARAMS ((void));
+extern void objc_string_object_section PARAMS ((void));
+extern void objc_constant_string_object_section PARAMS ((void));
+extern void objc_class_names_section PARAMS ((void));
+extern void objc_meth_var_names_section PARAMS ((void));
+extern void objc_meth_var_types_section PARAMS ((void));
+extern void objc_cls_refs_section PARAMS ((void));
+extern void machopic_lazy_symbol_ptr_section PARAMS ((void));
+extern void machopic_nl_symbol_ptr_section PARAMS ((void));
+extern void machopic_symbol_stub_section PARAMS ((void));
+extern void machopic_picsymbol_stub_section PARAMS ((void));
+extern void darwin_exception_section PARAMS ((void));
+extern void darwin_eh_frame_section PARAMS ((void));
index 8a3a2da8e11aaf232515be90863dffca398ec29a..e6fe4204c0644d5f9649e82aecec23a4767b88ae 100644 (file)
@@ -1237,6 +1237,25 @@ machopic_select_section (exp, reloc, align)
     data_section ();
 }
 
+/* This can be called with address expressions as "rtx".
+   They must go in "const". */
+
+void
+machopic_select_rtx_section (mode, x, align)
+     enum machine_mode mode;
+     rtx x;
+     unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+{
+  if (GET_MODE_SIZE (mode) == 8)
+    literal8_section ();
+  else if (GET_MODE_SIZE (mode) == 4
+          && (GET_CODE (x) == CONST_INT
+              || GET_CODE (x) == CONST_DOUBLE))
+    literal4_section ();
+  else
+    const_section ();
+}
+
 void
 machopic_asm_out_constructor (symbol, priority)
      rtx symbol;
index 9d7c59039f2ecefb4676bb591df02ec08a8c6b35..9867f1ff7883e6741ce9a64d1f3646f6723e6a29 100644 (file)
@@ -487,23 +487,8 @@ objc_section_init ()                               \
 
 #undef TARGET_ASM_SELECT_SECTION
 #define TARGET_ASM_SELECT_SECTION machopic_select_section
-
-/* This can be called with address expressions as "rtx".
-   They must go in "const". */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(mode, rtx, align)                           \
-  do                                                                   \
-    {                                                                  \
-      if (GET_MODE_SIZE (mode) == 8)                                   \
-       literal8_section ();                                            \
-      else if (GET_MODE_SIZE (mode) == 4                               \
-              && (GET_CODE (rtx) == CONST_INT                          \
-                  || GET_CODE (rtx) == CONST_DOUBLE))                  \
-       literal4_section ();                                            \
-      else                                                             \
-       const_section ();                                               \
-    }                                                                  \
-  while (0)
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section
 
 #define ASM_DECLARE_UNRESOLVED_REFERENCE(FILE,NAME)                    \
     do {                                                               \
index 3cec99595eadbd5d4ac9aafc6c873034e6c9e0c8..46a13b4afa738f4a0f511b2477bb76d90c52c20c 100644 (file)
@@ -240,18 +240,8 @@ Boston, MA 02111-1307, USA.  */
 /* Switch into a generic section.  */
 #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section
 
-/* A C statement or statements to switch to the appropriate
-   section for output of RTX in mode MODE.  RTX is some kind
-   of constant in RTL.  The argument MODE is redundant except
-   in the case of a `const_int' rtx.
-   If assembler supports SHF_MERGE sections, put it into
-   a .rodata.cstN section where N is size of the constant,
-   otherwise into const section.  */
-
-#undef  SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN)   \
-  mergeable_constant_section ((MODE), (ALIGN), 0)
-
+#undef  TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION default_elf_select_rtx_section
 #undef TARGET_ASM_SELECT_SECTION
 #define TARGET_ASM_SELECT_SECTION default_elf_select_section
 
index 998c8c307e4ceb90d8b256090d740e10402eb9b6..fa6b4a5edfd8d254bd8527459d7c5ebd8a0931c2 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
 */
 
 #ifndef VERSION_INFO2
-#define VERSION_INFO2   "$Revision: 1.17 $"
+#define VERSION_INFO2   "$Revision: 1.18 $"
 #endif
 
 #ifndef VERSION_STRING
@@ -230,16 +230,6 @@ Boston, MA 02111-1307, USA.  */
 #undef MAX_OFILE_ALIGNMENT
 #define MAX_OFILE_ALIGNMENT 0x1000
 
-/* Must use data section for relocatable constants when pic.  */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN)             \
-do {                                                   \
-  if (flag_pic && symbolic_operand (RTX, VOIDmode))    \
-    data_section ();                                   \
-  else                                                 \
-    readonly_data_section ();                          \
-} while (0)
-
 /* This supplements FUNCTION_ARG's definition in i386.h to check
    TARGET_WARN_PASS_STRUCT */
 
index 03aa95a145055528bc5905065500e496987363ab..83cade2eb83b319765cfc794f10fb1874fddc2b5 100644 (file)
@@ -464,20 +464,6 @@ do                                                         \
   }                                                            \
 while (0)
 
-/* Given a decl node or constant node, choose the section to output it in
-   and select that section.  */
-
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN)                           \
-do                                                                     \
-  {                                                                    \
-    if (MODE == Pmode && HALF_PIC_P () && HALF_PIC_ADDRESS_P (RTX))    \
-      data_section ();                                                 \
-    else                                                               \
-      readonly_data_section ();                                                \
-  }                                                                    \
-while (0)
-
 #undef SELECT_SECTION
 #define SELECT_SECTION(DECL, RELOC, ALIGN)                             \
 {                                                                      \
index 90aba9b9c53fce86b016b731fb8064a030abf9cf..b520159f79ca5beab45fff9576281f250134be2d 100644 (file)
@@ -348,19 +348,6 @@ do {                                                                       \
         fprintf ((FILE), "\n");                                                \
 } while (0) 
 
-/* Must use data section for relocatable constants when pic.  */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN)             \
-{                                                      \
-  if (TARGET_ELF) {                                    \
-    if (flag_pic && symbolic_operand (RTX, VOIDmode))  \
-      data_section ();                                 \
-    else                                               \
-      readonly_data_section ();                                \
-  } else                                               \
-    readonly_data_section();                           \
-}
-
 #undef ASM_OUTPUT_CASE_LABEL
 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE)               \
 do {                                                                   \
index f47a90627ece605bb4692f2b77218497774a5c0e..b9d94b788cb9ec4deac5d8b684238ff6c7c09587 100644 (file)
@@ -139,11 +139,3 @@ fini_section ()                                                    \
 }
 
 #define TARGET_ASM_CONSTRUCTOR  ix86_svr3_asm_out_constructor
-
-/* A C statement or statements to switch to the appropriate
-   section for output of RTX in mode MODE.  RTX is some kind
-   of constant in RTL.  The argument MODE is redundant except
-   in the case of a `const_int' rtx.  Currently, these always
-   go into the const section.  */
-
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) readonly_data_section()
index cb2ae642e73d8758943c484122c5dc8d6e2f2c7a..e69574dde5d6f9fd71a0e3484e856a39270944c7 100644 (file)
@@ -182,7 +182,6 @@ Boston, MA 02111-1307, USA.  */
 #undef DO_GLOBAL_CTORS_BODY
 #undef ASM_OUTPUT_DESTRUCTOR
 #undef TARGET_ASM_SELECT_SECTION
-#undef SELECT_RTX_SECTION
 
 #define        BSS_SECTION_ASM_OP      "\t.bss"        /* XXX */
 #undef EXTRA_SECTIONS
index 700950fc3caf2e69da61176e2f6b9c45316a88ec..b52d49cf66d816e32de5ef79caa66581c39859ba 100644 (file)
@@ -136,19 +136,8 @@ do {                                                       \
 #define TARGET_ASM_SELECT_SECTION  ia64_aix_select_section
 #undef TARGET_ASM_UNIQUE_SECTION
 #define TARGET_ASM_UNIQUE_SECTION  ia64_aix_unique_section
-
-extern unsigned int ia64_section_threshold;
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN)                   \
-{                                                              \
-  if (GET_MODE_SIZE (MODE) > 0                                 \
-      && GET_MODE_SIZE (MODE) <= ia64_section_threshold)       \
-    sdata_section ();                                          \
-  else if (symbolic_operand ((RTX), (MODE)))                   \
-    data_section ();                                           \
-  else                                                         \
-    readonly_data_section ();                                  \
-}
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION  ia64_aix_select_rtx_section
 
 /* Override ia64/sysv4.h setting with that used by AIX5.  */
 #undef WCHAR_TYPE
index f6f6c551bce0f405e90392574d1ce50b0fb76876..0bbb3caf00a80f8e4935ce62f47449f19a3be7b0 100644 (file)
@@ -153,11 +153,16 @@ static int ia64_sched_reorder PARAMS ((FILE *, int, rtx *, int *, int));
 static int ia64_sched_reorder2 PARAMS ((FILE *, int, rtx *, int *, int));
 static int ia64_variable_issue PARAMS ((FILE *, int, rtx, int));
 
+static void ia64_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                            unsigned HOST_WIDE_INT));
 static void ia64_aix_select_section PARAMS ((tree, int,
                                             unsigned HOST_WIDE_INT))
      ATTRIBUTE_UNUSED;
 static void ia64_aix_unique_section PARAMS ((tree, int))
      ATTRIBUTE_UNUSED;
+static void ia64_aix_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                                unsigned HOST_WIDE_INT))
+     ATTRIBUTE_UNUSED;
 \f
 /* Table of valid machine attributes.  */
 static const struct attribute_spec ia64_attribute_table[] =
@@ -7843,6 +7848,22 @@ ia64_hpux_function_arg_padding (mode, type)
       ? downward : upward);
 }
 \f
+/* Switch to the section to which we should output X.  The only thing
+   special we do here is to honor small data.  */
+
+static void
+ia64_select_rtx_section (mode, x, align)
+     enum machine_mode mode;
+     rtx x;
+     unsigned HOST_WIDE_INT align;
+{
+  if (GET_MODE_SIZE (mode) > 0
+      && GET_MODE_SIZE (mode) <= ia64_section_threshold)
+    sdata_section ();
+  else
+    default_elf_select_rtx_section (mode, x, align);
+}
+
 /* It is illegal to have relocations in shared segments on AIX.
    Pretend flag_pic is always set.  */
 
@@ -7868,3 +7889,15 @@ ia64_aix_unique_section (decl, reloc)
   default_unique_section (decl, reloc);
   flag_pic = save_pic;
 }
+
+static void
+ia64_aix_select_rtx_section (mode, x, align)
+     enum machine_mode mode;
+     rtx x;
+     unsigned HOST_WIDE_INT align;
+{
+  int save_pic = flag_pic;
+  flag_pic = 1;
+  ia64_select_rtx_section (mode, x, align);
+  flag_pic = save_pic;
+}
index 881b23da45307332400d742265e176372f8b2d7a..1684db150a00881b0255425f16a9b230c9c9d776 100644 (file)
@@ -140,20 +140,9 @@ do {                                                                       \
   emit_safe_across_calls (STREAM);                                     \
 } while (0)
 
-/* Similarly for constant pool data.  */
-
-extern unsigned int ia64_section_threshold;
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN)                           \
-{                                                                      \
-  if (GET_MODE_SIZE (MODE) > 0                                         \
-      && GET_MODE_SIZE (MODE) <= ia64_section_threshold)               \
-    sdata_section ();                                                  \
-  else if (flag_pic && symbolic_operand ((RTX), (MODE)))               \
-    data_section ();                                                   \
-  else                                                                 \
-    mergeable_constant_section ((MODE), (ALIGN), 0);                   \
-}
+/* Override default elf definition.  */
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION  ia64_select_rtx_section
 
 #undef EXTRA_SECTIONS
 #define EXTRA_SECTIONS in_sdata, in_sbss
index c3b00326e29ccaf5ba8a63fa83e4eaadd52f3e57..439ddf4708c4431caefab608a5c75f71f2c2d25f 100644 (file)
@@ -1569,18 +1569,6 @@ sbss_section ()                                                          \
 #undef  TARGET_ASM_SELECT_SECTION
 #define TARGET_ASM_SELECT_SECTION  m32r_select_section
 
-/* A C statement or statements to switch to the appropriate section for
-   output of RTX in mode MODE.  You can assume that RTX
-   is some kind of constant in RTL.  The argument MODE is redundant
-   except in the case of a `const_int' rtx.  Select the section by
-   calling `text_section' or one of the alternatives for other
-   sections.
-
-   Do not define this macro if you put all constants in the read-only
-   data section.  */
-
-#undef SELECT_RTX_SECTION
-
 /* Define this macro if jump tables (for tablejump insns) should be
    output in the text section, along with the assembler instructions.
    Otherwise, the readonly data section is used.
index 3595eebcdecfe573f193ca5e56d885a23c676cd6..4e540b89ee0e555829922d5b13b370039e8a3a87 100644 (file)
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 #include "m68k/m68k.h"
-#undef SELECT_RTX_SECTION
 #include "svr3.h"
 
 #undef INT_OP_GROUP
@@ -44,7 +43,6 @@ Boston, MA 02111-1307, USA.  */
 /* Remove handling for a separate constant data section.  We put
    constant data in text_section, which is the default.  */
 #undef TARGET_ASM_SELECT_SECTION
-#undef SELECT_RTX_SECTION
 #undef EXTRA_SECTIONS
 #undef EXTRA_SECTION_FUNCTIONS
 #undef READONLY_DATA_SECTION_ASM_OP
index 31415b97ad2d20ef9a5b560c665ceb0d25753c0f..38e83b97497674ce07ac0084fed111ab1ea1514a 100644 (file)
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA.  */
 #undef CTORS_SECTION_ASM_OP
 #undef DTORS_SECTION_ASM_OP
 #undef ASM_OUTPUT_DESTRUCTOR
-#undef SELECT_RTX_SECTION
 
 #define BSS_SECTION_ASM_OP "\t.bss"
 
index 55f5fd14e04de19af1168a8169740b4459dfc734..bf81aff6723cb2e536b645bea9cc77ea89678265 100644 (file)
@@ -350,16 +350,6 @@ extern int target_flags;
 /* This is how to align an instruction for optimal branching.  */
 #define LABEL_ALIGN_AFTER_BARRIER(LABEL) (m68k_align_jumps)
 
-#define SELECT_RTX_SECTION(MODE, X, ALIGN)                             \
-{                                                                      \
-  if (!flag_pic)                                                       \
-    readonly_data_section();                                           \
-  else if (LEGITIMATE_PIC_OPERAND_P (X))                               \
-    readonly_data_section();                                           \
-  else                                                                 \
-    data_section();                                                    \
-}
-
 /* Define number of bits in most basic integer type.
    (If undefined, default is BITS_PER_WORD).  */
 
index cd457cd1d25bb645451474116d17117091448bd3..a464b925f084d06be1c0103250acec3a2676e2de 100644 (file)
@@ -30,7 +30,6 @@ Boston, MA 02111-1307, USA.  */
    1.37.1 version.  */
 
 #include "m68k/tower.h"
-#undef SELECT_RTX_SECTION
 
 /* Use default settings for system V.3.  */
 
index 7c12b7c7a47dc8ca0085487d7a5a9dc3e7461efc..b8be2a17c3895c19b42a5b681cf9906dc49f7cc3 100644 (file)
@@ -290,13 +290,3 @@ func_ptr __DTOR_END__[1] = { (func_ptr) (-1) }
    page alignment would seem to be enough */
 #undef MAX_OFILE_ALIGNMENT
 #define MAX_OFILE_ALIGNMENT 0x1000
-
-/* Must use data section for relocatable constants when pic.  */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN)             \
-{                                                      \
-  if (flag_pic && symbolic_operand ((RTX), (MODE)))    \
-    data_section ();                                   \
-  else                                                 \
-    readonly_data_section ();                          \
-}
index c5e8e45300e957bfe08348f0ddf0ca0eb02b1adf..651f3384b27d20e138ee7af1446278e60bf843e4 100644 (file)
@@ -63,13 +63,6 @@ drectve_section ()                                           \
       in_section = in_drectve;                                 \
     }                                                          \
 }
-/* A C statement or statements to switch to the appropriate
-   section for output of RTX in mode MODE.  RTX is some kind
-   of constant in RTL.  The argument MODE is redundant except
-   in the case of a `const_int' rtx.  Currently, these always
-   go into the const section.  */
-#undef  SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) readonly_data_section ()
 
 #define MCORE_EXPORT_NAME(STREAM, NAME)                        \
   do                                                   \
index ff03d35aeaae23ca6c97ed1c649d95abea014cb6..e1502a97f94b393085a6ec2973b94e37344b809d 100644 (file)
@@ -251,6 +251,7 @@ Boston, MA 02111-1307, USA.  */
 
 #define BSS_SECTION_ASM_OP     "\t.section\t.bss"
 
+#undef READONLY_DATA_SECTION_ASM_OP
 #define READONLY_DATA_SECTION_ASM_OP_32        "\t.rdata"
 #define READONLY_DATA_SECTION_ASM_OP_64        "\t.section\t.rodata"
 #define READONLY_DATA_SECTION_ASM_OP           \
index 2158a02c75eaebab863944657245f1bf69f37331..89062c82299442bd52327ed8c07222b761fa11bd 100644 (file)
@@ -120,8 +120,6 @@ extern int              mips_class_max_nregs PARAMS ((enum reg_class,
 extern int              mips_register_move_cost PARAMS ((enum machine_mode,
                                                         enum reg_class,
                                                         enum reg_class));
-extern void            mips_select_rtx_section PARAMS ((enum machine_mode,
-                                                        rtx));
 
 extern int             pic_address_needs_scratch PARAMS ((rtx));
 extern int             se_arith_operand PARAMS ((rtx, enum machine_mode));
index f551d62788983636583d61b79fca49edb27345ad..05bebf488537c94cc74f4eb4a94b3015a9b13ee1 100644 (file)
@@ -150,6 +150,8 @@ static void mips_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT))
        ATTRIBUTE_UNUSED;
 static void mips_unique_section                        PARAMS ((tree, int))
        ATTRIBUTE_UNUSED;
+static void mips_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                            unsigned HOST_WIDE_INT));
 
 
 struct machine_function {
@@ -572,6 +574,8 @@ enum reg_class mips_char_to_class[256] =
 #define TARGET_ASM_FUNCTION_PROLOGUE mips_output_function_prologue
 #undef TARGET_ASM_FUNCTION_EPILOGUE
 #define TARGET_ASM_FUNCTION_EPILOGUE mips_output_function_epilogue
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION mips_select_rtx_section
 
 #undef TARGET_SCHED_ADJUST_COST
 #define TARGET_SCHED_ADJUST_COST mips_adjust_cost
@@ -7897,10 +7901,11 @@ symbolic_expression_p (x)
 /* Choose the section to use for the constant rtx expression X that has
    mode MODE.  */
 
-void
-mips_select_rtx_section (mode, x)
+static void
+mips_select_rtx_section (mode, x, align)
      enum machine_mode mode;
-     rtx x ATTRIBUTE_UNUSED;
+     rtx x;
+     unsigned HOST_WIDE_INT align;
 {
   if (TARGET_MIPS16)
     {
@@ -7913,26 +7918,26 @@ mips_select_rtx_section (mode, x)
     {
       /* For embedded applications, always put constants in read-only data,
         in order to reduce RAM usage.  */
-      readonly_data_section ();
+      mergeable_constant_section (mode, align, 0);
     }
   else
     {
       /* For hosted applications, always put constants in small data if
         possible, as this gives the best performance.  */
+      /* ??? Consider using mergable small data sections.  */
 
       if (GET_MODE_SIZE (mode) <= (unsigned) mips_section_threshold
          && mips_section_threshold > 0)
        SMALL_DATA_SECTION ();
       else if (flag_pic && symbolic_expression_p (x))
-       /* Any expression involving a SYMBOL_REF might need a run-time
-          relocation.  (The symbol might be defined in a shared
-          library loaded at an unexpected base address.)  So, we must
-          put such expressions in the data segment (which is
-          writable), rather than the text segment (which is
-          read-only).  */
-       data_section ();
+       {
+         if (targetm.have_named_sections)
+           named_section (NULL_TREE, ".data.rel.ro", 3);
+         else
+           data_section ();
+       }
       else
-       readonly_data_section ();
+       mergeable_constant_section (mode, align, 0);
     }
 }
 
index 3dea475d676f6ca0a9973f8fbd22dad9855ec84a..aab99807d4fb24d9f5884107d61e09163228ac59 100644 (file)
@@ -4721,10 +4721,6 @@ sdata_section ()                                                 \
 /* Given a decl node or constant node, choose the section to output it in
    and select that section.  */
 
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \
-  mips_select_rtx_section (MODE, RTX)
-
 #undef  TARGET_ASM_SELECT_SECTION
 #define TARGET_ASM_SELECT_SECTION  mips_select_section
 \f
index fdb60ccbe3dde328e9ecfde0f541519ef8331ea8..80e928b42b5395442a34e182a7b96a0e2eeae102 100644 (file)
@@ -907,9 +907,6 @@ typedef struct { int regs; int lib; int now_varargs; } CUMULATIVE_ARGS;
 
 #define READONLY_DATA_SECTION_ASM_OP   "\t.section\t.rodata"
 
-#undef  SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) readonly_data_section ()
-
 #define ENCODE_SECTION_INFO(DECL, FIRST) \
  mmix_encode_section_info (DECL, FIRST)
 
index e5b520ddf27ea79ba46198db948ea951e218ee82..66b8f7c7d53676b1ae5daa5a9b21c8e46e9dc1c0 100644 (file)
@@ -28,3 +28,33 @@ extern void nextstep_exception_section PARAMS ((void));
 extern void nextstep_eh_frame_section PARAMS ((void));
 extern void nextstep_select_section PARAMS ((tree, int,
                                             unsigned HOST_WIDE_INT));
+extern void nextstep_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                                unsigned HOST_WIDE_INT));
+
+/* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o.  */
+extern void const_section PARAMS ((void));
+extern void cstring_section PARAMS ((void));
+extern void literal4_section PARAMS ((void));
+extern void literal8_section PARAMS ((void));
+extern void constructor_section PARAMS ((void));
+extern void destructor_section PARAMS ((void));
+extern void nextstep_exception_section PARAMS ((void));
+extern void nextstep_eh_frame_section PARAMS ((void));
+extern void objc_class_section PARAMS ((void));
+extern void objc_meta_class_section PARAMS ((void));
+extern void objc_category_section PARAMS ((void));
+extern void objc_class_vars_section PARAMS ((void));
+extern void objc_instance_vars_section PARAMS ((void));
+extern void objc_cls_meth_section PARAMS ((void));
+extern void objc_inst_meth_section PARAMS ((void));
+extern void objc_cat_cls_meth_section PARAMS ((void));
+extern void objc_cat_inst_meth_section PARAMS ((void));
+extern void objc_selector_refs_section PARAMS ((void));
+extern void objc_symbols_section PARAMS ((void));
+extern void objc_module_info_section PARAMS ((void));
+extern void objc_protocol_section PARAMS ((void));
+extern void objc_string_object_section PARAMS ((void));
+extern void objc_class_names_section PARAMS ((void));
+extern void objc_meth_var_names_section PARAMS ((void));
+extern void objc_meth_var_types_section PARAMS ((void));
+extern void objc_cls_refs_section PARAMS ((void));
index a701776ff27f9017bc0ecc1af36cfbacebfe6d76..e7ae8f67674f95f17b9f516efbf82915731c1042 100644 (file)
@@ -135,16 +135,16 @@ nextstep_select_section (exp, reloc, align)
           || TREE_CODE (exp) == REAL_CST)
     {
       tree size = TYPE_SIZE (TREE_TYPE (exp));
-      HOST_WIDE_INT size_int;
+      HOST_WIDE_INT size_i;
 
       if (TREE_CODE (size) == INTEGER_CST)
-       size_int = tree_low_cst (size, 1);
+       size_i = tree_low_cst (size, 1);
       else
-       size_int = 0;
+       size_i = 0;
 
-      if (size_int == 4)
+      if (size_i == 4)
        literal4_section ();
-      else if (size_int == 8)
+      else if (size_i == 8)
        literal8_section ();
       else
        readonly_data_section ();
@@ -235,3 +235,19 @@ nextstep_select_section (exp, reloc, align)
   else
     readonly_data_section ();
 }
+
+void
+nextstep_select_rtx_section (mode, x, align)
+     enum machine_mode mode;
+     rtx x;
+     unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+{
+  if (GET_MODE_SIZE (mode) == 8)
+    literal8_section ();
+  else if (GET_MODE_SIZE (mode) == 4
+          && (GET_CODE (x) == CONST_INT
+              || GET_CODE (x) == CONST_DOUBLE))
+    literal4_section ();
+  else
+    const_section ();
+}
index 1f3c43723269a5b5dd99cfbf1d431a27b5d1cafb..4f2eb3fd4ee34363c54a651e3f563d0ee5601fde 100644 (file)
@@ -443,19 +443,8 @@ objc_section_init ()                               \
 
 #undef TARGET_ASM_SELECT_SECTION
 #define TARGET_ASM_SELECT_SECTION nextstep_select_section
-
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(mode, rtx, align)                           \
-  do                                                                   \
-    {                                                                  \
-      if (GET_MODE_SIZE(mode) == 8)                                    \
-       literal8_section();                                             \
-      else if (GET_MODE_SIZE(mode) == 4)                               \
-       literal4_section();                                             \
-      else                                                             \
-       const_section ();                                               \
-    }                                                                  \
-  while (0)
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION nextstep_select_rtx_section
 
 #ifdef ASM_COMMENT_START
 # undef ASM_COMMENT_START
index 30d3d7cff9a8581a5a1957d81d611cee2cad01a4..8f2250354bbf0e6214d5616965ef8c0dcd3ee23c 100644 (file)
@@ -89,14 +89,6 @@ Boston, MA 02111-1307, USA.  */
 /* glibc's profiling functions don't need gcc to allocate counters.  */
 #define NO_PROFILE_COUNTERS 1
 
-/* Put plabels into the data section so we can relocate them.  */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN)     \
-  if (flag_pic && function_label_operand (RTX, MODE))  \
-    data_section ();                                   \
-  else                                                 \
-    readonly_data_section ();
-
 /* Define the strings used for the special svr4 .type and .size directives.
    These strings generally do not vary from one system running svr4 to
    another, but if a given system (e.g. m88k running svr) needs to use
index af19b64d051093abda7a2f64e1e5139986b67811..fbab5b73ae55a167db099eb8d2e97883df1338fc 100644 (file)
@@ -1492,17 +1492,6 @@ do {                                                                     \
       || GET_CODE (ADDR) == POST_INC)  \
     goto LABEL
 \f
-/* Arghh.  The hpux10 linker chokes if we have a reference to symbols
-   in a readonly data section when the symbol is defined in a shared
-   library.  Since we can't know at compile time if a symbol will be
-   satisfied by a shared library or main program we put any symbolic
-   constant into the normal data section.  */
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN)     \
-  if (symbolic_operand (RTX, MODE))    \
-    data_section ();                   \
-  else                                 \
-    readonly_data_section ();
-
 #define TARGET_ASM_SELECT_SECTION  pa_select_section
    
 /* Define this macro if references to a symbol must be treated
index a4813be29cdb4c73cbcee22ff2a2b409449f4422..003495c0b2542dffb7597f2e3e062b009138165d 100644 (file)
@@ -53,12 +53,16 @@ static int memory_offset_in_range_p PARAMS ((rtx, enum machine_mode, int, int));
 static unsigned int hash_rtx PARAMS ((rtx));
 static void romp_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
 static void romp_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void romp_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                            unsigned HOST_WIDE_INT));
 \f
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_FUNCTION_PROLOGUE
 #define TARGET_ASM_FUNCTION_PROLOGUE romp_output_function_prologue
 #undef TARGET_ASM_FUNCTION_EPILOGUE
 #define TARGET_ASM_FUNCTION_EPILOGUE romp_output_function_epilogue
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION romp_select_rtx_section
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
@@ -2068,3 +2072,14 @@ romp_initialize_trampoline (tramp, fnaddr, cxt)
   addr = memory_address (HImode, plus_constant (tramp, 20));
   emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, temp));
 }
+
+/* On ROMP, all constants are in the data area.  */
+
+static void
+romp_select_rtx_section (mode, x, align)
+     enum machine_mode mode ATTRIBUTE_UNUSED;
+     rtx x ATTRIBUTE_UNUSED;
+     unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+{
+  data section ();
+}
index 07150c0a4fb0c781412e8c50959683101e9b2903..fb8cd3587bf4db26d1d6b78451219ea9a773737c 100644 (file)
@@ -700,12 +700,6 @@ struct rt_cargs {int gregs, fregs; };
   data_offset = ((SIZE) + 12 + 3) / 4;                         \
 }
 
-/* Select section for constant in constant pool.
-
-   On ROMP, all constants are in the data area.  */
-
-#define SELECT_RTX_SECTION(MODE, X, ALIGN)     data_section ()
-
 /* Output assembler code to FILE to increment profiler label # LABELNO
    for profiling a function entry.  */
 
index 87058b232eb82a3c44fb2e8dbccbaa75c16b048b..fb45997a48665b5990a6c4c9832221a96ac331ef 100644 (file)
@@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA.  */
 #undef READONLY_DATA_SECTION
 #undef READONLY_DATA_SECTION_ASM_OP
 #undef EXTRA_SECTION_FUNCTIONS
-#undef SELECT_RTX_SECTION
+#undef TARGET_ASM_SELECT_RTX_SECTION
 #undef TARGET_ASM_SELECT_SECTION
 #undef USER_LABEL_PREFIX
 #undef ASM_OUTPUT_LABELREF
index 06114d3a4a5ee1326b279fce66a1ed0407e8967e..18c03abb558207b83a1d8e1072b9bf56b4cea7a7 100644 (file)
@@ -122,8 +122,6 @@ extern rtx rs6000_legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
 extern rtx rs6000_legitimize_reload_address PARAMS ((rtx, enum machine_mode,
                            int, int, int, int *));
 extern int rs6000_legitimate_address PARAMS ((enum machine_mode, rtx, int));
-extern void rs6000_select_rtx_section PARAMS ((enum machine_mode, rtx));
-
 extern rtx rs6000_return_addr PARAMS ((int, rtx));
 extern void rs6000_output_symbol_ref PARAMS ((FILE*, rtx));
 
index 5bca89be604ef12bee3e5c7ceb7ac73442bfb6bc..49fa94e575f8c0ce5bf4150e7f0ee2b41da63d7e 100644 (file)
@@ -166,12 +166,16 @@ static void rs6000_elf_asm_out_destructor PARAMS ((rtx, int));
 static void rs6000_elf_select_section PARAMS ((tree, int,
                                                 unsigned HOST_WIDE_INT));
 static void rs6000_elf_unique_section PARAMS ((tree, int));
+static void rs6000_elf_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                                  unsigned HOST_WIDE_INT));
 #endif
 #ifdef OBJECT_FORMAT_COFF
 static void xcoff_asm_named_section PARAMS ((const char *, unsigned int));
 static void rs6000_xcoff_select_section PARAMS ((tree, int,
                                                 unsigned HOST_WIDE_INT));
 static void rs6000_xcoff_unique_section PARAMS ((tree, int));
+static void rs6000_xcoff_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                                    unsigned HOST_WIDE_INT));
 #endif
 static int rs6000_adjust_cost PARAMS ((rtx, rtx, rtx, int));
 static int rs6000_adjust_priority PARAMS ((rtx, int));
@@ -10928,6 +10932,8 @@ rs6000_longcall_ref (call_ref)
 }
 
 \f
+#ifdef USING_ELFOS_H
+
 /* A C statement or statements to switch to the appropriate section
    for output of RTX in mode MODE.  You can assume that RTX is some
    kind of constant in RTL.  The argument MODE is redundant except in
@@ -10937,22 +10943,16 @@ rs6000_longcall_ref (call_ref)
    Do not define this macro if you put all constants in the read-only
    data section.  */
 
-#ifdef USING_ELFOS_H
-
-void
-rs6000_select_rtx_section (mode, x)
+static void
+rs6000_elf_select_rtx_section (mode, x, align)
      enum machine_mode mode;
      rtx x;
+     unsigned HOST_WIDE_INT align;
 {
   if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (x, mode))
     toc_section ();
-  else if (flag_pic
-          && (GET_CODE (x) == SYMBOL_REF
-              || GET_CODE (x) == LABEL_REF
-              || GET_CODE (x) == CONST))
-    data_section ();
   else
-    readonly_data_section ();
+    default_elf_select_rtx_section (mode, x, align);
 }
 
 /* A C statement or statements to switch to the appropriate
@@ -11683,4 +11683,16 @@ rs6000_xcoff_unique_section (decl, reloc)
       DECL_SECTION_NAME (decl) = build_string (len, string);
     }
 }
-#endif
+
+static void
+rs6000_xcoff_select_rtx_section (mode, x, align)
+     enum machine_mode mode;
+     rtx x;
+     unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+{
+  if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (x, mode))
+    toc_section ();
+  else
+    read_only_private_data_section ();
+}
+#endif /* OBJECT_FORMAT_COFF */
index 06a5bf68f3e12866e08967070c6512e0f4647474..41bce4c5efc4bdbddbf136422b491314352f1dd3 100644 (file)
@@ -547,37 +547,11 @@ fini_section ()                                                           \
     }                                                                  \
 }
 
-/* A C statement or statements to switch to the appropriate section
-   for output of RTX in mode MODE.  You can assume that RTX is some
-   kind of constant in RTL.  The argument MODE is redundant except in
-   the case of a `const_int' rtx.  Select the section by calling
-   `text_section' or one of the alternatives for other sections.
-
-   Do not define this macro if you put all constants in the read-only
-   data section.  */
-
-/* Override elfos.h definition.  */
-#undef SELECT_RTX_SECTION
-#define        SELECT_RTX_SECTION(MODE, X, ALIGN) rs6000_select_rtx_section (MODE, X)
-
-/* A C statement or statements to switch to the appropriate
-   section for output of DECL.  DECL is either a `VAR_DECL' node
-   or a constant of some sort.  RELOC indicates whether forming
-   the initial value of DECL requires link-time relocations.  */
-
-/* Override elfos.h definition.  */
+/* Override default elf definitions.  */
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define        TARGET_ASM_SELECT_RTX_SECTION rs6000_elf_select_rtx_section
 #undef TARGET_ASM_SELECT_SECTION
 #define        TARGET_ASM_SELECT_SECTION  rs6000_elf_select_section
-
-/* A C statement to build up a unique section name, expressed as a
-   STRING_CST node, and assign it to DECL_SECTION_NAME (decl).
-   RELOC indicates whether the initial value of EXP requires
-   link-time relocations.  If you do not define this macro, GCC will use
-   the symbol name prefixed by `.' as the section name.  Note - this
-   macro can now be called for uninitialized data items as well as
-   initialised data and functions.  */
-
-/* Override default elf definition.  */
 #define TARGET_ASM_UNIQUE_SECTION  rs6000_elf_unique_section
 
 /* Return non-zero if this entry is to be written into the constant pool
index cae5a37e7588ee82e5a30d0bbb8e5b6bc26e673f..2c089bdf69d4f7ca94108842346f7c10bd50f4a4 100644 (file)
@@ -135,11 +135,6 @@ toc_section ()                                             \
 
 #define READONLY_DATA_SECTION read_only_data_section
 
-/* Select the section for an initialized data object.
-
-   On the RS/6000, we have a special section for all variables except those
-   that are static.  */
-
 #define TARGET_ASM_SELECT_SECTION  rs6000_xcoff_select_section
 
 /* Return non-zero if this entry is to be written into the constant
@@ -172,12 +167,7 @@ toc_section ()                                             \
    However, if this is being placed in the TOC it must be output as a
    toc entry.  */
 
-#define SELECT_RTX_SECTION(MODE, X, ALIGN)             \
-{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X, MODE))       \
-    toc_section ();                                    \
-  else                                                 \
-    read_only_private_data_section ();                 \
-}
+#define TARGET_ASM_SELECT_RTX_SECTION  rs6000_xcoff_select_rtx_section
 
 /* If we are referencing a function that is static or is known to be
    in this file, make the SYMBOL_REF special.  We can use this to indicate
index b19561c35ab4ce2c24c050b0574a2a8c1c5a2771..7747e3c0270bf9cb49a3e8cca9b155fe4d6314af 100644 (file)
@@ -215,15 +215,6 @@ Boston, MA 02111-1307, USA.  */
 
 #define ASM_GLOBALIZE_LABEL(FILE, NAME)  \
   (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
-
-/* Select section for constant in constant pool. 
-   We are in the right section. 
-   undef for 64 bit mode (linux64.h).
- */
-
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, X, ALIGN)
-
 \f
 /* Output code to add DELTA to the first argument, and then jump to FUNCTION.
    Used for C++ multiple inheritance.  */
index ce51bcf18caf1af02634bccec3d731db467fa569..51fe26d3c773868311593ef0d9ab0c36bd92db11 100644 (file)
@@ -50,6 +50,8 @@ Boston, MA 02111-1307, USA.  */
 static bool s390_assemble_integer PARAMS ((rtx, unsigned int, int));
 static int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int));
 static int s390_adjust_priority PARAMS ((rtx, int));
+static void s390_select_rtx_section PARAMS ((enum machine_mode, rtx, 
+                                            unsigned HOST_WIDE_INT));
 
 #undef  TARGET_ASM_ALIGNED_HI_OP
 #define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
@@ -70,6 +72,9 @@ static int s390_adjust_priority PARAMS ((rtx, int));
 #undef  TARGET_ASM_CLOSE_PAREN
 #define TARGET_ASM_CLOSE_PAREN ""
 
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define        TARGET_ASM_SELECT_RTX_SECTION  s390_select_rtx_section
+
 #undef  TARGET_SCHED_ADJUST_COST
 #define TARGET_SCHED_ADJUST_COST s390_adjust_cost
 
@@ -3914,3 +3919,17 @@ s390_function_profiler (file, labelno)
     }
 }
 
+/* Select section for constant in constant pool.  In 32-bit mode,
+   constants go in the function section; in 64-bit mode in .rodata.  */
+
+static void
+s390_select_rtx_section (mode, x, align)
+     enum machine_mode mode ATTRIBUTE_UNUSED;
+     rtx x ATTRIBUTE_UNUSED;
+     unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+{
+  if (TARGET_64BIT)
+    readonly_data_section ();
+  else
+    function_section (current_function_decl);
+}
index 292f164cd1fcb356ee0ef8886034eb5dbf21ed29..7532281361d59c23d0388e4895e7424a268c6bd5 100644 (file)
@@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA.  */
   || !strcmp (STR, "target") || !strcmp (STR, "assert"))
 
 #define TARGET_ASM_SELECT_SECTION  sparc_aout_select_section
+#define TARGET_ASM_SELECT_RTX_SECTION  sparc_aout_select_rtx_section
 
 /* Output the label for a function definition.  */
 
index 866612d3b8adf5672e32d63ed11c66e3436b212f..db72a923476df455f8b6024e28c19644b4607ab8 100644 (file)
@@ -19,7 +19,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 #undef ASM_OUTPUT_IDENT
-#undef SELECT_RTX_SECTION
 
 #define BSS_SECTION_ASM_OP     "\t.section\t\".bss\""
 
index 8b7c14692ce44587489138283e01dbb9db4e6f4a..3444ffc0598c0af3532dcb6fbc39a87a0328efa5 100644 (file)
@@ -160,6 +160,9 @@ static void sparc_elf_asm_named_section PARAMS ((const char *, unsigned int));
 static void sparc_aout_select_section PARAMS ((tree, int,
                                               unsigned HOST_WIDE_INT))
      ATTRIBUTE_UNUSED;
+static void sparc_aout_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                                  unsigned HOST_WIDE_INT))
+     ATTRIBUTE_UNUSED;
 
 static int sparc_adjust_cost PARAMS ((rtx, rtx, rtx, int));
 static int sparc_issue_rate PARAMS ((void));
@@ -8056,6 +8059,23 @@ sparc_aout_select_section (t, reloc, align)
   default_select_section (t, reloc | SUNOS4_SHARED_LIBRARIES, align);
 }
 
+/* Use text section for a constant unless we need more alignment than
+   that offers.  */
+
+static void
+sparc_aout_select_rtx_section (mode, x, align)
+     enum machine_mode mode;
+     rtx x;
+     unsigned HOST_WIDE_INT align;
+{
+  if (align <= MAX_TEXT_ALIGN
+      && ! (flag_pic && (symbolic_operand (x, mode)
+                        || SUNOS4_SHARED_LIBRARIES)))
+    readonly_data_section ();
+  else
+    data_section ();
+}
+
 int
 sparc_extra_constraint_check (op, c, strict)
      rtx op;
index 8429a7f554b17e48618713f587a982caec8573a8..ad19d6ba0820b79ab4eb2795764a7bfb178124cd 100644 (file)
@@ -826,19 +826,6 @@ if (TARGET_ARCH64                          \
 #ifndef SUNOS4_SHARED_LIBRARIES
 #define SUNOS4_SHARED_LIBRARIES 0
 #endif
-
-
-/* Use text section for a constant
-   unless we need more alignment than that offers.  */
-/* This is defined differently for v9 in a cover file.  */
-#define SELECT_RTX_SECTION(MODE, X, ALIGN)     \
-{                                              \
-  if (GET_MODE_BITSIZE (MODE) <= MAX_TEXT_ALIGN \
-      && ! (flag_pic && (symbolic_operand ((X), (MODE)) || SUNOS4_SHARED_LIBRARIES)))  \
-    text_section ();                           \
-  else                                         \
-    data_section ();                           \
-}
 \f
 /* Standard register usage.  */
 
index e5b2dcce4a6ac62db88b1d3ee0d85f3bbe7a142b..513251ce83684ff2bedfbc7f18fe90d7542ef233 100644 (file)
@@ -41,6 +41,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* SunOS has on_exit instead of atexit.  */
 /* The man page says it returns int.  */
+#ifdef IN_LIBGCC2
 extern int on_exit PARAMS ((void *, void *));
+#endif
 #define ON_EXIT(FUNC) on_exit ((FUNC), 0)
 #define NEED_ATEXIT
index a5242bd8dd1b2a440ff3dd82b1ef57b959e102c7..666ee6215896795858e997b838742d3741e2ec8c 100644 (file)
@@ -68,16 +68,6 @@ Boston, MA 02111-1307, USA.  */
   "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
    %{fpic:-K PIC} %{fPIC:-K PIC} %(asm_cpu)"
 
-/* Must use data section for relocatable constants when pic.  */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN)             \
-{                                                      \
-  if (flag_pic && symbolic_operand ((RTX), (MODE)))    \
-    data_section ();                                   \
-  else                                                 \
-    readonly_data_section ();                          \
-}
-
 /* Define the names of various pseudo-op used by the Sparc/svr4 assembler.
    Note that many of these are different from the typical pseudo-ops used
    by most svr4 assemblers.  That is probably due to a (misguided?) attempt
index 9518f5fd002946b849b03aba6e58868691cb9944..880638b50ac84e2c3e5c343258565a33c032bb7f 100644 (file)
@@ -2535,18 +2535,6 @@ do {                                                     \
    Defined in svr4.h.  */
 /* #define EXTRA_SECTION_FUNCTIONS */
 
-/* A C statement or statements to switch to the appropriate section for output
-   of RTX in mode MODE.  You can assume that RTX is some kind of constant in
-   RTL.  The argument MODE is redundant except in the case of a `const_int'
-   rtx.  Select the section by calling `text_section' or one of the
-   alternatives for other sections.
-
-   Do not define this macro if you put all constants in the read-only data
-   section.
-
-   Defined in svr4.h.  */
-/* #define SELECT_RTX_SECTION(MODE, RTX, ALIGN) */
-
 /* Define this macro if jump tables (for `tablejump' insns) should be output in
    the text section, along with the assembler instructions.  Otherwise, the
    readonly data section is used.
index 9a90c6f25a4c5507c5dfb2e0767e79b2d34a6ae1..5a6f640d925dbf6c63fadf0796099b8607c5b444 100644 (file)
@@ -260,12 +260,3 @@ fini_section ()                                                    \
       in_section = in_fini;                                    \
     }                                                          \
 }
-
-/* A C statement or statements to switch to the appropriate
-   section for output of RTX in mode MODE.  RTX is some kind
-   of constant in RTL.  The argument MODE is redundant except
-   in the case of a `const_int' rtx.  Currently, these always
-   go into the const section.  */
-
-#undef  SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) readonly_data_section()
index becef7cc7bb001171a50ca1e8a7b11562f789231..e20e05659f84ceaab5f493b9109bec859866ca77 100644 (file)
@@ -1117,16 +1117,6 @@ zbss_section ()                                                          \
 #define ZCOMMON_ASM_OP                "\t.zcomm\t"
 #define TCOMMON_ASM_OP                "\t.tcomm\t"
 
-/* A C statement or statements to switch to the appropriate section
-   for output of RTX in mode MODE.  You can assume that RTX is some
-   kind of constant in RTL.  The argument MODE is redundant except in
-   the case of a `const_int' rtx.  Select the section by calling
-   `text_section' or one of the alternatives for other sections.
-
-   Do not define this macro if you put all constants in the read-only
-   data section.  */
-/* #define SELECT_RTX_SECTION(MODE, RTX, ALIGN) */
-
 /* Output at beginning/end of assembler file.  */
 #undef ASM_FILE_START
 #define ASM_FILE_START(FILE) asm_file_start(FILE)
index dea1e5f84141f79cb07c9005c0a0460a67690af1..611bebfcf2e06842e838e4cc92a1185c1e79c5a6 100644 (file)
@@ -101,10 +101,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
    doesn't allow $ in symbol names.  */
 #undef NO_DOLLAR_IN_LABEL
 
-/* Don't switch sections in the middle of a literal pool! */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN)
-  
 /* Do not force "-fpic" for this target.  */
 #define XTENSA_ALWAYS_PIC 0
 
index 9f63b7034499c092d5ff36032a76ad484684782c..56e2a5a3aeb748b961d7371b090bd45813ca3657 100644 (file)
@@ -57,10 +57,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #undef LOCAL_LABEL_PREFIX
 #define LOCAL_LABEL_PREFIX     "."
 
-/* Don't switch sections in the middle of a literal pool! */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN)
-
 /* Always enable "-fpic" for Xtensa Linux.  */
 #define XTENSA_ALWAYS_PIC 1
 
index 6b80602c367b042c1266871f8c090f8a5881f3c3..4ce5f31e57bba5dffaa83a9ec4f79357f593bfdc 100644 (file)
@@ -42,6 +42,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "function.h"
 #include "toplev.h"
 #include "optabs.h"
+#include "output.h"
 #include "libfuncs.h"
 #include "target.h"
 #include "target-def.h"
@@ -185,6 +186,24 @@ enum reg_class xtensa_char_to_class[256] =
   NO_REGS,     NO_REGS,        NO_REGS,        NO_REGS,
 };
 
+static int b4const_or_zero PARAMS ((int));
+static enum internal_test map_test_to_internal_test PARAMS ((enum rtx_code));
+static rtx gen_int_relational PARAMS ((enum rtx_code, rtx, rtx, int *));
+static rtx gen_float_relational PARAMS ((enum rtx_code, rtx, rtx));
+static rtx gen_conditional_move PARAMS ((rtx));
+static rtx fixup_subreg_mem PARAMS ((rtx x));
+static enum machine_mode xtensa_find_mode_for_size PARAMS ((unsigned));
+static void xtensa_init_machine_status PARAMS ((struct function *p));
+static void xtensa_free_machine_status PARAMS ((struct function *p));
+static void printx PARAMS ((FILE *, signed int));
+static void xtensa_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                              unsigned HOST_WIDE_INT));
+
+static rtx frame_size_const;
+static int current_function_arg_words;
+static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
+  REG_ALLOC_ORDER;
+\f
 /* This macro generates the assembly code for function entry.
    FILE is a stdio stream to output the code to.
    SIZE is an int: how many units of temporary storage to allocate.
@@ -210,23 +229,11 @@ enum reg_class xtensa_char_to_class[256] =
 #undef TARGET_ASM_ALIGNED_SI_OP
 #define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
 
-struct gcc_target targetm = TARGET_INITIALIZER;
-
-static int b4const_or_zero PARAMS ((int));
-static enum internal_test map_test_to_internal_test PARAMS ((enum rtx_code));
-static rtx gen_int_relational PARAMS ((enum rtx_code, rtx, rtx, int *));
-static rtx gen_float_relational PARAMS ((enum rtx_code, rtx, rtx));
-static rtx gen_conditional_move PARAMS ((rtx));
-static rtx fixup_subreg_mem PARAMS ((rtx x));
-static enum machine_mode xtensa_find_mode_for_size PARAMS ((unsigned));
-static void xtensa_init_machine_status PARAMS ((struct function *p));
-static void xtensa_free_machine_status PARAMS ((struct function *p));
-static void printx PARAMS ((FILE *, signed int));
-static rtx frame_size_const;
-static int current_function_arg_words;
-static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
-  REG_ALLOC_ORDER;
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION  xtensa_select_rtx_section
 
+struct gcc_target targetm = TARGET_INITIALIZER;
+\f
 
 /*
  * Functions to test Xtensa immediate operand validity.
@@ -1628,7 +1635,7 @@ xtensa_emit_call (callop, operands)
      int callop;
      rtx *operands;
 {
-  char *result = (char *) malloc (64);
+  static char result[64];
   rtx tgt = operands[callop];
 
   if (GET_CODE (tgt) == CONST_INT)
@@ -2731,3 +2738,14 @@ a7_overlap_mentioned_p (x)
 
   return 0;
 }
+
+/* The literal pool stays with the function.  */
+
+static void
+xtensa_select_rtx_section (mode, x, align)
+     enum machine_mode mode ATTRIBUTE_UNUSED;
+     rtx x ATTRIBUTE_UNUSED;
+     unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+{
+  function_section (current_function_decl);
+}
index 15b57ccd2fbcb3989087d3a33d7dc657677a7bf0..35350d4c2c9655e139909d02cacb6dcfd95a4f37 100644 (file)
@@ -242,7 +242,6 @@ extern unsigned xtensa_current_frame_size;
 
 /* Size in bits of various types on the target machine.  */
 #define INT_TYPE_SIZE 32
-#define MAX_INT_TYPE_SIZE 32
 #define SHORT_TYPE_SIZE 16
 #define LONG_TYPE_SIZE 32
 #define MAX_LONG_TYPE_SIZE 32
@@ -254,7 +253,6 @@ extern unsigned xtensa_current_frame_size;
 /* Tell the preprocessor the maximum size of wchar_t.  */
 #ifndef MAX_WCHAR_TYPE_SIZE
 #ifndef WCHAR_TYPE_SIZE
-#define MAX_WCHAR_TYPE_SIZE MAX_INT_TYPE_SIZE
 #endif
 #endif
 
@@ -1276,12 +1274,6 @@ typedef struct xtensa_args {
    Do not define this if the table should contain absolute addresses.  */
 /* #define CASE_VECTOR_PC_RELATIVE */
 
-/* Specify the tree operation to be used to convert reals to integers.  */
-#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
-
-/* This is the kind of divide that is easiest to do in the general case.  */
-#define EASY_DIV_EXPR TRUNC_DIV_EXPR
-
 /* Define this as 1 if 'char' should by default be signed; else as 0.  */
 #define DEFAULT_SIGNED_CHAR 0
 
@@ -1654,7 +1646,7 @@ typedef struct xtensa_args {
 #define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, FUNDECL, SIZE)          \
   do {                                                                 \
     tree fnsection;                                                    \
-    resolve_unique_section ((FUNDECL), 0);                             \
+    resolve_unique_section ((FUNDECL), 0, flag_function_sections);     \
     fnsection = DECL_SECTION_NAME (FUNDECL);                           \
     if (fnsection != NULL_TREE)                                                \
       {                                                                        \
index 339d83d2be4d5c6603f33b36952ca3490b72827b..f1baa212d7767368f36749149dc20e3e207cb165 100644 (file)
@@ -5757,18 +5757,6 @@ functions should do jobs analogous to those of @code{text_section} and
 @code{data_section}, for your additional sections.  Do not define this
 macro if you do not define @code{EXTRA_SECTIONS}.
 
-@findex SELECT_RTX_SECTION
-@item SELECT_RTX_SECTION (@var{mode}, @var{rtx}, @var{align})
-A C statement or statements to switch to the appropriate section for
-output of @var{rtx} in mode @var{mode}.  You can assume that @var{rtx}
-is some kind of constant in RTL@.  The argument @var{mode} is redundant
-except in the case of a @code{const_int} rtx.  Select the section by
-calling @code{text_section} or one of the alternatives for other
-sections.  @var{align} is the constant alignment in bits.
-
-Do not define this macro if you put all constants in the read-only
-data section.
-
 @findex JUMP_TABLES_IN_TEXT_SECTION
 @item JUMP_TABLES_IN_TEXT_SECTION
 Define this macro to be an expression with a nonzero value if jump
@@ -5838,6 +5826,19 @@ example, the function @code{foo} would be placed in @code{.text.foo}.
 Whatever the actual target object format, this is often good enough.
 @end deftypefn
 
+@deftypefn {Target Hook} void TARGET_ASM_SELECT_RTX_SECTION (enum machine_mode @var{mode}, rtx @var{x}, unsigned HOST_WIDE_INT @var{align})
+Switches to the appropriate section for output of constant pool entry
+@var{x} in @var{mode}.  You can assume that @var{x} is some kind of
+constant in RTL@.  The argument @var{mode} is redundant except in the
+case of a @code{const_int} rtx.  Select the section by calling
+@code{readonly_data_section} or one of the alternatives for other
+sections.  @var{align} is the constant alignment in bits.
+
+The default version of this function takes care of putting symbolic
+constants in @code{flag_pic} mode in @code{data_section} and everything
+else in @code{readonly_data_section}.
+@end deftypefn
+
 @node PIC
 @section Position Independent Code
 @cindex position independent code
index 2c8dbd638bede3091b95bc456f199dda528a7f2f..82dc08341ff0516ec457c541b55b56b4ebd235ab 100644 (file)
@@ -548,7 +548,10 @@ extern void default_select_section PARAMS ((tree, int,
 extern void default_elf_select_section PARAMS ((tree, int,
                                                unsigned HOST_WIDE_INT));
 extern void default_unique_section PARAMS ((tree, int));
-
+extern void default_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                               unsigned HOST_WIDE_INT));
+extern void default_elf_select_rtx_section PARAMS ((enum machine_mode, rtx,
+                                                   unsigned HOST_WIDE_INT));
 /* Emit data for vtable gc for GNU binutils.  */
 extern void assemble_vtable_entry PARAMS ((struct rtx_def *, HOST_WIDE_INT));
 extern void assemble_vtable_inherit PARAMS ((struct rtx_def *,
index 01be4106641dec4114575915d8aa418cef2336b1..aa9d5ac39f9b33fc4209e41d1926c34b9f197339 100644 (file)
@@ -595,7 +595,7 @@ typedef char _Bool;
        MERGE_MACHINE_TYPE_ATTRIBUTES MERGE_MACHINE_DECL_ATTRIBUTES     \
        MD_INIT_BUILTINS MD_EXPAND_BUILTIN ASM_OUTPUT_CONSTRUCTOR       \
        ASM_OUTPUT_DESTRUCTOR SIGNED_CHAR_SPEC MAX_CHAR_TYPE_SIZE       \
-       WCHAR_UNSIGNED UNIQUE_SECTION SELECT_SECTION
+       WCHAR_UNSIGNED UNIQUE_SECTION SELECT_SECTION SELECT_RTX_SECTION
 
 /* And other obsolete target macros, or macros that used to be in target
    headers and were not used, and may be obsolete or may never have
index 5390efa57abe13ab2593062236c7536d42d25af1..c7f2e24233a3515d4b24e6d4a79424973a72bb89 100644 (file)
@@ -67,6 +67,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #define TARGET_ASM_UNIQUE_SECTION default_unique_section
 #endif
 
+#ifndef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION default_select_rtx_section
+#endif
+
 #if !defined(TARGET_ASM_CONSTRUCTOR) && !defined(USE_COLLECT2)
 # ifdef CTORS_SECTION_ASM_OP
 #  define TARGET_ASM_CONSTRUCTOR default_ctor_section_asm_out_constructor
@@ -140,6 +144,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
                        TARGET_ASM_EXCEPTION_SECTION,           \
                        TARGET_ASM_EH_FRAME_SECTION,            \
                        TARGET_ASM_SELECT_SECTION,              \
+                       TARGET_ASM_SELECT_RTX_SECTION,          \
                        TARGET_ASM_UNIQUE_SECTION,              \
                        TARGET_ASM_CONSTRUCTOR,                 \
                        TARGET_ASM_DESTRUCTOR}
index 8b500bd15c64820d1504dff3e5a1c8fea1b76279..9b64875fd942a79b8a66a3b20c6b0651c50611f0 100644 (file)
@@ -98,6 +98,11 @@ struct gcc_target
        the required alignment of the data.  */
     void (* select_section) PARAMS ((tree, int, unsigned HOST_WIDE_INT));
 
+    /* Select and switch to a section for X with MODE.  ALIGN is
+       the desired alignment of the data.  */
+    void (* select_rtx_section) PARAMS ((enum machine_mode, rtx,
+                                        unsigned HOST_WIDE_INT));
+
     /* Select a unique section name for DECL.  RELOC is the same as
        for SELECT_SECTION.  */
     void (* unique_section) PARAMS ((tree, int));
index 3fc3af8d8d059f6232c2026f3ad71afc79942a09..a5fef332260d6bb6320eb86a02de97f516c64fc6 100644 (file)
@@ -3794,11 +3794,7 @@ output_constant_pool (fnname, fndecl)
        }
 
       /* First switch to correct section.  */
-#ifdef SELECT_RTX_SECTION
-      SELECT_RTX_SECTION (pool->mode, x, pool->align);
-#else
-      readonly_data_section ();
-#endif
+      (*targetm.asm_out.select_rtx_section) (pool->mode, x, pool->align);
 
 #ifdef ASM_OUTPUT_SPECIAL_POOL_ENTRY
       ASM_OUTPUT_SPECIAL_POOL_ENTRY (asm_out_file, x, pool->mode,
@@ -5495,3 +5491,52 @@ default_unique_section (decl, reloc)
 
   DECL_SECTION_NAME (decl) = build_string (nlen + plen, string);
 }
+
+void
+default_select_rtx_section (mode, x, align)
+     enum machine_mode mode ATTRIBUTE_UNUSED;
+     rtx x;
+     unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+{
+  if (flag_pic)
+    switch (GET_CODE (x))
+      {
+      case CONST:
+      case SYMBOL_REF:
+      case LABEL_REF:
+       data_section ();
+       return;
+
+      default:
+       break;
+      }
+
+  readonly_data_section ();
+}
+
+void
+default_elf_select_rtx_section (mode, x, align)
+     enum machine_mode mode;
+     rtx x;
+     unsigned HOST_WIDE_INT align;
+{
+  /* ??? Handle small data here somehow.  */
+
+  if (flag_pic)
+    switch (GET_CODE (x))
+      {
+      case CONST:
+      case SYMBOL_REF:
+       named_section (NULL_TREE, ".data.rel.ro", 3);
+       return;
+
+      case LABEL_REF:
+       named_section (NULL_TREE, ".data.rel.ro.local", 1);
+       return;
+
+      default:
+       break;
+      }
+
+  mergeable_constant_section (mode, align, 0);
+}