system.h (SELECT_RTX_SECTION): Poison.

* 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
This commit is contained in:
Richard Henderson 2002-05-18 16:47:22 -07:00
parent d63e8c4857
commit b64a1b533c
64 changed files with 469 additions and 432 deletions

View 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.

View 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;
}
#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 */
#if TARGET_ABI_OPEN_VMS
/* Return the VMS argument type corresponding to MODE. */

View 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

View 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

View 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.

View 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.

View 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.

View 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));

View 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;

View 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 { \

View 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

View 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 */

View 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) \
{ \

View 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 { \

View 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()

View 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

View 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

View 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;
/* 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);
}
/* 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;
}

View 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

View 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.

View 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

View 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"

View 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). */

View 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. */

View 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 (); \
}

View 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 \

View 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 \

View 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));

View 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);
}
}

View 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

View 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)

View 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));

View 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 ();
}

View 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

View 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

View File

@ -1492,17 +1492,6 @@ do { \
|| GET_CODE (ADDR) == POST_INC) \
goto LABEL
/* 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

View 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));
/* 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;
@ -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 ();
}

View 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. */

View 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

View 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));

View 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)
}
#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 */

View 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

View 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

View 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)
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
Used for C++ multiple inheritance. */

View 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);
}

View 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. */

View 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\""

View 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;

View 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 (); \
}
/* Standard register usage. */

View 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

View 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

View 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.

View 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()

View 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)

View 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

View 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

View 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;
/* 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"
#undef TARGET_ASM_SELECT_RTX_SECTION
#define TARGET_ASM_SELECT_RTX_SECTION xtensa_select_rtx_section
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;
/*
* 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);
}

View 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) \
{ \

View 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

View 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 *,

View 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

View 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}

View 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));

View 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);
}