]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR bootstrap/13617 (IRIX 6.5 Ada bootstrap failure with GNU as 2.14.90)
authorSergey M. Samoylov <ssamoylov@dev.rtsoft.ru>
Sat, 8 Jan 2005 14:33:34 +0000 (14:33 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 8 Jan 2005 14:33:34 +0000 (14:33 +0000)
Backport:
2004-02-12  Richard Sandiford  <rsandifo@redhat.com>
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: r93084

gcc/ChangeLog
gcc/config/mips/mips-protos.h
gcc/config/mips/mips.c
gcc/config/mips/mips.h

index e7f3703c44600877f30823f7668137da388be5d2..b05b45708911c6bfb845a6c7c0430f7c7559a676 100644 (file)
@@ -1,3 +1,15 @@
+2005-01-08  Sergey M. Samoylov  <ssamoylov@dev.rtsoft.ru>
+
+       Backport:
+       2004-02-12  Richard Sandiford  <rsandifo@redhat.com>
+       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.
+
 2005-01-08  Richard Sandiford  <rsandifo@redhat.com>
 
        PR target/17565
index f7ec8183ed0daae32d52918b200ebe5662ae697b..f5cc947014b5838baf47d3b110e7c401a4306e5d 100644 (file)
@@ -1,6 +1,6 @@
 /* Prototypes of target machine for GNU compiler.  MIPS version.
    Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2001, 2002 Free Software Foundation, Inc.
+   1999, 2001, 2002, 2005 Free Software Foundation, Inc.
    Contributed by A. Lichnewsky (lich@inria.inria.fr).
    Changed by Michael Meissner (meissner@osf.org).
    64 bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and
@@ -36,9 +36,13 @@ extern void          iris6_asm_output_align PARAMS ((FILE *, unsigned));
 extern const char *    current_section_name PARAMS ((void));
 extern unsigned int    current_section_flags PARAMS ((void));
 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_output_aligned_decl_common
+                               PARAMS ((FILE *, tree, const char *,
+                                        unsigned HOST_WIDE_INT,
+                                        unsigned int));
+extern void            mips_declare_object
+                               PARAMS ((FILE *, const char *, const char *,
+                                        const char *, ...));
 extern void            mips_expand_epilogue PARAMS ((void));
 extern void            mips_expand_prologue PARAMS ((void));
 extern void            mips_output_filename PARAMS ((FILE *, const char *));
index 44024f2e8136587d732e4c409ee0adfd49e0af3f..cfc304a6cc24472e77d57e3cf61f5d425df9ebb3 100644 (file)
@@ -1,6 +1,6 @@
 /* Subroutines for insn-output.c for MIPS
    Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
    Contributed by A. Lichnewsky, lich@inria.inria.fr.
    Changes by Michael Meissner, meissner@osf.org.
    64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and
@@ -6562,26 +6562,84 @@ copy_file_data (to, from)
     fatal_io_error ("can't close temp file");
 }
 
-/* Emit either a label, .comm, or .lcomm directive, and mark that the symbol
-   is used, so that we don't emit an .extern for it in mips_asm_file_end.  */
+/* 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_declare_object (stream, name, init_string, final_string, size)
+mips_output_aligned_decl_common (stream, decl, name, size, align)
      FILE *stream;
+     tree decl;
      const char *name;
-     const char *init_string;
-     const char *final_string;
-     int size;
+     unsigned HOST_WIDE_INT size;
+     unsigned int align;
 {
-  fputs (init_string, stream);         /* "", "\t.comm\t", or "\t.lcomm\t" */
+  const char *format;
+
+  /* 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));
+
+      format = ACONCAT ((":\n\t.space\t", HOST_WIDE_INT_PRINT_UNSIGNED,
+                        "\n", NULL));
+      mips_declare_object (stream, name, "", format, size);
+    }
+#ifdef TARGET_IRIX6
+    /* The SGI o32 assembler doesn't accept an alignment, so round up
+       the size instead.  */
+  else if (mips_abi == ABI_32 && !TARGET_GAS)
+    {
+      size += (align / BITS_PER_UNIT) - 1;
+      size -= size % (align / BITS_PER_UNIT);
+      format = ACONCAT ((",", HOST_WIDE_INT_PRINT_UNSIGNED, "\n", NULL));
+      mips_declare_object (stream, name, "\n\t.comm\t", format, size);
+    }
+#endif
+  else
+    {
+      format = ACONCAT ((",", HOST_WIDE_INT_PRINT_UNSIGNED, ",%u\n", NULL));
+      mips_declare_object (stream, name, "\n\t.comm\t", format,
+                          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.  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 VPARAMS ((FILE *stream, const char *name,
+                             const char *init_string,
+                             const char *final_string, ...))
+{
+  VA_OPEN (ap, final_string);
+  VA_FIXEDARG (ap, FILE *, stream);
+  VA_FIXEDARG (ap, const char *, name);
+  VA_FIXEDARG (ap, const char *, init_string);
+  VA_FIXEDARG (ap, const char *, final_string);
+
+  fputs (init_string, stream);
   assemble_name (stream, name);
-  fprintf (stream, final_string, size);        /* ":\n", ",%u\n", ",%u\n" */
+  vfprintf (stream, final_string, ap);
 
   if (TARGET_GP_OPT)
     {
       tree name_tree = get_identifier (name);
       TREE_ASM_WRITTEN (name_tree) = 1;
     }
+
+  VA_CLOSE (ap);
 }
 \f
 /* Return the bytes needed to compute the frame pointer from the current
index 0de8bbf703aa9423ee88e73489f0126b10471002..ad05be588c36949f02223ff2791eadb9f28e8d3a 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler.  MIPS version.
    Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
-   1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
    Contributed by A. Lichnewsky (lich@inria.inria.fr).
    Changed by Michael Meissner (meissner@osf.org).
    64 bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and
@@ -4326,28 +4326,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).  */