aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-11-28 11:52:21 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-11-28 06:52:21 -0500
commit5e74f966b782e95c19bd5f40b8aa5bd05626f4bc (patch)
tree41d1d2dd42ef2333d76b891bc6b51cd493b91d02 /gcc
parentd2c35e6748325002d7db6efbf27dc0aa8fa7efa1 (diff)
downloadgcc-5e74f966b782e95c19bd5f40b8aa5bd05626f4bc.zip
gcc-5e74f966b782e95c19bd5f40b8aa5bd05626f4bc.tar.gz
gcc-5e74f966b782e95c19bd5f40b8aa5bd05626f4bc.tar.bz2
print-rtl.c (print_rtx): If RTX code is bad, just say so.
* print-rtl.c (print_rtx): If RTX code is bad, just say so. Also minor cleanups. From-SVN: r47408
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/print-rtl.c29
2 files changed, 22 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 35e0364..19efa9d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Wed Nov 28 08:21:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * print-rtl.c (print_rtx): If RTX code is bad, just say so.
+ Also minor cleanups.
+
Wed Nov 28 10:42:19 CET 2001 Jan Hubicka <jh@suse.cz>
* cse.c (true_dependence_in_rtx): New function.
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index b62c698..3213a51 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -94,8 +94,7 @@ print_rtx (in_rtx)
if (flag_simple)
fputc (' ', outfile);
else
- fprintf (outfile, "\n%s%*s",
- print_rtx_head, indent * 2, "");
+ fprintf (outfile, "\n%s%*s", print_rtx_head, indent * 2, "");
sawclose = 0;
}
@@ -105,21 +104,27 @@ print_rtx (in_rtx)
sawclose = 1;
return;
}
+ else if (GET_CODE (in_rtx) > NUM_RTX_CODE)
+ {
+ fprintf (outfile, "(??? bad code %d\n)", GET_CODE (in_rtx));
+ sawclose = 1;
+ return;
+ }
- is_insn = (INSN_P (in_rtx));
+ is_insn = INSN_P (in_rtx);
/* When printing in VCG format we write INSNs, NOTE, LABEL, and BARRIER
in separate nodes and therefore have to handle them special here. */
- if (dump_for_graph &&
- (is_insn || GET_CODE (in_rtx) == NOTE || GET_CODE (in_rtx) == CODE_LABEL
- || GET_CODE (in_rtx) == BARRIER))
+ if (dump_for_graph
+ && (is_insn || GET_CODE (in_rtx) == NOTE
+ || GET_CODE (in_rtx) == CODE_LABEL || GET_CODE (in_rtx) == BARRIER))
{
i = 3;
indent = 0;
}
else
{
- /* print name of expression code */
+ /* Print name of expression code. */
if (flag_simple && GET_CODE (in_rtx) == CONST_INT)
fputc ('(', outfile);
else
@@ -164,7 +169,6 @@ print_rtx (in_rtx)
/* Get the format string and skip the first elements if we have handled
them already. */
format_ptr = GET_RTX_FORMAT (GET_CODE (in_rtx)) + i;
-
for (; i < GET_RTX_LENGTH (GET_CODE (in_rtx)); i++)
switch (*format_ptr++)
{
@@ -310,8 +314,7 @@ print_rtx (in_rtx)
indent -= 2;
}
if (sawclose)
- fprintf (outfile, "\n%s%*s",
- print_rtx_head, indent * 2, "");
+ fprintf (outfile, "\n%s%*s", print_rtx_head, indent * 2, "");
fputs ("] ", outfile);
sawclose = 1;
@@ -510,7 +513,8 @@ print_rtx (in_rtx)
tem = XEXP (in_rtx, 1);
if (tem)
- fputs ("\n ])\n (const_string \"tail_call\") (sequence [", outfile);
+ fputs ("\n ])\n (const_string \"tail_call\") (sequence [",
+ outfile);
for (; tem != 0; tem = NEXT_INSN (tem))
{
fputs ("\n ", outfile);
@@ -519,7 +523,8 @@ print_rtx (in_rtx)
tem = XEXP (in_rtx, 2);
if (tem)
- fputs ("\n ])\n (const_string \"tail_recursion\") (sequence [", outfile);
+ fputs ("\n ])\n (const_string \"tail_recursion\") (sequence [",
+ outfile);
for (; tem != 0; tem = NEXT_INSN (tem))
{
fputs ("\n ", outfile);