OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / config / vax / vax.c
index e43b306..38c86f0 100644 (file)
@@ -1,5 +1,6 @@
 /* Subroutines for insn-output.c for Vax.
-   Copyright (C) 1987, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1987, 1994, 1995, 1997, 1998, 1999, 2000
+   Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -15,10 +16,11 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
-#include <stdio.h>
 #include "config.h"
+#include "system.h"
 #include "rtl.h"
 #include "regs.h"
 #include "hard-reg-set.h"
@@ -26,18 +28,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "insn-config.h"
 #include "conditions.h"
 #include "insn-flags.h"
+#include "function.h"
 #include "output.h"
 #include "insn-attr.h"
-#ifdef VMS
+#ifdef VMS_TARGET
 #include "tree.h"
 #endif
+#include "tm_p.h"
 
 /* This is like nonimmediate_operand with a restriction on the type of MEM.  */
 
 void
 split_quadword_operands (operands, low, n)
      rtx *operands, *low;
-     int n;
+     int n ATTRIBUTE_UNUSED;
 {
   int i;
   /* Split operands.  */
@@ -51,11 +55,11 @@ split_quadword_operands (operands, low, n)
               && (GET_CODE (XEXP (operands[i], 0)) == POST_INC))
        {
          rtx addr = XEXP (operands[i], 0);
-         operands[i] = low[i] = gen_rtx (MEM, SImode, addr);
+         operands[i] = low[i] = gen_rtx_MEM (SImode, addr);
          if (which_alternative == 0 && i == 0)
            {
              addr = XEXP (operands[i], 0);
-             operands[i+1] = low[i+1] = gen_rtx (MEM, SImode, addr);
+             operands[i+1] = low[i+1] = gen_rtx_MEM (SImode, addr);
            }
        }
       else
@@ -66,11 +70,12 @@ split_quadword_operands (operands, low, n)
     }
 }
 \f
+void
 print_operand_address (file, addr)
      FILE *file;
      register rtx addr;
 {
-  register rtx reg1, reg2, breg, ireg;
+  register rtx reg1, breg, ireg;
   rtx offset;
 
  retry:
@@ -248,7 +253,7 @@ print_operand_address (file, addr)
     }
 }
 \f
-char *
+const char *
 rev_cond_name (op)
      rtx op;
 {
@@ -285,8 +290,10 @@ vax_float_literal(c)
     register rtx c;
 {
   register enum machine_mode mode;
+#if HOST_FLOAT_FORMAT == VAX_FLOAT_FORMAT
   int i;
   union {double d; int i[2];} val;
+#endif
 
   if (GET_CODE (c) != CONST_DOUBLE)
     return 0;
@@ -322,7 +329,8 @@ vax_float_literal(c)
    2 - indirect */
 
 
-int vax_address_cost(addr)
+int
+vax_address_cost (addr)
     register rtx addr;
 {
   int reg = 0, indexed = 0, indir = 0, offset = 0, predec = 0;
@@ -364,6 +372,8 @@ int vax_address_cost(addr)
       indir = 2;       /* 3 on VAX 2 */
       addr = XEXP (addr, 0);
       goto restart;
+    default:
+      break;
     }
 
   /* Up to 3 things can be added in an address.  They are stored in
@@ -401,7 +411,7 @@ vax_rtx_cost (x)
   enum machine_mode mode = GET_MODE (x);
   register int c;
   int i = 0;                           /* may be modified in switch */
-  char *fmt = GET_RTX_FORMAT (code);   /* may be modified in switch */
+  const char *fmt = GET_RTX_FORMAT (code); /* may be modified in switch */
 
   switch (code)
     {
@@ -426,6 +436,8 @@ vax_rtx_cost (x)
        case QImode:
          c = 10;               /* 3-4 on VAX 9000, 20-28 on VAX 2 */
          break;
+       default:
+         break;
        }
       break;
     case UDIV:
@@ -581,7 +593,7 @@ vax_rtx_cost (x)
 
 /* Check a `double' value for validity for a particular machine mode.  */
 
-static char *float_strings[] =
+static const char *const float_strings[] =
 {
    "1.70141173319264430e+38", /* 2^127 (2^24 - 1) / 2^24 */
   "-1.70141173319264430e+38",
@@ -613,34 +625,36 @@ check_float_value (mode, d, overflow)
 
   if (overflow)
     {
-      bcopy (&float_values[0], d, sizeof (REAL_VALUE_TYPE));
+      bcopy ((char *) &float_values[0], (char *) d, sizeof (REAL_VALUE_TYPE));
       return 1;
     }
 
   if ((mode) == SFmode)
     {
       REAL_VALUE_TYPE r;
-      bcopy (d, &r, sizeof (REAL_VALUE_TYPE));
+      memcpy (&r, d, sizeof (REAL_VALUE_TYPE));
       if (REAL_VALUES_LESS (float_values[0], r))
        {
-         bcopy (&float_values[0], d, sizeof (REAL_VALUE_TYPE));
+         bcopy ((char *) &float_values[0], (char *) d,
+                sizeof (REAL_VALUE_TYPE));
          return 1;
        }
       else if (REAL_VALUES_LESS (r, float_values[1]))
        {
-         bcopy (&float_values[1], d, sizeof (REAL_VALUE_TYPE));
+         bcopy ((char *) &float_values[1], (char*) d,
+                sizeof (REAL_VALUE_TYPE));
          return 1;
        }
       else if (REAL_VALUES_LESS (dconst0, r)
                && REAL_VALUES_LESS (r, float_values[2]))
        {
-         bcopy (&dconst0, d, sizeof (REAL_VALUE_TYPE));
+         bcopy ((char *) &dconst0, (char *) d, sizeof (REAL_VALUE_TYPE));
          return 1;
        }
       else if (REAL_VALUES_LESS (r, dconst0)
                && REAL_VALUES_LESS (float_values[3], r))
        {
-         bcopy (&dconst0, d, sizeof (REAL_VALUE_TYPE));
+         bcopy ((char *) &dconst0, (char *) d, sizeof (REAL_VALUE_TYPE));
          return 1;
        }
     }
@@ -648,7 +662,8 @@ check_float_value (mode, d, overflow)
   return 0;
 }
 \f
-#ifdef VMS
+#ifdef VMS_TARGET
+/* Additional support code for VMS target. */
 
 /* Linked list of all externals that are to be emitted when optimizing
    for the global pointer if they haven't been declared by the end of
@@ -657,18 +672,18 @@ check_float_value (mode, d, overflow)
 static
 struct extern_list {
   struct extern_list *next;    /* next external */
-  char *name;                  /* name of the external */
+  const char *name;            /* name of the external */
   int size;                    /* external's actual size */
-  int in_const;                /* section type flag */
+  int in_const;                        /* section type flag */
 } *extern_head = 0, *pending_head = 0;
 
 /* Check whether NAME is already on the external definition list.  If not,
-   Add it to either that list of the pending definition list.  */
+   add it to either that list or the pending definition list.  */
 
 void
 vms_check_external (decl, name, pending)
      tree decl;
-     char *name;
+     const char *name;
      int pending;
 {
   register struct extern_list *p, *p0;
@@ -683,9 +698,9 @@ vms_check_external (decl, name, pending)
        if (pending)
          return;
 
-       /* Was pending, but may now be defined; move it to other list.  */
+       /* Was pending, but has now been defined; move it to other list.  */
        if (p == pending_head)
-         pending_head = 0;
+         pending_head = p->next;
        else
          p0->next = p->next;
        p->next = extern_head;
@@ -743,8 +758,10 @@ vms_flush_pending_externals (file)
       fprintf (file, ",%d\n", p->size);
     }
 }
+#endif /* VMS_TARGET */
 \f
-/* Additional support code for VMS. */
+#ifdef VMS
+/* Additional support code for VMS host. */
 
 #ifdef QSORT_WORKAROUND
   /*
@@ -804,9 +821,6 @@ not_qsort (array, count, size, compare)
     }
   else  /* arbitrary size */
     {
-#ifdef USE_C_ALLOCA
-      extern void *alloca ();
-#endif
       register int i;
       register char *next, *prev, *tmp = alloca (size), *base = array;