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