OSDN Git Service

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