OSDN Git Service

* lib/old-dejagnu.exp (old-dejagnu): Copy extra source files
[pf3gnuchains/gcc-fork.git] / gcc / rtl.c
index 93cfb44..3e73e4b 100644 (file)
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -2,22 +2,22 @@
    Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
 
-This file is part of GNU CC.
+This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
 
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the 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, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+along with GCC; see the file COPYING.  If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.  */
 
 #include "config.h"
 #include "system.h"
@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA.  */
 /* Calculate the format for CONST_DOUBLE.  This depends on the relative
    widths of HOST_WIDE_INT and REAL_VALUE_TYPE.
 
-   We need to go out to e0wwwww, since REAL_ARITHMETIC assumes 16-bits
+   We need to go out to 0wwwww, since REAL_ARITHMETIC assumes 16-bits
    per element in REAL_VALUE_TYPE.
 
    This is duplicated in gengenrtl.c.
@@ -70,19 +70,19 @@ Boston, MA 02111-1307, USA.  */
 #endif /* REAL_WIDTH */
 
 #if REAL_WIDTH == 1
-# define CONST_DOUBLE_FORMAT   "e0ww"
+# define CONST_DOUBLE_FORMAT   "0ww"
 #else
 # if REAL_WIDTH == 2
-#  define CONST_DOUBLE_FORMAT  "e0ww"
+#  define CONST_DOUBLE_FORMAT  "0ww"
 # else
 #  if REAL_WIDTH == 3
-#   define CONST_DOUBLE_FORMAT "e0www"
+#   define CONST_DOUBLE_FORMAT "0www"
 #  else
 #   if REAL_WIDTH == 4
-#    define CONST_DOUBLE_FORMAT        "e0wwww"
+#    define CONST_DOUBLE_FORMAT        "0wwww"
 #   else
 #    if REAL_WIDTH == 5
-#     define CONST_DOUBLE_FORMAT       "e0wwwww"
+#     define CONST_DOUBLE_FORMAT       "0wwwww"
 #    else
 #     define CONST_DOUBLE_FORMAT       /* nothing - will cause syntax error */
 #    endif
@@ -239,7 +239,7 @@ const char * const rtx_format[] = {
      "u" a pointer to another insn
          prints the uid of the insn.
      "b" is a pointer to a bitmap header.
-     "t" is a tree pointer. */
+     "t" is a tree pointer.  */
 
 #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   FORMAT ,
 #include "rtl.def"             /* rtl expressions are defined here */
@@ -281,7 +281,8 @@ const char * const reg_note_name[] =
   "REG_EXEC_COUNT", "REG_NOALIAS", "REG_SAVE_AREA", "REG_BR_PRED",
   "REG_FRAME_RELATED_EXPR", "REG_EH_CONTEXT", "REG_EH_REGION",
   "REG_SAVE_NOTE", "REG_MAYBE_DEAD", "REG_NORETURN",
-  "REG_NON_LOCAL_GOTO", "REG_SETJMP", "REG_ALWAYS_RETURN"
+  "REG_NON_LOCAL_GOTO", "REG_SETJMP", "REG_ALWAYS_RETURN",
+  "REG_VTABLE_REF"
 };
 
 \f
@@ -330,12 +331,12 @@ rtx_alloc (code)
 
 rtx
 copy_rtx (orig)
-     register rtx orig;
+     rtx orig;
 {
-  register rtx copy;
-  register int i, j;
-  register RTX_CODE code;
-  register const char *format_ptr;
+  rtx copy;
+  int i, j;
+  RTX_CODE code;
+  const char *format_ptr;
 
   code = GET_CODE (orig);
 
@@ -435,13 +436,13 @@ copy_rtx (orig)
 
 rtx
 copy_most_rtx (orig, may_share)
-     register rtx orig;
-     register rtx may_share;
+     rtx orig;
+     rtx may_share;
 {
-  register rtx copy;
-  register int i, j;
-  register RTX_CODE code;
-  register const char *format_ptr;
+  rtx copy;
+  int i, j;
+  RTX_CODE code;
+  const char *format_ptr;
 
   if (orig == may_share)
     return orig;
@@ -518,7 +519,7 @@ copy_most_rtx (orig, may_share)
          break;
 
        case '0':
-         /* Copy this through the wide int field; that's safest. */
+         /* Copy this through the wide int field; that's safest.  */
          X0WINT (copy, i) = X0WINT (orig, i);
          break;
 
@@ -530,13 +531,14 @@ copy_most_rtx (orig, may_share)
 }
 
 /* Create a new copy of an rtx.  Only copy just one level.  */
+
 rtx
 shallow_copy_rtx (orig)
      rtx orig;
 {
-  register int i;
-  register RTX_CODE code = GET_CODE (orig);
-  register rtx copy = rtx_alloc (code);
+  int i;
+  RTX_CODE code = GET_CODE (orig);
+  rtx copy = rtx_alloc (code);
 
   PUT_MODE (copy, GET_MODE (orig));
   copy->in_struct = orig->in_struct;
@@ -550,6 +552,23 @@ shallow_copy_rtx (orig)
 
   return copy;
 }
+
+/* Return the alignment of MODE. This will be bounded by 1 and
+   BIGGEST_ALIGNMENT.  */
+
+unsigned int
+get_mode_alignment (mode)
+     enum machine_mode mode;
+{
+  unsigned int alignment = GET_MODE_UNIT_SIZE (mode);
+  
+  /* Extract the LSB of the size.  */
+  alignment = alignment & -alignment;
+  alignment *= BITS_PER_UNIT;
+
+  alignment = MIN (BIGGEST_ALIGNMENT, MAX (1, alignment));
+  return alignment;
+}
 \f
 /* This is 1 until after the rtl generation pass.  */
 int rtx_equal_function_value_matters;
@@ -564,10 +583,10 @@ int
 rtx_equal_p (x, y)
      rtx x, y;
 {
-  register int i;
-  register int j;
-  register enum rtx_code code;
-  register const char *fmt;
+  int i;
+  int j;
+  enum rtx_code code;
+  const char *fmt;
 
   if (x == y)
     return 1;
@@ -589,10 +608,11 @@ rtx_equal_p (x, y)
   switch (code)
     {
     case REG:
-      /* Until rtl generation is complete, don't consider a reference to the
-        return register of the current function the same as the return from a
-        called function.  This eases the job of function integration.  Once the
-        distinction is no longer needed, they can be considered equivalent.  */
+      /* Until rtl generation is complete, don't consider a reference
+        to the return register of the current function the same as
+        the return from a called function.  This eases the job of
+        function integration.  Once the distinction is no longer
+        needed, they can be considered equivalent.  */
       return (REGNO (x) == REGNO (y)
              && (! rtx_equal_function_value_matters
                  || REG_FUNCTION_VALUE_P (x) == REG_FUNCTION_VALUE_P (y)));