Merge basic-improvements-branch to trunk
[gcc.git] / gcc / print-rtl.c
1 /* Print RTL for GNU C Compiler.
2 Copyright (C) 1987, 1988, 1992, 1997, 1998, 1999, 2000
3 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
21
22
23 #include "config.h"
24 #include "system.h"
25 #include "coretypes.h"
26 #include "tm.h"
27 #include "rtl.h"
28
29 /* We don't want the tree code checking code for the access to the
30 DECL_NAME to be included in the gen* programs. */
31 #undef ENABLE_TREE_CHECKING
32 #include "tree.h"
33 #include "real.h"
34 #include "flags.h"
35 #include "hard-reg-set.h"
36 #include "basic-block.h"
37
38 /* How to print out a register name.
39 We don't use PRINT_REG because some definitions of PRINT_REG
40 don't work here. */
41 #ifndef DEBUG_PRINT_REG
42 #define DEBUG_PRINT_REG(RTX, CODE, FILE) \
43 fprintf ((FILE), "%d %s", REGNO (RTX), reg_names[REGNO (RTX)])
44 #endif
45
46 /* Array containing all of the register names */
47
48 #ifdef DEBUG_REGISTER_NAMES
49 static const char * const debug_reg_names[] = DEBUG_REGISTER_NAMES;
50 #define reg_names debug_reg_names
51 #else
52 const char * reg_names[] = REGISTER_NAMES;
53 #endif
54
55 static FILE *outfile;
56
57 static int sawclose = 0;
58
59 static int indent;
60
61 static void print_rtx PARAMS ((rtx));
62
63 /* String printed at beginning of each RTL when it is dumped.
64 This string is set to ASM_COMMENT_START when the RTL is dumped in
65 the assembly output file. */
66 const char *print_rtx_head = "";
67
68 /* Nonzero means suppress output of instruction numbers and line number
69 notes in debugging dumps.
70 This must be defined here so that programs like gencodes can be linked. */
71 int flag_dump_unnumbered = 0;
72
73 /* Nonzero means use simplified format without flags, modes, etc. */
74 int flag_simple = 0;
75
76 /* Nonzero if we are dumping graphical description. */
77 int dump_for_graph;
78
79 /* Nonzero to dump all call_placeholder alternatives. */
80 static int debug_call_placeholder_verbose;
81
82 void
83 print_mem_expr (outfile, expr)
84 FILE *outfile;
85 tree expr;
86 {
87 if (TREE_CODE (expr) == COMPONENT_REF)
88 {
89 if (TREE_OPERAND (expr, 0))
90 print_mem_expr (outfile, TREE_OPERAND (expr, 0));
91 else
92 fputs (" <variable>", outfile);
93 if (DECL_NAME (TREE_OPERAND (expr, 1)))
94 fprintf (outfile, ".%s",
95 IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (expr, 1))));
96 }
97 else if (TREE_CODE (expr) == INDIRECT_REF)
98 {
99 fputs (" (*", outfile);
100 print_mem_expr (outfile, TREE_OPERAND (expr, 0));
101 fputs (")", outfile);
102 }
103 else if (DECL_NAME (expr))
104 fprintf (outfile, " %s", IDENTIFIER_POINTER (DECL_NAME (expr)));
105 else if (TREE_CODE (expr) == RESULT_DECL)
106 fputs (" <result>", outfile);
107 else
108 fputs (" <anonymous>", outfile);
109 }
110
111 /* Print IN_RTX onto OUTFILE. This is the recursive part of printing. */
112
113 static void
114 print_rtx (in_rtx)
115 rtx in_rtx;
116 {
117 int i = 0;
118 int j;
119 const char *format_ptr;
120 int is_insn;
121 rtx tem;
122
123 if (sawclose)
124 {
125 if (flag_simple)
126 fputc (' ', outfile);
127 else
128 fprintf (outfile, "\n%s%*s", print_rtx_head, indent * 2, "");
129 sawclose = 0;
130 }
131
132 if (in_rtx == 0)
133 {
134 fputs ("(nil)", outfile);
135 sawclose = 1;
136 return;
137 }
138 else if (GET_CODE (in_rtx) > NUM_RTX_CODE)
139 {
140 fprintf (outfile, "(??? bad code %d\n)", GET_CODE (in_rtx));
141 sawclose = 1;
142 return;
143 }
144
145 is_insn = INSN_P (in_rtx);
146
147 /* When printing in VCG format we write INSNs, NOTE, LABEL, and BARRIER
148 in separate nodes and therefore have to handle them special here. */
149 if (dump_for_graph
150 && (is_insn || GET_CODE (in_rtx) == NOTE
151 || GET_CODE (in_rtx) == CODE_LABEL || GET_CODE (in_rtx) == BARRIER))
152 {
153 i = 3;
154 indent = 0;
155 }
156 else
157 {
158 /* Print name of expression code. */
159 if (flag_simple && GET_CODE (in_rtx) == CONST_INT)
160 fputc ('(', outfile);
161 else
162 fprintf (outfile, "(%s", GET_RTX_NAME (GET_CODE (in_rtx)));
163
164 if (! flag_simple)
165 {
166 if (RTX_FLAG (in_rtx, in_struct))
167 fputs ("/s", outfile);
168
169 if (RTX_FLAG (in_rtx, volatil))
170 fputs ("/v", outfile);
171
172 if (RTX_FLAG (in_rtx, unchanging))
173 fputs ("/u", outfile);
174
175 if (RTX_FLAG (in_rtx, integrated))
176 fputs ("/i", outfile);
177
178 if (RTX_FLAG (in_rtx, frame_related))
179 fputs ("/f", outfile);
180
181 if (RTX_FLAG (in_rtx, jump))
182 fputs ("/j", outfile);
183
184 if (RTX_FLAG (in_rtx, call))
185 fputs ("/c", outfile);
186
187 if (GET_MODE (in_rtx) != VOIDmode)
188 {
189 /* Print REG_NOTE names for EXPR_LIST and INSN_LIST. */
190 if (GET_CODE (in_rtx) == EXPR_LIST
191 || GET_CODE (in_rtx) == INSN_LIST)
192 fprintf (outfile, ":%s",
193 GET_REG_NOTE_NAME (GET_MODE (in_rtx)));
194 else
195 fprintf (outfile, ":%s", GET_MODE_NAME (GET_MODE (in_rtx)));
196 }
197 }
198 }
199
200 #ifndef GENERATOR_FILE
201 if (GET_CODE (in_rtx) == CONST_DOUBLE && FLOAT_MODE_P (GET_MODE (in_rtx)))
202 i = 5;
203 #endif
204
205 /* Get the format string and skip the first elements if we have handled
206 them already. */
207 format_ptr = GET_RTX_FORMAT (GET_CODE (in_rtx)) + i;
208 for (; i < GET_RTX_LENGTH (GET_CODE (in_rtx)); i++)
209 switch (*format_ptr++)
210 {
211 const char *str;
212
213 case 'T':
214 str = XTMPL (in_rtx, i);
215 goto string;
216
217 case 'S':
218 case 's':
219 str = XSTR (in_rtx, i);
220 string:
221
222 if (str == 0)
223 fputs (dump_for_graph ? " \\\"\\\"" : " \"\"", outfile);
224 else
225 {
226 if (dump_for_graph)
227 fprintf (outfile, " (\\\"%s\\\")", str);
228 else
229 fprintf (outfile, " (\"%s\")", str);
230 }
231 sawclose = 1;
232 break;
233
234 /* 0 indicates a field for internal use that should not be printed.
235 An exception is the third field of a NOTE, where it indicates
236 that the field has several different valid contents. */
237 case '0':
238 if (i == 1 && GET_CODE (in_rtx) == REG)
239 {
240 if (REGNO (in_rtx) != ORIGINAL_REGNO (in_rtx))
241 fprintf (outfile, " [%d]", ORIGINAL_REGNO (in_rtx));
242 break;
243 }
244 if (i == 4 && GET_CODE (in_rtx) == NOTE)
245 {
246 switch (NOTE_LINE_NUMBER (in_rtx))
247 {
248 case NOTE_INSN_EH_REGION_BEG:
249 case NOTE_INSN_EH_REGION_END:
250 if (flag_dump_unnumbered)
251 fprintf (outfile, " #");
252 else
253 fprintf (outfile, " %d", NOTE_EH_HANDLER (in_rtx));
254 sawclose = 1;
255 break;
256
257 case NOTE_INSN_BLOCK_BEG:
258 case NOTE_INSN_BLOCK_END:
259 fprintf (outfile, " ");
260 if (flag_dump_unnumbered)
261 fprintf (outfile, "#");
262 else
263 fprintf (outfile, HOST_PTR_PRINTF,
264 (char *) NOTE_BLOCK (in_rtx));
265 sawclose = 1;
266 break;
267
268 case NOTE_INSN_BASIC_BLOCK:
269 {
270 basic_block bb = NOTE_BASIC_BLOCK (in_rtx);
271 if (bb != 0)
272 fprintf (outfile, " [bb %d]", bb->index);
273 break;
274 }
275
276 case NOTE_INSN_EXPECTED_VALUE:
277 indent += 2;
278 if (!sawclose)
279 fprintf (outfile, " ");
280 print_rtx (NOTE_EXPECTED_VALUE (in_rtx));
281 indent -= 2;
282 break;
283
284 case NOTE_INSN_DELETED_LABEL:
285 if (NOTE_SOURCE_FILE (in_rtx))
286 fprintf (outfile, " (\"%s\")", NOTE_SOURCE_FILE (in_rtx));
287 else
288 fprintf (outfile, " \"\"");
289 break;
290
291 case NOTE_INSN_PREDICTION:
292 if (NOTE_PREDICTION (in_rtx))
293 fprintf (outfile, " [ %d %d ] ",
294 (int)NOTE_PREDICTION_ALG (in_rtx),
295 (int) NOTE_PREDICTION_FLAGS (in_rtx));
296 else
297 fprintf (outfile, " [ ERROR ]");
298 break;
299
300 default:
301 {
302 const char * const str = X0STR (in_rtx, i);
303
304 if (NOTE_LINE_NUMBER (in_rtx) < 0)
305 ;
306 else if (str == 0)
307 fputs (dump_for_graph ? " \\\"\\\"" : " \"\"", outfile);
308 else
309 {
310 if (dump_for_graph)
311 fprintf (outfile, " (\\\"%s\\\")", str);
312 else
313 fprintf (outfile, " (\"%s\")", str);
314 }
315 break;
316 }
317 }
318 }
319 break;
320
321 case 'e':
322 do_e:
323 indent += 2;
324 if (!sawclose)
325 fprintf (outfile, " ");
326 print_rtx (XEXP (in_rtx, i));
327 indent -= 2;
328 break;
329
330 case 'E':
331 case 'V':
332 indent += 2;
333 if (sawclose)
334 {
335 fprintf (outfile, "\n%s%*s",
336 print_rtx_head, indent * 2, "");
337 sawclose = 0;
338 }
339 fputs (" [", outfile);
340 if (NULL != XVEC (in_rtx, i))
341 {
342 indent += 2;
343 if (XVECLEN (in_rtx, i))
344 sawclose = 1;
345
346 for (j = 0; j < XVECLEN (in_rtx, i); j++)
347 print_rtx (XVECEXP (in_rtx, i, j));
348
349 indent -= 2;
350 }
351 if (sawclose)
352 fprintf (outfile, "\n%s%*s", print_rtx_head, indent * 2, "");
353
354 fputs ("]", outfile);
355 sawclose = 1;
356 indent -= 2;
357 break;
358
359 case 'w':
360 if (! flag_simple)
361 fprintf (outfile, " ");
362 fprintf (outfile, HOST_WIDE_INT_PRINT_DEC, XWINT (in_rtx, i));
363 if (! flag_simple)
364 {
365 fprintf (outfile, " [");
366 fprintf (outfile, HOST_WIDE_INT_PRINT_HEX, XWINT (in_rtx, i));
367 fprintf (outfile, "]");
368 }
369 break;
370
371 case 'i':
372 if (i == 6 && GET_CODE (in_rtx) == NOTE)
373 {
374 /* This field is only used for NOTE_INSN_DELETED_LABEL, and
375 other times often contains garbage from INSN->NOTE death. */
376 if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_DELETED_LABEL)
377 fprintf (outfile, " %d", XINT (in_rtx, i));
378 }
379 else
380 {
381 int value = XINT (in_rtx, i);
382 const char *name;
383
384 if (GET_CODE (in_rtx) == REG && value < FIRST_PSEUDO_REGISTER)
385 {
386 fputc (' ', outfile);
387 DEBUG_PRINT_REG (in_rtx, 0, outfile);
388 }
389 else if (GET_CODE (in_rtx) == REG
390 && value <= LAST_VIRTUAL_REGISTER)
391 {
392 if (value == VIRTUAL_INCOMING_ARGS_REGNUM)
393 fprintf (outfile, " %d virtual-incoming-args", value);
394 else if (value == VIRTUAL_STACK_VARS_REGNUM)
395 fprintf (outfile, " %d virtual-stack-vars", value);
396 else if (value == VIRTUAL_STACK_DYNAMIC_REGNUM)
397 fprintf (outfile, " %d virtual-stack-dynamic", value);
398 else if (value == VIRTUAL_OUTGOING_ARGS_REGNUM)
399 fprintf (outfile, " %d virtual-outgoing-args", value);
400 else if (value == VIRTUAL_CFA_REGNUM)
401 fprintf (outfile, " %d virtual-cfa", value);
402 else
403 fprintf (outfile, " %d virtual-reg-%d", value,
404 value-FIRST_VIRTUAL_REGISTER);
405 }
406 else if (flag_dump_unnumbered
407 && (is_insn || GET_CODE (in_rtx) == NOTE))
408 fputc ('#', outfile);
409 else
410 fprintf (outfile, " %d", value);
411
412 if (is_insn && &INSN_CODE (in_rtx) == &XINT (in_rtx, i)
413 && XINT (in_rtx, i) >= 0
414 && (name = get_insn_name (XINT (in_rtx, i))) != NULL)
415 fprintf (outfile, " {%s}", name);
416 sawclose = 0;
417 }
418 break;
419
420 /* Print NOTE_INSN names rather than integer codes. */
421
422 case 'n':
423 if (XINT (in_rtx, i) >= (int) NOTE_INSN_BIAS
424 && XINT (in_rtx, i) < (int) NOTE_INSN_MAX)
425 fprintf (outfile, " %s", GET_NOTE_INSN_NAME (XINT (in_rtx, i)));
426 else
427 fprintf (outfile, " %d", XINT (in_rtx, i));
428 sawclose = 0;
429 break;
430
431 case 'u':
432 if (XEXP (in_rtx, i) != NULL)
433 {
434 rtx sub = XEXP (in_rtx, i);
435 enum rtx_code subc = GET_CODE (sub);
436
437 if (GET_CODE (in_rtx) == LABEL_REF)
438 {
439 if (subc == NOTE
440 && NOTE_LINE_NUMBER (sub) == NOTE_INSN_DELETED_LABEL)
441 {
442 if (flag_dump_unnumbered)
443 fprintf (outfile, " [# deleted]");
444 else
445 fprintf (outfile, " [%d deleted]", INSN_UID (sub));
446 sawclose = 0;
447 break;
448 }
449
450 if (subc != CODE_LABEL)
451 goto do_e;
452 }
453
454 if (flag_dump_unnumbered)
455 fputs (" #", outfile);
456 else
457 fprintf (outfile, " %d", INSN_UID (sub));
458 }
459 else
460 fputs (" 0", outfile);
461 sawclose = 0;
462 break;
463
464 case 'b':
465 if (XBITMAP (in_rtx, i) == NULL)
466 fputs (" {null}", outfile);
467 else
468 bitmap_print (outfile, XBITMAP (in_rtx, i), " {", "}");
469 sawclose = 0;
470 break;
471
472 case 't':
473 putc (' ', outfile);
474 fprintf (outfile, HOST_PTR_PRINTF, (char *) XTREE (in_rtx, i));
475 break;
476
477 case '*':
478 fputs (" Unknown", outfile);
479 sawclose = 0;
480 break;
481
482 case 'B':
483 if (XBBDEF (in_rtx, i))
484 fprintf (outfile, " %i", XBBDEF (in_rtx, i)->index);
485 break;
486
487 default:
488 fprintf (stderr,
489 "switch format wrong in rtl.print_rtx(). format was: %c.\n",
490 format_ptr[-1]);
491 abort ();
492 }
493
494 switch (GET_CODE (in_rtx))
495 {
496 case MEM:
497 fputs (" [", outfile);
498 fprintf (outfile, HOST_WIDE_INT_PRINT_DEC, MEM_ALIAS_SET (in_rtx));
499
500 if (MEM_EXPR (in_rtx))
501 print_mem_expr (outfile, MEM_EXPR (in_rtx));
502
503 if (MEM_OFFSET (in_rtx))
504 {
505 fputc ('+', outfile);
506 fprintf (outfile, HOST_WIDE_INT_PRINT_DEC,
507 INTVAL (MEM_OFFSET (in_rtx)));
508 }
509
510 if (MEM_SIZE (in_rtx))
511 {
512 fputs (" S", outfile);
513 fprintf (outfile, HOST_WIDE_INT_PRINT_DEC,
514 INTVAL (MEM_SIZE (in_rtx)));
515 }
516
517 if (MEM_ALIGN (in_rtx) != 1)
518 fprintf (outfile, " A%u", MEM_ALIGN (in_rtx));
519
520 fputc (']', outfile);
521 break;
522
523 #ifndef GENERATOR_FILE
524 case CONST_DOUBLE:
525 if (FLOAT_MODE_P (GET_MODE (in_rtx)))
526 {
527 char s[60];
528
529 real_to_decimal (s, CONST_DOUBLE_REAL_VALUE (in_rtx),
530 sizeof (s), 0, 1);
531 fprintf (outfile, " %s", s);
532
533 real_to_hexadecimal (s, CONST_DOUBLE_REAL_VALUE (in_rtx),
534 sizeof (s), 0, 1);
535 fprintf (outfile, " [%s]", s);
536 }
537 break;
538 #endif
539
540 case CODE_LABEL:
541 fprintf (outfile, " [%d uses]", LABEL_NUSES (in_rtx));
542 switch (LABEL_KIND (in_rtx))
543 {
544 case LABEL_NORMAL: break;
545 case LABEL_STATIC_ENTRY: fputs (" [entry]", outfile); break;
546 case LABEL_GLOBAL_ENTRY: fputs (" [global entry]", outfile); break;
547 case LABEL_WEAK_ENTRY: fputs (" [weak entry]", outfile); break;
548 default: abort();
549 }
550 break;
551
552 case CALL_PLACEHOLDER:
553 if (debug_call_placeholder_verbose)
554 {
555 fputs (" (cond [\n (const_string \"normal\") (sequence [", outfile);
556 for (tem = XEXP (in_rtx, 0); tem != 0; tem = NEXT_INSN (tem))
557 {
558 fputs ("\n ", outfile);
559 print_inline_rtx (outfile, tem, 4);
560 }
561
562 tem = XEXP (in_rtx, 1);
563 if (tem)
564 fputs ("\n ])\n (const_string \"tail_call\") (sequence [",
565 outfile);
566 for (; tem != 0; tem = NEXT_INSN (tem))
567 {
568 fputs ("\n ", outfile);
569 print_inline_rtx (outfile, tem, 4);
570 }
571
572 tem = XEXP (in_rtx, 2);
573 if (tem)
574 fputs ("\n ])\n (const_string \"tail_recursion\") (sequence [",
575 outfile);
576 for (; tem != 0; tem = NEXT_INSN (tem))
577 {
578 fputs ("\n ", outfile);
579 print_inline_rtx (outfile, tem, 4);
580 }
581
582 fputs ("\n ])\n ])", outfile);
583 break;
584 }
585
586 for (tem = XEXP (in_rtx, 0); tem != 0; tem = NEXT_INSN (tem))
587 if (GET_CODE (tem) == CALL_INSN)
588 {
589 fprintf (outfile, " ");
590 print_rtx (tem);
591 break;
592 }
593 break;
594
595 default:
596 break;
597 }
598
599 if (dump_for_graph
600 && (is_insn || GET_CODE (in_rtx) == NOTE
601 || GET_CODE (in_rtx) == CODE_LABEL || GET_CODE (in_rtx) == BARRIER))
602 sawclose = 0;
603 else
604 {
605 fputc (')', outfile);
606 sawclose = 1;
607 }
608 }
609
610 /* Print an rtx on the current line of FILE. Initially indent IND
611 characters. */
612
613 void
614 print_inline_rtx (outf, x, ind)
615 FILE *outf;
616 rtx x;
617 int ind;
618 {
619 int oldsaw = sawclose;
620 int oldindent = indent;
621
622 sawclose = 0;
623 indent = ind;
624 outfile = outf;
625 print_rtx (x);
626 sawclose = oldsaw;
627 indent = oldindent;
628 }
629
630 /* Call this function from the debugger to see what X looks like. */
631
632 void
633 debug_rtx (x)
634 rtx x;
635 {
636 outfile = stderr;
637 sawclose = 0;
638 print_rtx (x);
639 fprintf (stderr, "\n");
640 }
641
642 /* Count of rtx's to print with debug_rtx_list.
643 This global exists because gdb user defined commands have no arguments. */
644
645 int debug_rtx_count = 0; /* 0 is treated as equivalent to 1 */
646
647 /* Call this function to print list from X on.
648
649 N is a count of the rtx's to print. Positive values print from the specified
650 rtx on. Negative values print a window around the rtx.
651 EG: -5 prints 2 rtx's on either side (in addition to the specified rtx). */
652
653 void
654 debug_rtx_list (x, n)
655 rtx x;
656 int n;
657 {
658 int i,count;
659 rtx insn;
660
661 count = n == 0 ? 1 : n < 0 ? -n : n;
662
663 /* If we are printing a window, back up to the start. */
664
665 if (n < 0)
666 for (i = count / 2; i > 0; i--)
667 {
668 if (PREV_INSN (x) == 0)
669 break;
670 x = PREV_INSN (x);
671 }
672
673 for (i = count, insn = x; i > 0 && insn != 0; i--, insn = NEXT_INSN (insn))
674 {
675 debug_rtx (insn);
676 fprintf (stderr, "\n");
677 }
678 }
679
680 /* Call this function to print an rtx list from START to END inclusive. */
681
682 void
683 debug_rtx_range (start, end)
684 rtx start, end;
685 {
686 while (1)
687 {
688 debug_rtx (start);
689 fprintf (stderr, "\n");
690 if (!start || start == end)
691 break;
692 start = NEXT_INSN (start);
693 }
694 }
695
696 /* Call this function to search an rtx list to find one with insn uid UID,
697 and then call debug_rtx_list to print it, using DEBUG_RTX_COUNT.
698 The found insn is returned to enable further debugging analysis. */
699
700 rtx
701 debug_rtx_find (x, uid)
702 rtx x;
703 int uid;
704 {
705 while (x != 0 && INSN_UID (x) != uid)
706 x = NEXT_INSN (x);
707 if (x != 0)
708 {
709 debug_rtx_list (x, debug_rtx_count);
710 return x;
711 }
712 else
713 {
714 fprintf (stderr, "insn uid %d not found\n", uid);
715 return 0;
716 }
717 }
718
719 /* External entry point for printing a chain of insns
720 starting with RTX_FIRST onto file OUTF.
721 A blank line separates insns.
722
723 If RTX_FIRST is not an insn, then it alone is printed, with no newline. */
724
725 void
726 print_rtl (outf, rtx_first)
727 FILE *outf;
728 rtx rtx_first;
729 {
730 rtx tmp_rtx;
731
732 outfile = outf;
733 sawclose = 0;
734
735 if (rtx_first == 0)
736 {
737 fputs (print_rtx_head, outf);
738 fputs ("(nil)\n", outf);
739 }
740 else
741 switch (GET_CODE (rtx_first))
742 {
743 case INSN:
744 case JUMP_INSN:
745 case CALL_INSN:
746 case NOTE:
747 case CODE_LABEL:
748 case BARRIER:
749 for (tmp_rtx = rtx_first; tmp_rtx != 0; tmp_rtx = NEXT_INSN (tmp_rtx))
750 if (! flag_dump_unnumbered
751 || GET_CODE (tmp_rtx) != NOTE || NOTE_LINE_NUMBER (tmp_rtx) < 0)
752 {
753 fputs (print_rtx_head, outfile);
754 print_rtx (tmp_rtx);
755 fprintf (outfile, "\n");
756 }
757 break;
758
759 default:
760 fputs (print_rtx_head, outfile);
761 print_rtx (rtx_first);
762 }
763 }
764
765 /* Like print_rtx, except specify a file. */
766 /* Return nonzero if we actually printed anything. */
767
768 int
769 print_rtl_single (outf, x)
770 FILE *outf;
771 rtx x;
772 {
773 outfile = outf;
774 sawclose = 0;
775 if (! flag_dump_unnumbered
776 || GET_CODE (x) != NOTE || NOTE_LINE_NUMBER (x) < 0)
777 {
778 fputs (print_rtx_head, outfile);
779 print_rtx (x);
780 putc ('\n', outf);
781 return 1;
782 }
783 return 0;
784 }
785
786
787 /* Like print_rtl except without all the detail; for example,
788 if RTX is a CONST_INT then print in decimal format. */
789
790 void
791 print_simple_rtl (outf, x)
792 FILE *outf;
793 rtx x;
794 {
795 flag_simple = 1;
796 print_rtl (outf, x);
797 flag_simple = 0;
798 }