OSDN Git Service

* flow.c (life_analysis): Only turn off PROP_LOG_LINKS and
[pf3gnuchains/gcc-fork.git] / gcc / print-tree.c
1 /* Prints out tree in human readable form - GNU C-compiler
2    Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
3    Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22
23 #include "config.h"
24 #include "system.h"
25 #include "tree.h"
26 #include "ggc.h"
27
28 /* Define the hash table of nodes already seen.
29    Such nodes are not repeated; brief cross-references are used.  */
30
31 #define HASH_SIZE 37
32
33 struct bucket
34 {
35   tree node;
36   struct bucket *next;
37 };
38
39 static struct bucket **table;
40
41 /* Print the node NODE on standard error, for debugging.
42    Most nodes referred to by this one are printed recursively
43    down to a depth of six.  */
44
45 void
46 debug_tree (node)
47      tree node;
48 {
49   char *object = (char *) oballoc (0);
50
51   table = (struct bucket **) oballoc (HASH_SIZE * sizeof (struct bucket *));
52   bzero ((char *) table, HASH_SIZE * sizeof (struct bucket *));
53   print_node (stderr, "", node, 0);
54   table = 0;
55   obfree (object);
56   fprintf (stderr, "\n");
57 }
58
59 /* Print a node in brief fashion, with just the code, address and name.  */
60
61 void
62 print_node_brief (file, prefix, node, indent)
63      FILE *file;
64      const char *prefix;
65      tree node;
66      int indent;
67 {
68   char class;
69
70   if (node == 0)
71     return;
72
73   class = TREE_CODE_CLASS (TREE_CODE (node));
74
75   /* Always print the slot this node is in, and its code, address and
76      name if any.  */
77   if (indent > 0)
78     fprintf (file, " ");
79   fprintf (file, "%s <%s ", prefix, tree_code_name[(int) TREE_CODE (node)]);
80   fprintf (file, HOST_PTR_PRINTF, (char *) node);
81
82   if (class == 'd')
83     {
84       if (DECL_NAME (node))
85         fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
86     }
87   else if (class == 't')
88     {
89       if (TYPE_NAME (node))
90         {
91           if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
92             fprintf (file, " %s", IDENTIFIER_POINTER (TYPE_NAME (node)));
93           else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
94                    && DECL_NAME (TYPE_NAME (node)))
95             fprintf (file, " %s",
96                      IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node))));
97         }
98     }
99   if (TREE_CODE (node) == IDENTIFIER_NODE)
100     fprintf (file, " %s", IDENTIFIER_POINTER (node));
101   /* We might as well always print the value of an integer.  */
102   if (TREE_CODE (node) == INTEGER_CST)
103     {
104       if (TREE_CONSTANT_OVERFLOW (node))
105         fprintf (file, " overflow");
106
107       fprintf (file, " ");
108       if (TREE_INT_CST_HIGH (node) == 0)
109         fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (node));
110       else if (TREE_INT_CST_HIGH (node) == -1
111                && TREE_INT_CST_LOW (node) != 0)
112         {
113           fprintf (file, "-");
114           fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED,
115                    -TREE_INT_CST_LOW (node));
116         }
117       else
118         fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
119                  TREE_INT_CST_HIGH (node), TREE_INT_CST_LOW (node));
120     }
121   if (TREE_CODE (node) == REAL_CST)
122     {
123       REAL_VALUE_TYPE d;
124
125       if (TREE_OVERFLOW (node))
126         fprintf (file, " overflow");
127
128 #if !defined(REAL_IS_NOT_DOUBLE) || defined(REAL_ARITHMETIC)
129       d = TREE_REAL_CST (node);
130       if (REAL_VALUE_ISINF (d))
131         fprintf (file, " Inf");
132       else if (REAL_VALUE_ISNAN (d))
133         fprintf (file, " Nan");
134       else
135         {
136           char string[100];
137
138           REAL_VALUE_TO_DECIMAL (d, "%e", string);
139           fprintf (file, " %s", string);
140         }
141 #else
142       {
143         int i;
144         unsigned char *p = (unsigned char *) &TREE_REAL_CST (node);
145         fprintf (file, " 0x");
146         for (i = 0; i < sizeof TREE_REAL_CST (node); i++)
147           fprintf (file, "%02x", *p++);
148         fprintf (file, "");
149       }
150 #endif
151     }
152
153   fprintf (file, ">");
154 }
155
156 void
157 indent_to (file, column)
158      FILE *file;
159      int column;
160 {
161   int i;
162
163   /* Since this is the long way, indent to desired column.  */
164   if (column > 0)
165     fprintf (file, "\n");
166   for (i = 0; i < column; i++)
167     fprintf (file, " ");
168 }
169 \f
170 /* Print the node NODE in full on file FILE, preceded by PREFIX,
171    starting in column INDENT.  */
172
173 void
174 print_node (file, prefix, node, indent)
175      FILE *file;
176      const char *prefix;
177      tree node;
178      int indent;
179 {
180   int hash;
181   struct bucket *b;
182   enum machine_mode mode;
183   char class;
184   int len;
185   int first_rtl;
186   int i;
187
188   if (node == 0)
189     return;
190
191   class = TREE_CODE_CLASS (TREE_CODE (node));
192
193   /* Don't get too deep in nesting.  If the user wants to see deeper,
194      it is easy to use the address of a lowest-level node
195      as an argument in another call to debug_tree.  */
196
197   if (indent > 24)
198     {
199       print_node_brief (file, prefix, node, indent);
200       return;
201     }
202
203   if (indent > 8 && (class == 't' || class == 'd'))
204     {
205       print_node_brief (file, prefix, node, indent);
206       return;
207     }
208
209   /* It is unsafe to look at any other filds of an ERROR_MARK node.  */
210   if (TREE_CODE (node) == ERROR_MARK)
211     {
212       print_node_brief (file, prefix, node, indent);
213       return;
214     }
215
216   hash = ((unsigned long) node) % HASH_SIZE;
217
218   /* If node is in the table, just mention its address.  */
219   for (b = table[hash]; b; b = b->next)
220     if (b->node == node)
221       {
222         print_node_brief (file, prefix, node, indent);
223         return;
224       }
225
226   /* Add this node to the table.  */
227   b = (struct bucket *) oballoc (sizeof (struct bucket));
228   b->node = node;
229   b->next = table[hash];
230   table[hash] = b;
231
232   /* Indent to the specified column, since this is the long form.  */
233   indent_to (file, indent);
234
235   /* Print the slot this node is in, and its code, and address.  */
236   fprintf (file, "%s <%s ", prefix, tree_code_name[(int) TREE_CODE (node)]);
237   fprintf (file, HOST_PTR_PRINTF, (char *) node);
238
239   /* Print the name, if any.  */
240   if (class == 'd')
241     {
242       if (DECL_NAME (node))
243         fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
244     }
245   else if (class == 't')
246     {
247       if (TYPE_NAME (node))
248         {
249           if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
250             fprintf (file, " %s", IDENTIFIER_POINTER (TYPE_NAME (node)));
251           else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
252                    && DECL_NAME (TYPE_NAME (node)))
253             fprintf (file, " %s",
254                      IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node))));
255         }
256     }
257   if (TREE_CODE (node) == IDENTIFIER_NODE)
258     fprintf (file, " %s", IDENTIFIER_POINTER (node));
259
260   if (TREE_CODE (node) == INTEGER_CST)
261     {
262       if (indent <= 4)
263         print_node_brief (file, "type", TREE_TYPE (node), indent + 4);
264     }
265   else
266     {
267       print_node (file, "type", TREE_TYPE (node), indent + 4);
268       if (TREE_TYPE (node))
269         indent_to (file, indent + 3);
270
271       if (!ggc_p)
272         {
273           print_obstack_name ((char *) node, file, "");
274           indent_to (file, indent + 3);
275         }
276     }
277
278   /* If a permanent object is in the wrong obstack, or the reverse, warn.  */
279   if (!ggc_p && object_permanent_p (node) != TREE_PERMANENT (node))
280     {
281       if (TREE_PERMANENT (node))
282         fputs (" !!permanent object in non-permanent obstack!!", file);
283       else
284         fputs (" !!non-permanent object in permanent obstack!!", file);
285       indent_to (file, indent + 3);
286     }
287
288   if (TREE_SIDE_EFFECTS (node))
289     fputs (" side-effects", file);
290   if (TREE_READONLY (node))
291     fputs (" readonly", file);
292   if (TREE_CONSTANT (node))
293     fputs (" constant", file);
294   if (TREE_ADDRESSABLE (node))
295     fputs (" addressable", file);
296   if (TREE_THIS_VOLATILE (node))
297     fputs (" volatile", file);
298   if (TREE_UNSIGNED (node))
299     fputs (" unsigned", file);
300   if (TREE_ASM_WRITTEN (node))
301     fputs (" asm_written", file);
302   if (TREE_USED (node))
303     fputs (" used", file);
304   if (TREE_NOTHROW (node))
305     fputs (" nothrow", file);
306   if (!ggc_p && TREE_PERMANENT (node))
307     fputs (" permanent", file);
308   if (TREE_PUBLIC (node))
309     fputs (" public", file);
310   if (TREE_PRIVATE (node))
311     fputs (" private", file);
312   if (TREE_PROTECTED (node))
313     fputs (" protected", file);
314   if (TREE_STATIC (node))
315     fputs (" static", file);
316   if (TREE_LANG_FLAG_0 (node))
317     fputs (" tree_0", file);
318   if (TREE_LANG_FLAG_1 (node))
319     fputs (" tree_1", file);
320   if (TREE_LANG_FLAG_2 (node))
321     fputs (" tree_2", file);
322   if (TREE_LANG_FLAG_3 (node))
323     fputs (" tree_3", file);
324   if (TREE_LANG_FLAG_4 (node))
325     fputs (" tree_4", file);
326   if (TREE_LANG_FLAG_5 (node))
327     fputs (" tree_5", file);
328   if (TREE_LANG_FLAG_6 (node))
329     fputs (" tree_6", file);
330
331   /* DECL_ nodes have additional attributes.  */
332
333   switch (TREE_CODE_CLASS (TREE_CODE (node)))
334     {
335     case 'd':
336       mode = DECL_MODE (node);
337
338       if (DECL_IGNORED_P (node))
339         fputs (" ignored", file);
340       if (DECL_ABSTRACT (node))
341         fputs (" abstract", file);
342       if (DECL_IN_SYSTEM_HEADER (node))
343         fputs (" in_system_header", file);
344       if (DECL_COMMON (node))
345         fputs (" common", file);
346       if (DECL_EXTERNAL (node))
347         fputs (" external", file);
348       if (DECL_REGISTER (node))
349         fputs (" regdecl", file);
350       if (DECL_NONLOCAL (node))
351         fputs (" nonlocal", file);
352
353       if (TREE_CODE (node) == TYPE_DECL && TYPE_DECL_SUPPRESS_DEBUG (node))
354         fputs (" suppress-debug", file);
355
356       if (TREE_CODE (node) == FUNCTION_DECL && DECL_INLINE (node))
357         fputs (" inline", file);
358       if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node))
359         fputs (" built-in", file);
360       if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN_NONANSI (node))
361         fputs (" built-in-nonansi", file);
362
363       if (TREE_CODE (node) == FIELD_DECL && DECL_PACKED (node))
364         fputs (" packed", file);
365       if (TREE_CODE (node) == FIELD_DECL && DECL_BIT_FIELD (node))
366         fputs (" bit-field", file);
367
368       if (TREE_CODE (node) == LABEL_DECL && DECL_TOO_LATE (node))
369         fputs (" too-late", file);
370
371       if (TREE_CODE (node) == VAR_DECL && DECL_IN_TEXT_SECTION (node))
372         fputs (" in-text-section", file);
373
374       if (TREE_CODE (node) == PARM_DECL && DECL_TRANSPARENT_UNION (node))
375         fputs (" transparent-union", file);
376
377       if (DECL_VIRTUAL_P (node))
378         fputs (" virtual", file);
379       if (DECL_DEFER_OUTPUT (node))
380         fputs (" defer-output", file);
381
382       if (DECL_LANG_FLAG_0 (node))
383         fputs (" decl_0", file);
384       if (DECL_LANG_FLAG_1 (node))
385         fputs (" decl_1", file);
386       if (DECL_LANG_FLAG_2 (node))
387         fputs (" decl_2", file);
388       if (DECL_LANG_FLAG_3 (node))
389         fputs (" decl_3", file);
390       if (DECL_LANG_FLAG_4 (node))
391         fputs (" decl_4", file);
392       if (DECL_LANG_FLAG_5 (node))
393         fputs (" decl_5", file);
394       if (DECL_LANG_FLAG_6 (node))
395         fputs (" decl_6", file);
396       if (DECL_LANG_FLAG_7 (node))
397         fputs (" decl_7", file);
398
399       fprintf (file, " %s", GET_MODE_NAME(mode));
400
401       fprintf (file, " file %s line %d",
402                DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
403
404       print_node (file, "size", DECL_SIZE (node), indent + 4);
405       print_node (file, "unit size", DECL_SIZE_UNIT (node), indent + 4);
406       
407       if (TREE_CODE (node) != FUNCTION_DECL
408           || DECL_INLINE (node) || DECL_BUILT_IN (node))
409         indent_to (file, indent + 3);
410
411       if (TREE_CODE (node) != FUNCTION_DECL)
412         {
413           fprintf (file, " align %d", DECL_ALIGN (node));
414           if (TREE_CODE (node) == FIELD_DECL)
415             fprintf (file, " offset_align %d", DECL_OFFSET_ALIGN (node));
416         }
417       else if (DECL_INLINE (node))
418         {
419           fprintf (file, " frame_size ");
420           fprintf (file, HOST_WIDE_INT_PRINT_DEC, DECL_FRAME_SIZE (node));
421         }
422       else if (DECL_BUILT_IN (node))
423         fprintf (file, " built-in %s:%s",
424                  built_in_class_names[(int) DECL_BUILT_IN_CLASS (node)],
425                  built_in_names[(int) DECL_FUNCTION_CODE (node)]);
426
427       if (DECL_POINTER_ALIAS_SET_KNOWN_P (node))
428         {
429           fprintf (file, " alias set ");
430           fprintf (file, HOST_WIDE_INT_PRINT_DEC, 
431                    DECL_POINTER_ALIAS_SET (node));
432         }
433
434       if (TREE_CODE (node) == FIELD_DECL)
435         {
436           print_node (file, "offset", DECL_FIELD_OFFSET (node), indent + 4);
437           print_node (file, "bit offset", DECL_FIELD_BIT_OFFSET (node),
438                       indent + 4);
439         }
440
441       print_node_brief (file, "context", DECL_CONTEXT (node), indent + 4);
442       print_node_brief (file, "machine_attributes",
443                         DECL_MACHINE_ATTRIBUTES (node), indent + 4);
444       print_node_brief (file, "abstract_origin",
445                         DECL_ABSTRACT_ORIGIN (node), indent + 4);
446
447       print_node (file, "arguments", DECL_ARGUMENTS (node), indent + 4);
448       print_node (file, "result", DECL_RESULT_FLD (node), indent + 4);
449       print_node_brief (file, "initial", DECL_INITIAL (node), indent + 4);
450
451       print_lang_decl (file, node, indent);
452
453       if (DECL_RTL (node) != 0)
454         {
455           indent_to (file, indent + 4);
456           print_rtl (file, DECL_RTL (node));
457         }
458
459       if (TREE_CODE (node) == PARM_DECL && DECL_INCOMING_RTL (node) != 0)
460         {
461           indent_to (file, indent + 4);
462           fprintf (file, "incoming-rtl ");
463           print_rtl (file, DECL_INCOMING_RTL (node));
464         }
465       else if (TREE_CODE (node) == FUNCTION_DECL
466                && DECL_SAVED_INSNS (node) != 0)
467         {
468           indent_to (file, indent + 4);
469           fprintf (file, "saved-insns ");
470           fprintf (file, HOST_PTR_PRINTF, (char *) DECL_SAVED_INSNS (node));
471         }
472
473       /* Print the decl chain only if decl is at second level.  */
474       if (indent == 4)
475         print_node (file, "chain", TREE_CHAIN (node), indent + 4);
476       else
477         print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4);
478       break;
479
480     case 't':
481       if (TYPE_NO_FORCE_BLK (node))
482         fputs (" no-force-blk", file);
483       if (TYPE_STRING_FLAG (node))
484         fputs (" string-flag", file);
485       if (TYPE_NEEDS_CONSTRUCTING (node))
486         fputs (" needs-constructing", file);
487       /* The transparent-union flag is used for different things in
488          different nodes.  */
489       if (TYPE_CHECK (node)->type.transparent_union_flag)
490         {
491           if (TREE_CODE (node) == UNION_TYPE)
492             fputs (" transparent-union", file);
493           else if (TREE_CODE (node) == ARRAY_TYPE)
494             fputs (" nonaliased-component", file);
495           else
496             fputs (" tu-flag", file);
497         }
498       if (TYPE_PACKED (node))
499         fputs (" packed", file);
500
501       if (TYPE_LANG_FLAG_0 (node))
502         fputs (" type_0", file);
503       if (TYPE_LANG_FLAG_1 (node))
504         fputs (" type_1", file);
505       if (TYPE_LANG_FLAG_2 (node))
506         fputs (" type_2", file);
507       if (TYPE_LANG_FLAG_3 (node))
508         fputs (" type_3", file);
509       if (TYPE_LANG_FLAG_4 (node))
510         fputs (" type_4", file);
511       if (TYPE_LANG_FLAG_5 (node))
512         fputs (" type_5", file);
513       if (TYPE_LANG_FLAG_6 (node))
514         fputs (" type_6", file);
515
516       mode = TYPE_MODE (node);
517       fprintf (file, " %s", GET_MODE_NAME(mode));
518
519       print_node (file, "size", TYPE_SIZE (node), indent + 4);
520       print_node (file, "unit size", TYPE_SIZE_UNIT (node), indent + 4);
521       indent_to (file, indent + 3);
522
523       fprintf (file, " align %d", TYPE_ALIGN (node));
524       fprintf (file, " symtab %d", TYPE_SYMTAB_ADDRESS (node));
525       fprintf (file, " alias set ");
526       fprintf (file, HOST_WIDE_INT_PRINT_DEC, TYPE_ALIAS_SET (node));
527
528       print_node (file, "attributes", TYPE_ATTRIBUTES (node), indent + 4);
529
530       if (TREE_CODE (node) == ARRAY_TYPE || TREE_CODE (node) == SET_TYPE)
531         print_node (file, "domain", TYPE_DOMAIN (node), indent + 4);
532       else if (TREE_CODE (node) == INTEGER_TYPE
533                || TREE_CODE (node) == BOOLEAN_TYPE
534                || TREE_CODE (node) == CHAR_TYPE)
535         {
536           fprintf (file, " precision %d", TYPE_PRECISION (node));
537           print_node (file, "min", TYPE_MIN_VALUE (node), indent + 4);
538           print_node (file, "max", TYPE_MAX_VALUE (node), indent + 4);
539         }
540       else if (TREE_CODE (node) == ENUMERAL_TYPE)
541         {
542           fprintf (file, " precision %d", TYPE_PRECISION (node));
543           print_node (file, "min", TYPE_MIN_VALUE (node), indent + 4);
544           print_node (file, "max", TYPE_MAX_VALUE (node), indent + 4);
545           print_node (file, "values", TYPE_VALUES (node), indent + 4);
546         }
547       else if (TREE_CODE (node) == REAL_TYPE)
548         fprintf (file, " precision %d", TYPE_PRECISION (node));
549       else if (TREE_CODE (node) == RECORD_TYPE
550                || TREE_CODE (node) == UNION_TYPE
551                || TREE_CODE (node) == QUAL_UNION_TYPE)
552         print_node (file, "fields", TYPE_FIELDS (node), indent + 4);
553       else if (TREE_CODE (node) == FUNCTION_TYPE || TREE_CODE (node) == METHOD_TYPE)
554         {
555           if (TYPE_METHOD_BASETYPE (node))
556             print_node_brief (file, "method basetype", TYPE_METHOD_BASETYPE (node), indent + 4);
557           print_node (file, "arg-types", TYPE_ARG_TYPES (node), indent + 4);
558         }
559       else if (TREE_CODE (node) == OFFSET_TYPE)
560         print_node_brief (file, "basetype", TYPE_OFFSET_BASETYPE (node),
561                           indent + 4);
562       if (TYPE_CONTEXT (node))
563         print_node_brief (file, "context", TYPE_CONTEXT (node), indent + 4);
564
565       print_lang_type (file, node, indent);
566
567       if (TYPE_POINTER_TO (node) || TREE_CHAIN (node))
568         indent_to (file, indent + 3);
569       print_node_brief (file, "pointer_to_this", TYPE_POINTER_TO (node), indent + 4);
570       print_node_brief (file, "reference_to_this", TYPE_REFERENCE_TO (node), indent + 4);
571       print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4);
572       break;
573
574     case 'b':
575       print_node (file, "vars", BLOCK_VARS (node), indent + 4);
576       print_node (file, "supercontext", BLOCK_SUPERCONTEXT (node), indent + 4);
577       print_node (file, "subblocks", BLOCK_SUBBLOCKS (node), indent + 4);
578       print_node (file, "chain", BLOCK_CHAIN (node), indent + 4);
579       print_node (file, "abstract_origin",
580                   BLOCK_ABSTRACT_ORIGIN (node), indent + 4);
581       break;
582
583     case 'e':
584     case '<':
585     case '1':
586     case '2':
587     case 'r':
588     case 's':
589       if (TREE_CODE (node) == BIND_EXPR)
590         {
591           print_node (file, "vars", TREE_OPERAND (node, 0), indent + 4);
592           print_node (file, "body", TREE_OPERAND (node, 1), indent + 4);
593           print_node (file, "block", TREE_OPERAND (node, 2), indent + 4);
594           break;
595         }
596
597       len = TREE_CODE_LENGTH (TREE_CODE (node));
598
599       /* Some nodes contain rtx's, not trees,
600          after a certain point.  Print the rtx's as rtx's.  */
601       first_rtl = first_rtl_op (TREE_CODE (node));
602
603       for (i = 0; i < len; i++)
604         {
605           if (i >= first_rtl)
606             {
607               indent_to (file, indent + 4);
608               fprintf (file, "rtl %d ", i);
609               if (TREE_OPERAND (node, i))
610                 print_rtl (file, (struct rtx_def *) TREE_OPERAND (node, i));
611               else
612                 fprintf (file, "(nil)");
613               fprintf (file, "\n");
614             }
615           else
616             {
617               char temp[10];
618
619               sprintf (temp, "arg %d", i);
620               print_node (file, temp, TREE_OPERAND (node, i), indent + 4);
621             }
622         }
623
624       if (TREE_CODE (node) == EXPR_WITH_FILE_LOCATION)
625         {
626           indent_to (file, indent+4);
627           fprintf (file, "%s:%d:%d", 
628                    (EXPR_WFL_FILENAME_NODE (node ) ?
629                     EXPR_WFL_FILENAME (node) : "(no file info)"),
630                    EXPR_WFL_LINENO (node), EXPR_WFL_COLNO (node));
631         }
632       print_node (file, "chain", BLOCK_CHAIN (node), indent + 4);
633       break;
634
635     case 'c':
636     case 'x':
637       switch (TREE_CODE (node))
638         {
639         case INTEGER_CST:
640           if (TREE_CONSTANT_OVERFLOW (node))
641             fprintf (file, " overflow");
642
643           fprintf (file, " ");
644           if (TREE_INT_CST_HIGH (node) == 0)
645             fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED,
646                      TREE_INT_CST_LOW (node));
647           else if (TREE_INT_CST_HIGH (node) == -1
648                    && TREE_INT_CST_LOW (node) != 0)
649             {
650               fprintf (file, "-");
651               fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED,
652                        -TREE_INT_CST_LOW (node));
653             }
654           else
655             fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
656                      TREE_INT_CST_HIGH (node), TREE_INT_CST_LOW (node));
657           break;
658
659         case REAL_CST:
660           {
661             REAL_VALUE_TYPE d;
662
663             if (TREE_OVERFLOW (node))
664               fprintf (file, " overflow");
665
666 #if !defined(REAL_IS_NOT_DOUBLE) || defined(REAL_ARITHMETIC)
667             d = TREE_REAL_CST (node);
668             if (REAL_VALUE_ISINF (d))
669               fprintf (file, " Inf");
670             else if (REAL_VALUE_ISNAN (d))
671               fprintf (file, " Nan");
672             else
673               {
674                 char string[100];
675
676                 REAL_VALUE_TO_DECIMAL (d, "%e", string);
677                 fprintf (file, " %s", string);
678               }
679 #else
680             {
681               int i;
682               unsigned char *p = (unsigned char *) &TREE_REAL_CST (node);
683               fprintf (file, " 0x");
684               for (i = 0; i < sizeof TREE_REAL_CST (node); i++)
685                 fprintf (file, "%02x", *p++);
686               fprintf (file, "");
687             }
688 #endif
689           }
690           break;
691
692         case COMPLEX_CST:
693           print_node (file, "real", TREE_REALPART (node), indent + 4);
694           print_node (file, "imag", TREE_IMAGPART (node), indent + 4);
695           break;
696
697         case STRING_CST:
698           fprintf (file, " \"%s\"", TREE_STRING_POINTER (node));
699           /* Print the chain at second level.  */
700           if (indent == 4)
701             print_node (file, "chain", TREE_CHAIN (node), indent + 4);
702           else
703             print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4);
704           break;
705
706         case IDENTIFIER_NODE:
707           print_lang_identifier (file, node, indent);
708           break;
709
710         case TREE_LIST:
711           print_node (file, "purpose", TREE_PURPOSE (node), indent + 4);
712           print_node (file, "value", TREE_VALUE (node), indent + 4);
713           print_node (file, "chain", TREE_CHAIN (node), indent + 4);
714           break;
715
716         case TREE_VEC:
717           len = TREE_VEC_LENGTH (node);
718           for (i = 0; i < len; i++)
719             if (TREE_VEC_ELT (node, i))
720               {
721                 char temp[10];
722                 sprintf (temp, "elt %d", i);
723                 indent_to (file, indent + 4);
724                 print_node_brief (file, temp, TREE_VEC_ELT (node, i), 0);
725               }
726           break;
727
728         case OP_IDENTIFIER:
729           print_node (file, "op1", TREE_PURPOSE (node), indent + 4);
730           print_node (file, "op2", TREE_VALUE (node), indent + 4);
731           break;
732
733         default:
734           if (TREE_CODE_CLASS (TREE_CODE (node)) == 'x')
735             lang_print_xnode (file, node, indent);
736           break;
737         }
738
739       break;
740     }
741
742   fprintf (file, ">");
743 }