aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2003-07-14 20:23:38 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2003-07-14 20:23:38 +0000
commitc1115ccd687a14e68e786ff674c004c6f36ace4b (patch)
treed8fcce325648b50082ca7959a14505993fc8914f /gcc
parent748d4c7e65660d515e71a361b186bd31f9c4e06a (diff)
downloadgcc-c1115ccd687a14e68e786ff674c004c6f36ace4b.zip
gcc-c1115ccd687a14e68e786ff674c004c6f36ace4b.tar.gz
gcc-c1115ccd687a14e68e786ff674c004c6f36ace4b.tar.bz2
elf.h (ASM_DECLARE_OBJECT_NAME): Use mips_declare_object_name.
* config/mips/elf.h (ASM_DECLARE_OBJECT_NAME): Use mips_declare_object_name. (ASM_FINISH_DECLARE_OBJECT): Likewise mips_finish_declare_object. * config/mips/elf64.h: As for elf.h. * config/mips/iris6.h: Likewise. * config/mips/linux.h (ASM_DECLARE_OBJECT_NAME): As for elf.h. * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Remove unnecessary do...while (0) block. * config/mips/mips-protos.h (mips_declare_object_name): Declare. (mips_finish_declare_object): Declare. * config/mips/mips.c (mips_declare_object_name): New function. (mips_finish_declare_object): New function. From-SVN: r69352
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/mips/elf.h49
-rw-r--r--gcc/config/mips/elf64.h42
-rw-r--r--gcc/config/mips/iris6.h40
-rw-r--r--gcc/config/mips/linux.h21
-rw-r--r--gcc/config/mips/mips-protos.h4
-rw-r--r--gcc/config/mips/mips.c55
-rw-r--r--gcc/config/mips/mips.h18
8 files changed, 85 insertions, 157 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 37c8737..f3132a1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,18 @@
2003-07-14 Richard Sandiford <rsandifo@redhat.com>
+ * config/mips/elf.h (ASM_DECLARE_OBJECT_NAME): Use
+ mips_declare_object_name.
+ (ASM_FINISH_DECLARE_OBJECT): Likewise mips_finish_declare_object.
+ * config/mips/elf64.h: As for elf.h.
+ * config/mips/iris6.h: Likewise.
+ * config/mips/linux.h (ASM_DECLARE_OBJECT_NAME): As for elf.h.
+ * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Remove unnecessary
+ do...while (0) block.
+ * config/mips/mips-protos.h (mips_declare_object_name): Declare.
+ (mips_finish_declare_object): Declare.
+ * config/mips/mips.c (mips_declare_object_name): New function.
+ (mips_finish_declare_object): New function.
+
* config/mips/elf.h (SBSS_SECTION_ASM_OP): Delete.
* config/mips/linux.h: Likewise.
diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h
index f801525..a13c864 100644
--- a/gcc/config/mips/elf.h
+++ b/gcc/config/mips/elf.h
@@ -95,50 +95,11 @@ do { \
} while (0)
#endif
-/* These macros generate the special .type and .size directives which
- are used to set the corresponding fields of the linker symbol table
- entries in an ELF object file under SVR4. These macros also output
- the starting labels for the relevant functions/objects. */
-
-/* Write the extra assembler code needed to declare an object properly. */
-
-#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
- do { \
- HOST_WIDE_INT size; \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
- } \
- mips_declare_object (FILE, NAME, "", ":\n", 0); \
- } while (0)
-
-/* Output the size directive for a decl in rest_of_decl_compilation
- in the case where we did not do so before the initializer.
- Once we find the error_mark_node, we know that the value of
- size_directive_output was set
- by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
-
-#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
-do { \
- const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
- HOST_WIDE_INT size; \
- \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
- && ! AT_END && TOP_LEVEL \
- && DECL_INITIAL (DECL) == error_mark_node \
- && !size_directive_output) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
- } \
- } while (0)
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
+
+#undef ASM_FINISH_DECLARE_OBJECT
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
do { fputc ( '\t', FILE); \
diff --git a/gcc/config/mips/elf64.h b/gcc/config/mips/elf64.h
index 6972128..b520812 100644
--- a/gcc/config/mips/elf64.h
+++ b/gcc/config/mips/elf64.h
@@ -60,49 +60,11 @@ Boston, MA 02111-1307, USA. */
#define TYPE_ASM_OP "\t.type\t"
#define SIZE_ASM_OP "\t.size\t"
-/* These macros generate the special .type and .size directives which
- are used to set the corresponding fields of the linker symbol table
- entries in an ELF object file under SVR4. These macros also output
- the starting labels for the relevant functions/objects. */
-
-/* Write the extra assembler code needed to declare an object properly. */
-
#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
- do { \
- HOST_WIDE_INT size; \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
- } \
- mips_declare_object (FILE, NAME, "", ":\n", 0); \
- } while (0)
-
-/* Output the size directive for a decl in rest_of_decl_compilation
- in the case where we did not do so before the initializer.
- Once we find the error_mark_node, we know that the value of
- size_directive_output was set
- by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
-do { \
- const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
- HOST_WIDE_INT size; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
- && ! AT_END && TOP_LEVEL \
- && DECL_INITIAL (DECL) == error_mark_node \
- && !size_directive_output) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
- } \
- } while (0)
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
do { fputc ( '\t', FILE); \
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index 0bfc44b..c9b4ec8 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -370,51 +370,17 @@ while (0)
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-/* Write the extra assembler code needed to declare an object properly. */
-
-#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
-do \
- { \
- HOST_WIDE_INT size; \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (STREAM, NAME, size); \
- } \
- mips_declare_object (STREAM, NAME, "", ":\n", 0); \
- } \
-while (0)
-
/* Define the `__builtin_va_list' type for the ABI. On IRIX 6, this
type is `char *'. */
#undef BUILD_VA_LIST_TYPE
#define BUILD_VA_LIST_TYPE(VALIST) \
(VALIST) = build_pointer_type (char_type_node)
-/* Output the size directive for a decl in rest_of_decl_compilation
- in the case where we did not do so before the initializer.
- Once we find the error_mark_node, we know that the value of
- size_directive_output was set
- by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
-do { \
- const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
- HOST_WIDE_INT size; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
- && ! AT_END && TOP_LEVEL \
- && DECL_INITIAL (DECL) == error_mark_node \
- && !size_directive_output) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
- } \
- } while (0)
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index 133ce28..e7c9afd 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -54,27 +54,8 @@ do { \
ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
} while (0)
-/* These macros generate the special .type and .size directives which
- are used to set the corresponding fields of the linker symbol table
- entries in an ELF object file under SVR4. These macros also output
- the starting labels for the relevant functions/objects. */
-
-/* Write the extra assembler code needed to declare an object properly. */
-
#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
- do { \
- HOST_WIDE_INT size; \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
- } \
- mips_declare_object (FILE, NAME, "", ":\n", 0); \
- } while (0)
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
#undef TARGET_VERSION
#if TARGET_ENDIAN_DEFAULT == 0
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index 217647b..d60c7c7 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -35,6 +35,10 @@ extern int mips_can_use_return_insn PARAMS ((void));
extern void mips_declare_object PARAMS ((FILE *, const char *,
const char *,
const char *, int));
+extern void mips_declare_object_name PARAMS ((FILE *, const char *,
+ tree));
+extern void mips_finish_declare_object PARAMS ((FILE *, tree,
+ int, int));
extern void mips_expand_epilogue PARAMS ((int));
extern void mips_expand_prologue PARAMS ((void));
extern void mips_output_filename PARAMS ((FILE *, const char *));
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index a6ddf2b..b7b9b7b 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -6236,6 +6236,61 @@ mips_declare_object (stream, name, init_string, final_string, size)
TREE_ASM_WRITTEN (name_tree) = 1;
}
}
+
+#ifdef ASM_OUTPUT_SIZE_DIRECTIVE
+extern int size_directive_output;
+
+/* Implement ASM_DECLARE_OBJECT_NAME. This is like most of the standard ELF
+ definitions except that it uses mips_declare_object() to emit the label. */
+
+void
+mips_declare_object_name (stream, name, decl)
+ FILE *stream;
+ const char *name;
+ tree decl ATTRIBUTE_UNUSED;
+{
+#ifdef ASM_OUTPUT_TYPE_DIRECTIVE
+ ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "object");
+#endif
+
+ size_directive_output = 0;
+ if (!flag_inhibit_size_directive && DECL_SIZE (decl))
+ {
+ HOST_WIDE_INT size;
+
+ size_directive_output = 1;
+ size = int_size_in_bytes (TREE_TYPE (decl));
+ ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size);
+ }
+
+ mips_declare_object (stream, name, "", ":\n", 0);
+}
+
+/* Implement ASM_FINISH_DECLARE_OBJECT. This is generic ELF stuff. */
+
+void
+mips_finish_declare_object (stream, decl, top_level, at_end)
+ FILE *stream;
+ tree decl;
+ int top_level, at_end;
+{
+ const char *name;
+
+ name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
+ if (!flag_inhibit_size_directive
+ && DECL_SIZE (decl) != 0
+ && !at_end && top_level
+ && DECL_INITIAL (decl) == error_mark_node
+ && !size_directive_output)
+ {
+ HOST_WIDE_INT size;
+
+ size_directive_output = 1;
+ size = int_size_in_bytes (TREE_TYPE (decl));
+ ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size);
+ }
+}
+#endif
/* Return the register that should be used as the global pointer
within this function. Return 0 if the function doesn't need
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index bb75d11..870dc51 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3609,23 +3609,9 @@ while (0)
$Lc[0-9]+ Label for use in s<xx> operation.
$Le[0-9]+ End blocks for MIPS debug support */
-/* A C statement (sans semicolon) to output to the stdio stream
- STREAM any text necessary for declaring the name NAME of an
- initialized variable which is being defined. This macro must
- output the label definition (perhaps using `ASM_OUTPUT_LABEL').
- The argument DECL is the `VAR_DECL' tree node representing the
- variable.
-
- If this macro is not defined, then the variable name is defined
- in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
-
#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
-do \
- { \
- mips_declare_object (STREAM, NAME, "", ":\n", 0); \
- } \
-while (0)
+#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
+ mips_declare_object (STREAM, NAME, "", ":\n", 0)
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP "\t.globl\t"