diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2004-02-12 19:08:34 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2004-02-12 19:08:34 +0000 |
commit | 35f5add9236429ef410635f4180d6ea3f29010c8 (patch) | |
tree | 6093601200bca6d5f063d88800622361086adbd7 /gcc/config | |
parent | e88e9aee05d3b1ea0e5860713b5eb873130a23a8 (diff) | |
download | gcc-35f5add9236429ef410635f4180d6ea3f29010c8.zip gcc-35f5add9236429ef410635f4180d6ea3f29010c8.tar.gz gcc-35f5add9236429ef410635f4180d6ea3f29010c8.tar.bz2 |
re PR bootstrap/13617 (IRIX 6.5 Ada bootstrap failure with GNU as 2.14.90)
PR bootstrap/13617
* config/mips/mips-protos.h (mips_output_aligned_decl_common): Declare.
(mips_declare_object): Make variadic.
* config/mips/mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use
mips_output_aligned_decl_common.
* config/mips/mips.c (mips_output_aligned_decl_common): New function.
(mips_declare_object): Make variadic.
From-SVN: r77721
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/mips/mips-protos.h | 5 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 54 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 23 |
3 files changed, 55 insertions, 27 deletions
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h index 8a55e1a..a2b1d45 100644 --- a/gcc/config/mips/mips-protos.h +++ b/gcc/config/mips/mips-protos.h @@ -104,8 +104,11 @@ extern void mips_output_lineno (FILE *, int); extern void mips_output_ascii (FILE *, const char *, size_t, const char *); extern void mips_output_aligned_bss (FILE *, tree, const char *, unsigned HOST_WIDE_INT, int); +extern void mips_output_aligned_decl_common (FILE *, tree, const char *, + unsigned HOST_WIDE_INT, + unsigned int); extern void mips_declare_object (FILE *, const char *, const char *, - const char *, int); + const char *, ...); extern void mips_declare_object_name (FILE *, const char *, tree); extern void mips_finish_declare_object (FILE *, tree, int, int); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 4d3a5bf..40b8014 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -6022,17 +6022,63 @@ mips_file_end (void) } } +/* Implement ASM_OUTPUT_ALIGNED_DECL_COMMON. This is usually the same as + the elfos.h version, but we also need to handle -muninit-const-in-rodata + and the limitations of the SGI o32 assembler. */ + +void +mips_output_aligned_decl_common (FILE *stream, tree decl, const char *name, + unsigned HOST_WIDE_INT size, + unsigned int align) +{ + /* If the target wants uninitialized const declarations in + .rdata then don't put them in .comm. */ + if (TARGET_EMBEDDED_DATA && TARGET_UNINIT_CONST_IN_RODATA + && TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl) + && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node)) + { + if (TREE_PUBLIC (decl) && DECL_NAME (decl)) + targetm.asm_out.globalize_label (stream, name); + + readonly_data_section (); + ASM_OUTPUT_ALIGN (stream, floor_log2 (align / BITS_PER_UNIT)); + mips_declare_object (stream, name, "", + ":\n\t.space\t" HOST_WIDE_INT_PRINT_UNSIGNED "\n", + size); + } + else if (TARGET_SGI_O32_AS) + { + /* The SGI o32 assembler doesn't accept an alignment, so round up + the size instead. */ + size += (align / BITS_PER_UNIT) - 1; + size -= size % (align / BITS_PER_UNIT); + mips_declare_object (stream, name, "\n\t.comm\t", + "," HOST_WIDE_INT_PRINT_UNSIGNED "\n", size); + } + else + mips_declare_object (stream, name, "\n\t.comm\t", + "," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n", + size, align / BITS_PER_UNIT); +} + /* Emit either a label, .comm, or .lcomm directive. When using assembler macros, mark the symbol as written so that mips_file_end won't emit an - .extern for it. */ + .extern for it. STREAM is the output file, NAME is the name of the + symbol, INIT_STRING is the string that should be written before the + symbol and FINAL_STRING is the string that shoulbe written after it. + FINAL_STRING is a printf() format that consumes the remaining arguments. */ void mips_declare_object (FILE *stream, const char *name, const char *init_string, - const char *final_string, int size) + const char *final_string, ...) { - fputs (init_string, stream); /* "", "\t.comm\t", or "\t.lcomm\t" */ + va_list ap; + + fputs (init_string, stream); assemble_name (stream, name); - fprintf (stream, final_string, size); /* ":\n", ",%u\n", ",%u\n" */ + va_start (ap, final_string); + vfprintf (stream, final_string, ap); + va_end (ap); if (!TARGET_EXPLICIT_RELOCS) { diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 616557c..708b2e2 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -3177,28 +3177,7 @@ while (0) /* This says how to define a global common symbol. */ -#define ASM_OUTPUT_ALIGNED_DECL_COMMON(STREAM, DECL, NAME, SIZE, ALIGN) \ - do { \ - /* If the target wants uninitialized const declarations in \ - .rdata then don't put them in .comm */ \ - if (TARGET_EMBEDDED_DATA && TARGET_UNINIT_CONST_IN_RODATA \ - && TREE_CODE (DECL) == VAR_DECL && TREE_READONLY (DECL) \ - && (DECL_INITIAL (DECL) == 0 \ - || DECL_INITIAL (DECL) == error_mark_node)) \ - { \ - if (TREE_PUBLIC (DECL) && DECL_NAME (DECL)) \ - (*targetm.asm_out.globalize_label) (STREAM, NAME); \ - \ - readonly_data_section (); \ - ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \ - mips_declare_object (STREAM, NAME, "", ":\n\t.space\t%u\n", \ - (SIZE)); \ - } \ - else \ - mips_declare_object (STREAM, NAME, "\n\t.comm\t", ",%u\n", \ - (SIZE)); \ - } while (0) - +#define ASM_OUTPUT_ALIGNED_DECL_COMMON mips_output_aligned_decl_common /* This says how to define a local common symbol (ie, not visible to linker). */ |