OSDN Git Service

* emit-rtl.c (gen_reg_rtx): Also reallocate reg_decl array.
[pf3gnuchains/gcc-fork.git] / gcc / print-rtl.c
index aeae71e..3d78dd3 100644 (file)
@@ -2,27 +2,32 @@
    Copyright (C) 1987, 1988, 1992, 1997, 1998, 1999, 2000
    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"
 #include "rtl.h"
+
+/* We don't want the tree code checking code for the access to the
+   DECL_NAME to be included in the gen* programs.  */
+#undef ENABLE_TREE_CHECKING
+#include "tree.h"
 #include "real.h"
 #include "flags.h"
 #include "hard-reg-set.h"
@@ -47,8 +52,6 @@ const char * reg_names[] = REGISTER_NAMES;
 
 static FILE *outfile;
 
-static const char xspaces[] = "                                                                                                                                                                ";
-
 static int sawclose = 0;
 
 static int indent;
@@ -78,12 +81,12 @@ static int debug_call_placeholder_verbose;
 
 static void
 print_rtx (in_rtx)
-     register rtx in_rtx;
+     rtx in_rtx;
 {
-  register int i = 0;
-  register int j;
-  register const char *format_ptr;
-  register int is_insn;
+  int i = 0;
+  int j;
+  const char *format_ptr;
+  int is_insn;
   rtx tem;
 
   if (sawclose)
@@ -91,9 +94,8 @@ print_rtx (in_rtx)
       if (flag_simple)
        fputc (' ', outfile);
       else
-       fprintf (outfile, "\n%s%s",
-                print_rtx_head,
-                (xspaces + (sizeof xspaces - 1 - indent * 2)));
+       fprintf (outfile, "\n%s%*s",
+                print_rtx_head, indent * 2, "");
       sawclose = 0;
     }
 
@@ -166,16 +168,25 @@ print_rtx (in_rtx)
   for (; i < GET_RTX_LENGTH (GET_CODE (in_rtx)); i++)
     switch (*format_ptr++)
       {
+       const char *str;
+
+      case 'T':
+       str = XTMPL (in_rtx, i);
+       goto string;
+
       case 'S':
       case 's':
-       if (XSTR (in_rtx, i) == 0)
+       str = XSTR (in_rtx, i);
+      string:
+
+       if (str == 0)
          fputs (dump_for_graph ? " \\\"\\\"" : " \"\"", outfile);
        else
          {
            if (dump_for_graph)
-             fprintf (outfile, " (\\\"%s\\\")", XSTR (in_rtx, i));
+             fprintf (outfile, " (\\\"%s\\\")", str);
            else
-             fprintf (outfile, " (\"%s\")", XSTR (in_rtx, i));
+             fprintf (outfile, " (\"%s\")", str);
          }
        sawclose = 1;
        break;
@@ -282,9 +293,8 @@ print_rtx (in_rtx)
        indent += 2;
        if (sawclose)
          {
-           fprintf (outfile, "\n%s%s",
-                     print_rtx_head,
-                    (xspaces + (sizeof xspaces - 1 - indent * 2)));
+           fprintf (outfile, "\n%s%*s",
+                     print_rtx_head, indent * 2, "");
            sawclose = 0;
          }
        fputs ("[ ", outfile);
@@ -300,9 +310,8 @@ print_rtx (in_rtx)
            indent -= 2;
          }
        if (sawclose)
-         fprintf (outfile, "\n%s%s",
-                   print_rtx_head,
-                  (xspaces + (sizeof xspaces - 1 - indent * 2)));
+         fprintf (outfile, "\n%s%*s",
+                   print_rtx_head, indent * 2, "");
 
        fputs ("] ", outfile);
        sawclose = 1;
@@ -331,7 +340,7 @@ print_rtx (in_rtx)
          }
        else
          {
-           register int value = XINT (in_rtx, i);
+           int value = XINT (in_rtx, i);
            const char *name;
 
            if (GET_CODE (in_rtx) == REG && value < FIRST_PSEUDO_REGISTER)
@@ -442,8 +451,30 @@ print_rtx (in_rtx)
   switch (GET_CODE (in_rtx))
     {
     case MEM:
-      fputc (' ', outfile);
+      fputs (" [", outfile);
       fprintf (outfile, HOST_WIDE_INT_PRINT_DEC, MEM_ALIAS_SET (in_rtx));
+      if (MEM_DECL (in_rtx) && DECL_NAME (MEM_DECL (in_rtx)))
+       fprintf (outfile, " %s",
+                IDENTIFIER_POINTER (DECL_NAME (MEM_DECL (in_rtx))));
+
+      if (MEM_OFFSET (in_rtx))
+       {
+         fputc ('+', outfile);
+         fprintf (outfile, HOST_WIDE_INT_PRINT_DEC,
+                  INTVAL (MEM_OFFSET (in_rtx)));
+       }
+
+      if (MEM_SIZE (in_rtx))
+       {
+         fputs (" S", outfile);
+         fprintf (outfile, HOST_WIDE_INT_PRINT_DEC,
+                  INTVAL (MEM_SIZE (in_rtx)));
+       }
+
+      if (MEM_ALIGN (in_rtx) != 1)
+       fprintf (outfile, " A%u", MEM_ALIGN (in_rtx));
+
+      fputc (']', outfile);
       break;
 
 #if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT && MAX_LONG_DOUBLE_TYPE_SIZE == 64
@@ -635,7 +666,7 @@ print_rtl (outf, rtx_first)
      FILE *outf;
      rtx rtx_first;
 {
-  register rtx tmp_rtx;
+  rtx tmp_rtx;
 
   outfile = outf;
   sawclose = 0;