Commit 5e74f966 by Richard Kenner Committed by Richard Kenner

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
parent d2c35e67
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> Wed Nov 28 10:42:19 CET 2001 Jan Hubicka <jh@suse.cz>
* cse.c (true_dependence_in_rtx): New function. * cse.c (true_dependence_in_rtx): New function.
......
...@@ -94,8 +94,7 @@ print_rtx (in_rtx) ...@@ -94,8 +94,7 @@ print_rtx (in_rtx)
if (flag_simple) if (flag_simple)
fputc (' ', outfile); fputc (' ', outfile);
else else
fprintf (outfile, "\n%s%*s", fprintf (outfile, "\n%s%*s", print_rtx_head, indent * 2, "");
print_rtx_head, indent * 2, "");
sawclose = 0; sawclose = 0;
} }
...@@ -105,21 +104,27 @@ print_rtx (in_rtx) ...@@ -105,21 +104,27 @@ print_rtx (in_rtx)
sawclose = 1; sawclose = 1;
return; 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 /* When printing in VCG format we write INSNs, NOTE, LABEL, and BARRIER
in separate nodes and therefore have to handle them special here. */ in separate nodes and therefore have to handle them special here. */
if (dump_for_graph && if (dump_for_graph
(is_insn || GET_CODE (in_rtx) == NOTE || GET_CODE (in_rtx) == CODE_LABEL && (is_insn || GET_CODE (in_rtx) == NOTE
|| GET_CODE (in_rtx) == BARRIER)) || GET_CODE (in_rtx) == CODE_LABEL || GET_CODE (in_rtx) == BARRIER))
{ {
i = 3; i = 3;
indent = 0; indent = 0;
} }
else else
{ {
/* print name of expression code */ /* Print name of expression code. */
if (flag_simple && GET_CODE (in_rtx) == CONST_INT) if (flag_simple && GET_CODE (in_rtx) == CONST_INT)
fputc ('(', outfile); fputc ('(', outfile);
else else
...@@ -164,7 +169,6 @@ print_rtx (in_rtx) ...@@ -164,7 +169,6 @@ print_rtx (in_rtx)
/* Get the format string and skip the first elements if we have handled /* Get the format string and skip the first elements if we have handled
them already. */ them already. */
format_ptr = GET_RTX_FORMAT (GET_CODE (in_rtx)) + i; format_ptr = GET_RTX_FORMAT (GET_CODE (in_rtx)) + i;
for (; i < GET_RTX_LENGTH (GET_CODE (in_rtx)); i++) for (; i < GET_RTX_LENGTH (GET_CODE (in_rtx)); i++)
switch (*format_ptr++) switch (*format_ptr++)
{ {
...@@ -310,8 +314,7 @@ print_rtx (in_rtx) ...@@ -310,8 +314,7 @@ print_rtx (in_rtx)
indent -= 2; indent -= 2;
} }
if (sawclose) if (sawclose)
fprintf (outfile, "\n%s%*s", fprintf (outfile, "\n%s%*s", print_rtx_head, indent * 2, "");
print_rtx_head, indent * 2, "");
fputs ("] ", outfile); fputs ("] ", outfile);
sawclose = 1; sawclose = 1;
...@@ -510,7 +513,8 @@ print_rtx (in_rtx) ...@@ -510,7 +513,8 @@ print_rtx (in_rtx)
tem = XEXP (in_rtx, 1); tem = XEXP (in_rtx, 1);
if (tem) 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)) for (; tem != 0; tem = NEXT_INSN (tem))
{ {
fputs ("\n ", outfile); fputs ("\n ", outfile);
...@@ -519,7 +523,8 @@ print_rtx (in_rtx) ...@@ -519,7 +523,8 @@ print_rtx (in_rtx)
tem = XEXP (in_rtx, 2); tem = XEXP (in_rtx, 2);
if (tem) 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)) for (; tem != 0; tem = NEXT_INSN (tem))
{ {
fputs ("\n ", outfile); fputs ("\n ", outfile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment