This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix -dP
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 25 Nov 2009 07:22:29 -0500
- Subject: [PATCH] Fix -dP
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
http://gcc.gnu.org/ml/gcc-patches/2009-09/msg00757.html
caused a regression, where -dP compiled code usually won't assemble.
E.g. gas complains about:
#(jump_insn 306 159 307 (set (pc)
# (label_ref 169)) 634 {jump} (nil)
-> 169)
Whenever printing newline and something after it, we need to append
print_rtx_head after the newline...
Ok for trunk?
2009-11-25 Jakub Jelinek <jakub@redhat.com>
* print-rtl.c (print_rtx): When printing newline, append
print_rtx_head and indentation after the newline.
--- gcc/print-rtl.c.jj 2009-11-04 08:16:04.000000000 +0100
+++ gcc/print-rtl.c 2009-11-25 13:10:17.000000000 +0100
@@ -109,7 +109,8 @@ print_rtx (const_rtx in_rtx)
}
else if (GET_CODE (in_rtx) > NUM_RTX_CODE)
{
- fprintf (outfile, "(??? bad code %d\n)", GET_CODE (in_rtx));
+ fprintf (outfile, "(??? bad code %d\n%s%*s)", GET_CODE (in_rtx),
+ print_rtx_head, indent * 2, "");
sawclose = 1;
return;
}
@@ -307,7 +308,8 @@ print_rtx (const_rtx in_rtx)
}
else if (i == 8 && JUMP_P (in_rtx) && JUMP_LABEL (in_rtx) != NULL)
/* Output the JUMP_LABEL reference. */
- fprintf (outfile, "\n -> %d", INSN_UID (JUMP_LABEL (in_rtx)));
+ fprintf (outfile, "\n%s%*s -> %d", print_rtx_head, indent * 2, "",
+ INSN_UID (JUMP_LABEL (in_rtx)));
else if (i == 0 && GET_CODE (in_rtx) == VALUE)
{
#ifndef GENERATOR_FILE
Jakub