OSDN Git Service

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