Commit c349e40b by Stephane Carrez Committed by Stephane Carrez

flags.h (flag_dump_rtl_in_asm): Declare.

	* flags.h (flag_dump_rtl_in_asm): Declare.
	* toplev.c (flag_dump_rtl_in_asm): Define.
	(decode_d_option): Set flag_dump_rtl_in_asm and flag_print_asm_name
	if -dP is specified.
	* rtl.h (print_rtx_head): Declare.
	* print-rtl.c (print_rtx_head): Define.
	(print_rtx): Print the string pointed to by print_rtx_head
	at beginning of each dump line.
	(print_rtl): Likewise.
	(print_rtl_single): Likewise.
	* final.c (final_scan_insn): Dump the insn in the assembly
	file for debugging.
	* gcc.1: Document -dP option.
	* invoke.texi (Debugging Options): Likewise.

From-SVN: r36394
parent 2856c3e3
2000-09-13 Stephane Carrez <Stephane.Carrez@worldnet.fr> 2000-09-13 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* flags.h (flag_dump_rtl_in_asm): Declare.
* toplev.c (flag_dump_rtl_in_asm): Define.
(decode_d_option): Set flag_dump_rtl_in_asm and flag_print_asm_name
if -dP is specified.
* rtl.h (print_rtx_head): Declare.
* print-rtl.c (print_rtx_head): Define.
(print_rtx): Print the string pointed to by print_rtx_head
at beginning of each dump line.
(print_rtl): Likewise.
(print_rtl_single): Likewise.
* final.c (final_scan_insn): Dump the insn in the assembly
file for debugging.
* gcc.1: Document -dP option.
* invoke.texi (Debugging Options): Likewise.
2000-09-13 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* md.texi (Machine Constraints): Document the 68HC11 constraints. * md.texi (Machine Constraints): Document the 68HC11 constraints.
* install.texi (Configurations): Document the 68HC11&68HC12 port. * install.texi (Configurations): Document the 68HC11&68HC12 port.
* invoke.texi (Option Summary, M68hc1x Options): Document the options. * invoke.texi (Option Summary, M68hc1x Options): Document the options.
......
...@@ -2922,6 +2922,14 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -2922,6 +2922,14 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
extract_insn (insn); extract_insn (insn);
cleanup_subreg_operands (insn); cleanup_subreg_operands (insn);
/* Dump the insn in the assembly for debugging. */
if (flag_dump_rtl_in_asm)
{
print_rtx_head = ASM_COMMENT_START;
print_rtl_single (asm_out_file, insn);
print_rtx_head = "";
}
if (! constrain_operands (1)) if (! constrain_operands (1))
fatal_insn_not_found (insn); fatal_insn_not_found (insn);
......
...@@ -474,6 +474,8 @@ extern int flag_verbose_asm; ...@@ -474,6 +474,8 @@ extern int flag_verbose_asm;
extern int flag_debug_asm; extern int flag_debug_asm;
extern int flag_dump_rtl_in_asm;
/* -fgnu-linker specifies use of the GNU linker for initializations. /* -fgnu-linker specifies use of the GNU linker for initializations.
-fno-gnu-linker says that collect will be used. */ -fno-gnu-linker says that collect will be used. */
extern int flag_gnu_linker; extern int flag_gnu_linker;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
.if n .sp .if n .sp
.if t .sp 0.4 .if t .sp 0.4
.. ..
.Id $Id: gcc.1,v 1.15 2000/05/17 08:15:25 cagney Exp $ .Id $Id: gcc.1,v 1.16 2000/09/11 06:10:30 ciceron Exp $
.TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools" .TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools"
.SH NAME .SH NAME
gcc, g++ \- GNU project C and C++ Compiler (gcc-2.96) gcc, g++ \- GNU project C and C++ Compiler (gcc-2.96)
...@@ -2311,6 +2311,12 @@ standard error. ...@@ -2311,6 +2311,12 @@ standard error.
Annotate the assembler output with a comment indicating which Annotate the assembler output with a comment indicating which
pattern and alternative was used. pattern and alternative was used.
.TP .TP
.B \-dP
Dump the RTL in the assembler output as a comment before each instruction.
Also turns on
.B \-dp
annotation.
.TP
.B \-fpretend\-float .B \-fpretend\-float
When running a cross-compiler, pretend that the target machine uses the When running a cross-compiler, pretend that the target machine uses the
same floating point format as the host machine. This causes incorrect same floating point format as the host machine. This causes incorrect
......
...@@ -55,6 +55,11 @@ static int indent; ...@@ -55,6 +55,11 @@ static int indent;
static void print_rtx PARAMS ((rtx)); static void print_rtx PARAMS ((rtx));
/* String printed at beginning of each RTL when it is dumped.
This string is set to ASM_COMMENT_START when the RTL is dumped in
the assembly output file. */
char *print_rtx_head = "";
/* Nonzero means suppress output of instruction numbers and line number /* Nonzero means suppress output of instruction numbers and line number
notes in debugging dumps. notes in debugging dumps.
This must be defined here so that programs like gencodes can be linked. */ This must be defined here so that programs like gencodes can be linked. */
...@@ -80,8 +85,9 @@ print_rtx (in_rtx) ...@@ -80,8 +85,9 @@ print_rtx (in_rtx)
if (sawclose) if (sawclose)
{ {
fprintf (outfile, "\n%s", fprintf (outfile, "\n%s%s",
(xspaces + (sizeof xspaces - 1 - indent * 2))); print_rtx_head,
(xspaces + (sizeof xspaces - 1 - indent * 2)));
sawclose = 0; sawclose = 0;
} }
...@@ -256,7 +262,8 @@ print_rtx (in_rtx) ...@@ -256,7 +262,8 @@ print_rtx (in_rtx)
indent += 2; indent += 2;
if (sawclose) if (sawclose)
{ {
fprintf (outfile, "\n%s", fprintf (outfile, "\n%s%s",
print_rtx_head,
(xspaces + (sizeof xspaces - 1 - indent * 2))); (xspaces + (sizeof xspaces - 1 - indent * 2)));
sawclose = 0; sawclose = 0;
} }
...@@ -273,7 +280,8 @@ print_rtx (in_rtx) ...@@ -273,7 +280,8 @@ print_rtx (in_rtx)
indent -= 2; indent -= 2;
} }
if (sawclose) if (sawclose)
fprintf (outfile, "\n%s", fprintf (outfile, "\n%s%s",
print_rtx_head,
(xspaces + (sizeof xspaces - 1 - indent * 2))); (xspaces + (sizeof xspaces - 1 - indent * 2)));
fputs ("] ", outfile); fputs ("] ", outfile);
...@@ -600,7 +608,10 @@ print_rtl (outf, rtx_first) ...@@ -600,7 +608,10 @@ print_rtl (outf, rtx_first)
sawclose = 0; sawclose = 0;
if (rtx_first == 0) if (rtx_first == 0)
fputs ("(nil)\n", outf); {
fputs (print_rtx_head, outf);
fputs ("(nil)\n", outf);
}
else else
switch (GET_CODE (rtx_first)) switch (GET_CODE (rtx_first))
{ {
...@@ -614,12 +625,14 @@ print_rtl (outf, rtx_first) ...@@ -614,12 +625,14 @@ print_rtl (outf, rtx_first)
if (! flag_dump_unnumbered if (! flag_dump_unnumbered
|| GET_CODE (tmp_rtx) != NOTE || NOTE_LINE_NUMBER (tmp_rtx) < 0) || GET_CODE (tmp_rtx) != NOTE || NOTE_LINE_NUMBER (tmp_rtx) < 0)
{ {
fputs (print_rtx_head, outfile);
print_rtx (tmp_rtx); print_rtx (tmp_rtx);
fprintf (outfile, "\n"); fprintf (outfile, "\n");
} }
break; break;
default: default:
fputs (print_rtx_head, outfile);
print_rtx (rtx_first); print_rtx (rtx_first);
} }
} }
...@@ -637,6 +650,7 @@ print_rtl_single (outf, x) ...@@ -637,6 +650,7 @@ print_rtl_single (outf, x)
if (! flag_dump_unnumbered if (! flag_dump_unnumbered
|| GET_CODE (x) != NOTE || NOTE_LINE_NUMBER (x) < 0) || GET_CODE (x) != NOTE || NOTE_LINE_NUMBER (x) < 0)
{ {
fputs (print_rtx_head, outfile);
print_rtx (x); print_rtx (x);
putc ('\n', outf); putc ('\n', outf);
return 1; return 1;
......
...@@ -1747,6 +1747,7 @@ extern void schedule_insns PARAMS ((FILE *)); ...@@ -1747,6 +1747,7 @@ extern void schedule_insns PARAMS ((FILE *));
extern void fix_sched_param PARAMS ((const char *, const char *)); extern void fix_sched_param PARAMS ((const char *, const char *));
/* In print-rtl.c */ /* In print-rtl.c */
extern char *print_rtx_head;
extern void debug_rtx PARAMS ((rtx)); extern void debug_rtx PARAMS ((rtx));
extern void debug_rtx_list PARAMS ((rtx, int)); extern void debug_rtx_list PARAMS ((rtx, int));
extern void debug_rtx_range PARAMS ((rtx, rtx)); extern void debug_rtx_range PARAMS ((rtx, rtx));
......
...@@ -795,6 +795,10 @@ int flag_verbose_asm = 0; ...@@ -795,6 +795,10 @@ int flag_verbose_asm = 0;
int flag_debug_asm = 0; int flag_debug_asm = 0;
/* -dP causes the rtl to be emitted as a comment in assembly. */
int flag_dump_rtl_in_asm = 0;
/* -fgnu-linker specifies use of the GNU linker for initializations. /* -fgnu-linker specifies use of the GNU linker for initializations.
(Or, more generally, a linker that handles initializations.) (Or, more generally, a linker that handles initializations.)
-fno-gnu-linker says that collect2 will be used. */ -fno-gnu-linker says that collect2 will be used. */
...@@ -3970,6 +3974,10 @@ decode_d_option (arg) ...@@ -3970,6 +3974,10 @@ decode_d_option (arg)
case 'p': case 'p':
flag_print_asm_name = 1; flag_print_asm_name = 1;
break; break;
case 'P':
flag_dump_rtl_in_asm = 1;
flag_print_asm_name = 1;
break;
case 'v': case 'v':
graph_dump_format = vcg; graph_dump_format = vcg;
break; break;
......
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