diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-28 11:52:21 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-28 11:52:21 +0000 |
commit | 9c59a260b41a34898292805d51f044cb9d7e3291 (patch) | |
tree | 41d1d2dd42ef2333d76b891bc6b51cd493b91d02 /gcc/print-rtl.c | |
parent | 3087f4a7b6b7c04410243ec1bce5042ae61570de (diff) | |
download | gcc-9c59a260b41a34898292805d51f044cb9d7e3291.tar.gz |
* print-rtl.c (print_rtx): If RTX code is bad, just say so.
Also minor cleanups.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47408 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/print-rtl.c')
-rw-r--r-- | gcc/print-rtl.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index b62c698f677..3213a511926 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); |