aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-10-14 04:23:52 +0000
committerRichard Stallman <rms@gnu.org>1992-10-14 04:23:52 +0000
commitcf99a7342ba1ddd483d19eaacc85d7ab12205258 (patch)
tree8d712f29ef5f442a02c4a0000e21215c57c2c4e6 /gcc
parent7124e1e508d5173fd696668531adb112e8a53f83 (diff)
downloadgcc-cf99a7342ba1ddd483d19eaacc85d7ab12205258.zip
gcc-cf99a7342ba1ddd483d19eaacc85d7ab12205258.tar.gz
gcc-cf99a7342ba1ddd483d19eaacc85d7ab12205258.tar.bz2
(reg_names): Make it static. Use DEBUG_REGISTER_NAMES if that's defined.
(DEBUG_PRINT_REG): Define if not defined. (print_rtx): Use DEBUG_PRINT_REG for hard regs. (reg_name): Moved here. From-SVN: r2451
Diffstat (limited to 'gcc')
-rw-r--r--gcc/print-rtl.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 90d65666..c77e61b 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -24,6 +24,22 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "rtl.h"
+/* How to print out a register name.
+ We don't use PRINT_REG because some definitions of PRINT_REG
+ don't work here. */
+#ifndef DEBUG_PRINT_REG
+#define DEBUG_PRINT_REG(RTX, CODE, FILE) \
+ fprintf ((FILE), "%d %s", REGNO (RTX), reg_names[REGNO (RTX)])
+#endif
+
+/* Array containing all of the register names */
+
+#ifdef DEBUG_REGISTER_NAMES
+static char *reg_names[] = DEBUG_REGISTER_NAMES;
+#else
+static char *reg_names[] = REGISTER_NAMES;
+#endif
+
static FILE *outfile;
char spaces[] = " ";
@@ -151,11 +167,21 @@ print_rtx (in_rtx)
break;
case 'i':
- fprintf (outfile, " %d", XINT (in_rtx, i));
+ {
+ register int value = XINT (in_rtx, i);
+
+ if (GET_CODE (in_rtx) == REG && value < FIRST_PSEUDO_REGISTER)
+ {
+ fputc (' ', outfile);
+ DEBUG_PRINT_REG (in_rtx, 0, outfile);
+ }
+ else
+ fprintf (outfile, " %d", value);
+ }
if (is_insn && &INSN_CODE (in_rtx) == &XINT (in_rtx, i)
&& insn_name_ptr
&& XINT (in_rtx, i) >= 0)
- fprintf (outfile, " {%s}", insn_name_ptr[XINT (in_rtx, i)]);
+ fprintf (outfile, " {%s}", insn_name_ptr[XINT (in_rtx, i)]);
sawclose = 0;
break;