rs6000.c (rs6000_assemble_visibility): Protect declaration inside macro.

* rs6000.c (rs6000_assemble_visibility): Protect declaration
        inside macro.  Correct function definition typo.
        (rs6000_xcoff_section_type_flags): New function.
        (TARGET_SECTION_TYPE_FLAGS): Remove definition.
        (rs6000_elf_section_type_flags): Call default_section_type_flags_1
        with appropriate PIC test.
        (rs6000_xcoff_select_section): Use decl_readonly_section_1 to
        determine readonly.
        (rs6000_binds_local_p): Combine PIC flags.
        * sysv4.h (TARGET_SECTION_TYPE_FLAGS): Define.
        * xcoff.h (TARGET_SECTION_TYPE_FLAGS): Define.

From-SVN: r57005
This commit is contained in:
David Edelsohn 2002-09-10 12:39:20 +00:00 committed by David Edelsohn
parent 65a8189ea7
commit 5add320208
4 changed files with 40 additions and 39 deletions

View File

@ -1,3 +1,17 @@
2002-09-10 David Edelsohn <edelsohn@gnu.org>
* rs6000.c (rs6000_assemble_visibility): Protect declaration
inside macro. Correct function definition typo.
(rs6000_xcoff_section_type_flags): New function.
(TARGET_SECTION_TYPE_FLAGS): Remove definition.
(rs6000_elf_section_type_flags): Call default_section_type_flags_1
with appropriate PIC test.
(rs6000_xcoff_select_section): Use decl_readonly_section_1 to
determine readonly.
(rs6000_binds_local_p): Combine PIC flags.
* sysv4.h (TARGET_SECTION_TYPE_FLAGS): Define.
* xcoff.h (TARGET_SECTION_TYPE_FLAGS): Define.
2002-09-09 Per Bothner <per@bothner.com>
* print-tree.c (print_node): In a STRING_CST, escape non-ascii

View File

@ -186,7 +186,9 @@ static void toc_hash_mark_table PARAMS ((void *));
static int constant_pool_expr_1 PARAMS ((rtx, int *, int *));
static struct machine_function * rs6000_init_machine_status PARAMS ((void));
static bool rs6000_assemble_integer PARAMS ((rtx, unsigned int, int));
#ifdef HAVE_GAS_HIDDEN
static void rs6000_assemble_visibility PARAMS ((tree, const char *));
#endif
static int rs6000_ra_ever_killed PARAMS ((void));
static tree rs6000_handle_longcall_attribute PARAMS ((tree *, tree, tree, int, bool *));
const struct attribute_spec rs6000_attribute_table[];
@ -219,6 +221,7 @@ 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));
static const char * rs6000_xcoff_strip_name_encoding PARAMS ((const char *));
static unsigned int rs6000_xcoff_section_type_flags PARAMS ((tree, const char *, int));
#endif
static void rs6000_xcoff_encode_section_info PARAMS ((tree, int))
ATTRIBUTE_UNUSED;
@ -355,11 +358,6 @@ static const char alt_reg_names[][8] =
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE rs6000_output_function_epilogue
#if TARGET_ELF
#undef TARGET_SECTION_TYPE_FLAGS
#define TARGET_SECTION_TYPE_FLAGS rs6000_elf_section_type_flags
#endif
#undef TARGET_SCHED_ISSUE_RATE
#define TARGET_SCHED_ISSUE_RATE rs6000_issue_rate
#undef TARGET_SCHED_ADJUST_COST
@ -8163,7 +8161,7 @@ rs6000_assemble_integer (x, size, aligned_p)
/* Emit an assembler directive to set symbol visibility for DECL to
VISIBILITY_TYPE. */
void
static void
rs6000_assemble_visibility (decl, visibility_type)
tree decl;
const char *visibility_type;
@ -12992,7 +12990,9 @@ rs6000_elf_section_type_flags (decl, name, reloc)
const char *name;
int reloc;
{
unsigned int flags = default_section_type_flags (decl, name, reloc);
unsigned int flags
= default_section_type_flags_1 (decl, name, reloc,
flag_pic || DEFAULT_ABI == ABI_AIX);
if (TARGET_RELOCATABLE)
flags |= SECTION_WRITE;
@ -13107,25 +13107,7 @@ rs6000_xcoff_select_section (decl, reloc, align)
int reloc;
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
{
bool readonly = false;
if (TREE_CODE (decl) == STRING_CST)
readonly = !flag_writable_strings;
else if (TREE_CODE (decl) == VAR_DECL)
readonly = (!reloc
&& TREE_READONLY (decl)
&& !TREE_SIDE_EFFECTS (decl)
&& DECL_INITIAL (decl)
&& DECL_INITIAL (decl) != error_mark_node
&& TREE_CONSTANT (DECL_INITIAL (decl)));
else if (TREE_CODE (decl) == CONSTRUCTOR)
readonly = (!reloc
&& !TREE_SIDE_EFFECTS (decl)
&& TREE_CONSTANT (decl));
else
readonly = !reloc;
if (readonly)
if (decl_readonly_section_1 (decl, reloc, 1))
{
if (TREE_PUBLIC (decl))
read_only_data_section ();
@ -13195,6 +13177,17 @@ rs6000_xcoff_strip_name_encoding (name)
return name;
}
/* Section attributes. AIX is always PIC. */
static unsigned int
rs6000_xcoff_section_type_flags (decl, name, reloc)
tree decl;
const char *name;
int reloc;
{
return default_section_type_flags_1 (decl, name, reloc, 1);
}
#endif /* TARGET_XCOFF */
/* Note that this is also used for PPC64 Linux. */
@ -13217,9 +13210,6 @@ static bool
rs6000_binds_local_p (decl)
tree decl;
{
if (DEFAULT_ABI == ABI_AIX)
return default_binds_local_p_1 (decl, rs6000_flag_pic);
else
return default_binds_local_p_1 (decl, flag_pic);
return default_binds_local_p_1 (decl, flag_pic || rs6000_flag_pic);
}

View File

@ -789,6 +789,7 @@ extern int fixuplabelno;
#define TARGET_ENCODE_SECTION_INFO rs6000_elf_encode_section_info
#define TARGET_STRIP_NAME_ENCODING rs6000_elf_strip_name_encoding
#define TARGET_IN_SMALL_DATA_P rs6000_elf_in_small_data_p
#define TARGET_SECTION_TYPE_FLAGS rs6000_elf_section_type_flags
/* The ELF version doesn't encode [DS] or whatever at the end of symbols. */

View File

@ -161,9 +161,14 @@ toc_section () \
|| (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
&& ! TARGET_NO_FP_IN_TOC)))))
#define TARGET_ASM_GLOBALIZE_LABEL rs6000_xcoff_asm_globalize_label
#define TARGET_ASM_NAMED_SECTION rs6000_xcoff_asm_named_section
#define TARGET_ASM_SELECT_SECTION rs6000_xcoff_select_section
#define TARGET_ASM_SELECT_RTX_SECTION rs6000_xcoff_select_rtx_section
#define TARGET_ASM_UNIQUE_SECTION rs6000_xcoff_unique_section
#define TARGET_ENCODE_SECTION_INFO rs6000_xcoff_encode_section_info
#define TARGET_STRIP_NAME_ENCODING rs6000_xcoff_strip_name_encoding
#define TARGET_SECTION_TYPE_FLAGS rs6000_xcoff_section_type_flags
/* FP save and restore routines. */
#define SAVE_FP_PREFIX "._savef"
@ -411,15 +416,6 @@ toc_section () \
Align entire section to BIGGEST_ALIGNMENT. */
#define DATA_SECTION_ASM_OP "\t.csect .data[RW],3"
/* Define unique section name -- functions only. */
#define TARGET_ASM_UNIQUE_SECTION rs6000_xcoff_unique_section
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION rs6000_xcoff_asm_named_section
/* Globalize a label. */
#define TARGET_ASM_GLOBALIZE_LABEL rs6000_xcoff_asm_globalize_label
/* Define the name of the section to use for the EH language specific
data areas (.gcc_except_table on most other systems). */
#define TARGET_ASM_EXCEPTION_SECTION data_section