Alpha: Remove leftover `;;' for "unaligned_store<mode>"
[official-gcc.git] / gcc / print-rtl.cc
blob1688d4ec5c8febc876987c0c5bce192885fe96d1
1 /* Print RTL for GCC.
2 Copyright (C) 1987-2024 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 /* This file is compiled twice: once for the generator programs,
21 once for the compiler. */
22 #ifdef GENERATOR_FILE
23 #include "bconfig.h"
24 #else
25 #include "config.h"
26 #endif
28 #define INCLUDE_MEMORY
29 #include "system.h"
30 #include "coretypes.h"
31 #include "tm.h"
32 #include "rtl.h"
34 /* These headers all define things which are not available in
35 generator programs. */
36 #ifndef GENERATOR_FILE
37 #include "alias.h"
38 #include "tree.h"
39 #include "basic-block.h"
40 #include "print-tree.h"
41 #include "flags.h"
42 #include "predict.h"
43 #include "function.h"
44 #include "cfg.h"
45 #include "basic-block.h"
46 #include "diagnostic.h"
47 #include "tree-pretty-print.h"
48 #include "alloc-pool.h"
49 #include "cselib.h"
50 #include "dumpfile.h" /* for dump_flags */
51 #include "dwarf2out.h"
52 #include "pretty-print.h"
53 #endif
55 #include "print-rtl.h"
56 #include "rtl-iter.h"
58 /* Disable warnings about quoting issues in the pp_xxx calls below
59 that (intentionally) don't follow GCC diagnostic conventions. */
60 #if __GNUC__ >= 10
61 # pragma GCC diagnostic push
62 # pragma GCC diagnostic ignored "-Wformat-diag"
63 #endif
65 /* String printed at beginning of each RTL when it is dumped.
66 This string is set to ASM_COMMENT_START when the RTL is dumped in
67 the assembly output file. */
68 const char *print_rtx_head = "";
70 #ifdef GENERATOR_FILE
71 /* These are defined from the .opt file when not used in generator
72 programs. */
74 /* Nonzero means suppress output of instruction numbers
75 in debugging dumps.
76 This must be defined here so that programs like gencodes can be linked. */
77 int flag_dump_unnumbered = 0;
79 /* Nonzero means suppress output of instruction numbers for previous
80 and next insns in debugging dumps.
81 This must be defined here so that programs like gencodes can be linked. */
82 int flag_dump_unnumbered_links = 0;
83 #endif
85 /* Constructor for rtx_writer. */
87 rtx_writer::rtx_writer (FILE *outf, int ind, bool simple, bool compact,
88 rtx_reuse_manager *reuse_manager ATTRIBUTE_UNUSED)
89 : m_outfile (outf), m_indent (ind), m_sawclose (false),
90 m_in_call_function_usage (false), m_simple (simple), m_compact (compact)
91 #ifndef GENERATOR_FILE
92 , m_rtx_reuse_manager (reuse_manager)
93 #endif
97 #ifndef GENERATOR_FILE
99 /* rtx_reuse_manager's ctor. */
101 rtx_reuse_manager::rtx_reuse_manager ()
102 : m_next_id (0)
106 /* Determine if X is of a kind suitable for dumping via reuse_rtx. */
108 static bool
109 uses_rtx_reuse_p (const_rtx x)
111 if (x == NULL)
112 return false;
114 switch (GET_CODE (x))
116 case DEBUG_EXPR:
117 case VALUE:
118 case SCRATCH:
119 return true;
121 /* We don't use reuse_rtx for consts. */
122 CASE_CONST_UNIQUE:
123 default:
124 return false;
128 /* Traverse X and its descendents, determining if we see any rtx more than
129 once. Any rtx suitable for "reuse_rtx" that is seen more than once is
130 assigned an ID. */
132 void
133 rtx_reuse_manager::preprocess (const_rtx x)
135 subrtx_iterator::array_type array;
136 FOR_EACH_SUBRTX (iter, array, x, NONCONST)
137 if (uses_rtx_reuse_p (*iter))
139 if (int *count = m_rtx_occurrence_count.get (*iter))
141 if (*(count++) == 1)
142 m_rtx_reuse_ids.put (*iter, m_next_id++);
144 else
145 m_rtx_occurrence_count.put (*iter, 1);
149 /* Return true iff X has been assigned a reuse ID. If it has,
150 and OUT is non-NULL, then write the reuse ID to *OUT. */
152 bool
153 rtx_reuse_manager::has_reuse_id (const_rtx x, int *out)
155 int *id = m_rtx_reuse_ids.get (x);
156 if (id)
158 if (out)
159 *out = *id;
160 return true;
162 else
163 return false;
166 /* Determine if set_seen_def has been called for the given reuse ID. */
168 bool
169 rtx_reuse_manager::seen_def_p (int reuse_id)
171 return bitmap_bit_p (m_defs_seen, reuse_id);
174 /* Record that the definition of the given reuse ID has been seen. */
176 void
177 rtx_reuse_manager::set_seen_def (int reuse_id)
179 bitmap_set_bit (m_defs_seen, reuse_id);
182 #endif /* #ifndef GENERATOR_FILE */
184 #ifndef GENERATOR_FILE
185 void
186 print_mem_expr (FILE *outfile, const_tree expr)
188 fputc (' ', outfile);
189 print_generic_expr (outfile, CONST_CAST_TREE (expr),
190 dump_flags | TDF_SLIM);
192 #endif
194 /* Print X to FILE. */
196 static void
197 print_poly_int (FILE *file, poly_int64 x)
199 HOST_WIDE_INT const_x;
200 if (x.is_constant (&const_x))
201 fprintf (file, HOST_WIDE_INT_PRINT_DEC, const_x);
202 else
204 fprintf (file, "[" HOST_WIDE_INT_PRINT_DEC, x.coeffs[0]);
205 for (int i = 1; i < NUM_POLY_INT_COEFFS; ++i)
206 fprintf (file, ", " HOST_WIDE_INT_PRINT_DEC, x.coeffs[i]);
207 fprintf (file, "]");
211 /* Subroutine of print_rtx_operand for handling code '0'.
212 0 indicates a field for internal use that should not be printed.
213 However there are various special cases, such as the third field
214 of a NOTE, where it indicates that the field has several different
215 valid contents. */
217 void
218 rtx_writer::print_rtx_operand_code_0 (const_rtx in_rtx ATTRIBUTE_UNUSED,
219 int idx ATTRIBUTE_UNUSED)
221 #ifndef GENERATOR_FILE
222 if (idx == 1 && GET_CODE (in_rtx) == SYMBOL_REF)
224 int flags = SYMBOL_REF_FLAGS (in_rtx);
225 if (flags)
226 fprintf (m_outfile, " [flags %#x]", flags);
227 tree decl = SYMBOL_REF_DECL (in_rtx);
228 if (decl)
229 print_node_brief (m_outfile, "", decl, dump_flags);
231 else if (idx == 3 && NOTE_P (in_rtx))
233 switch (NOTE_KIND (in_rtx))
235 case NOTE_INSN_EH_REGION_BEG:
236 case NOTE_INSN_EH_REGION_END:
237 if (flag_dump_unnumbered)
238 fprintf (m_outfile, " #");
239 else
240 fprintf (m_outfile, " %d", NOTE_EH_HANDLER (in_rtx));
241 m_sawclose = true;
242 break;
244 case NOTE_INSN_BLOCK_BEG:
245 case NOTE_INSN_BLOCK_END:
246 dump_addr (m_outfile, " ", NOTE_BLOCK (in_rtx));
247 m_sawclose = true;
248 break;
250 case NOTE_INSN_BASIC_BLOCK:
252 basic_block bb = NOTE_BASIC_BLOCK (in_rtx);
253 if (bb != 0)
254 fprintf (m_outfile, " [bb %d]", bb->index);
255 break;
258 case NOTE_INSN_DELETED_LABEL:
259 case NOTE_INSN_DELETED_DEBUG_LABEL:
261 const char *label = NOTE_DELETED_LABEL_NAME (in_rtx);
262 if (label)
263 fprintf (m_outfile, " (\"%s\")", label);
264 else
265 fprintf (m_outfile, " \"\"");
267 break;
269 case NOTE_INSN_SWITCH_TEXT_SECTIONS:
271 basic_block bb = NOTE_BASIC_BLOCK (in_rtx);
272 if (bb != 0)
273 fprintf (m_outfile, " [bb %d]", bb->index);
274 break;
277 case NOTE_INSN_VAR_LOCATION:
278 fputc (' ', m_outfile);
279 print_rtx (NOTE_VAR_LOCATION (in_rtx));
280 break;
282 case NOTE_INSN_CFI:
283 fputc ('\n', m_outfile);
284 output_cfi_directive (m_outfile, NOTE_CFI (in_rtx));
285 fputc ('\t', m_outfile);
286 break;
288 case NOTE_INSN_BEGIN_STMT:
289 case NOTE_INSN_INLINE_ENTRY:
290 #ifndef GENERATOR_FILE
292 expanded_location xloc
293 = expand_location (NOTE_MARKER_LOCATION (in_rtx));
294 fprintf (m_outfile, " %s:%i", xloc.file, xloc.line);
296 #endif
297 break;
299 default:
300 break;
303 else if (idx == 7 && JUMP_P (in_rtx) && JUMP_LABEL (in_rtx) != NULL
304 && !m_compact)
306 /* Output the JUMP_LABEL reference. */
307 fprintf (m_outfile, "\n%s%*s -> ", print_rtx_head, m_indent * 2, "");
308 if (GET_CODE (JUMP_LABEL (in_rtx)) == RETURN)
309 fprintf (m_outfile, "return");
310 else if (GET_CODE (JUMP_LABEL (in_rtx)) == SIMPLE_RETURN)
311 fprintf (m_outfile, "simple_return");
312 else
313 fprintf (m_outfile, "%d", INSN_UID (JUMP_LABEL (in_rtx)));
315 else if (idx == 0 && GET_CODE (in_rtx) == VALUE)
317 cselib_val *val = CSELIB_VAL_PTR (in_rtx);
319 fprintf (m_outfile, " %u:%u", val->uid, val->hash);
320 dump_addr (m_outfile, " @", in_rtx);
321 dump_addr (m_outfile, "/", (void*)val);
323 else if (idx == 0 && GET_CODE (in_rtx) == DEBUG_EXPR)
325 fprintf (m_outfile, " D#%i",
326 DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (in_rtx)));
328 else if (idx == 0 && GET_CODE (in_rtx) == ENTRY_VALUE)
330 m_indent += 2;
331 if (!m_sawclose)
332 fprintf (m_outfile, " ");
333 print_rtx (ENTRY_VALUE_EXP (in_rtx));
334 m_indent -= 2;
336 #endif
339 /* Subroutine of print_rtx_operand for handling code 'e'.
340 Also called by print_rtx_operand_code_u for handling code 'u'
341 for LABEL_REFs when they don't reference a CODE_LABEL. */
343 void
344 rtx_writer::print_rtx_operand_code_e (const_rtx in_rtx, int idx)
346 m_indent += 2;
347 if (idx == 6 && INSN_P (in_rtx))
348 /* Put REG_NOTES on their own line. */
349 fprintf (m_outfile, "\n%s%*s",
350 print_rtx_head, m_indent * 2, "");
351 if (!m_sawclose)
352 fprintf (m_outfile, " ");
353 if (idx == 7 && CALL_P (in_rtx))
355 m_in_call_function_usage = true;
356 print_rtx (XEXP (in_rtx, idx));
357 m_in_call_function_usage = false;
359 else
360 print_rtx (XEXP (in_rtx, idx));
361 m_indent -= 2;
364 /* Subroutine of print_rtx_operand for handling codes 'E' and 'V'. */
366 void
367 rtx_writer::print_rtx_operand_codes_E_and_V (const_rtx in_rtx, int idx)
369 m_indent += 2;
370 if (m_sawclose)
372 fprintf (m_outfile, "\n%s%*s",
373 print_rtx_head, m_indent * 2, "");
374 m_sawclose = false;
376 if (GET_CODE (in_rtx) == CONST_VECTOR
377 && !GET_MODE_NUNITS (GET_MODE (in_rtx)).is_constant ()
378 && CONST_VECTOR_DUPLICATE_P (in_rtx))
379 fprintf (m_outfile, " repeat");
380 fputs (" [", m_outfile);
381 if (XVEC (in_rtx, idx) != NULL)
383 m_indent += 2;
384 if (XVECLEN (in_rtx, idx))
385 m_sawclose = true;
387 int barrier = XVECLEN (in_rtx, idx);
388 if (GET_CODE (in_rtx) == CONST_VECTOR
389 && !GET_MODE_NUNITS (GET_MODE (in_rtx)).is_constant ())
390 barrier = CONST_VECTOR_NPATTERNS (in_rtx);
392 for (int j = 0; j < XVECLEN (in_rtx, idx); j++)
394 int j1;
396 if (j == barrier)
398 fprintf (m_outfile, "\n%s%*s",
399 print_rtx_head, m_indent * 2, "");
400 if (!CONST_VECTOR_STEPPED_P (in_rtx))
401 fprintf (m_outfile, "repeat [");
402 else if (CONST_VECTOR_NPATTERNS (in_rtx) == 1)
403 fprintf (m_outfile, "stepped [");
404 else
405 fprintf (m_outfile, "stepped (interleave %d) [",
406 CONST_VECTOR_NPATTERNS (in_rtx));
407 m_indent += 2;
410 print_rtx (XVECEXP (in_rtx, idx, j));
411 int limit = MIN (barrier, XVECLEN (in_rtx, idx));
412 for (j1 = j + 1; j1 < limit; j1++)
413 if (XVECEXP (in_rtx, idx, j) != XVECEXP (in_rtx, idx, j1))
414 break;
416 if (j1 != j + 1)
418 fprintf (m_outfile, " repeated x%i", j1 - j);
419 j = j1 - 1;
423 if (barrier < XVECLEN (in_rtx, idx))
425 m_indent -= 2;
426 fprintf (m_outfile, "\n%s%*s]", print_rtx_head, m_indent * 2, "");
429 m_indent -= 2;
431 if (m_sawclose)
432 fprintf (m_outfile, "\n%s%*s", print_rtx_head, m_indent * 2, "");
434 fputs ("]", m_outfile);
435 m_sawclose = true;
436 m_indent -= 2;
439 /* Subroutine of print_rtx_operand for handling code 'i'. */
441 void
442 rtx_writer::print_rtx_operand_code_i (const_rtx in_rtx, int idx)
444 if (idx == 4 && INSN_P (in_rtx))
446 #ifndef GENERATOR_FILE
447 const rtx_insn *in_insn = as_a <const rtx_insn *> (in_rtx);
449 /* Pretty-print insn locations. Ignore scoping as it is mostly
450 redundant with line number information and do not print anything
451 when there is no location information available. */
452 if (INSN_HAS_LOCATION (in_insn))
454 expanded_location xloc = insn_location (in_insn);
455 fprintf (m_outfile, " \"%s\":%i:%i", xloc.file, xloc.line,
456 xloc.column);
457 int discriminator = insn_discriminator (in_insn);
458 if (discriminator)
459 fprintf (m_outfile, " discrim %d", discriminator);
462 #endif
464 else if (idx == 6 && GET_CODE (in_rtx) == ASM_OPERANDS)
466 #ifndef GENERATOR_FILE
467 if (ASM_OPERANDS_SOURCE_LOCATION (in_rtx) != UNKNOWN_LOCATION)
468 fprintf (m_outfile, " %s:%i",
469 LOCATION_FILE (ASM_OPERANDS_SOURCE_LOCATION (in_rtx)),
470 LOCATION_LINE (ASM_OPERANDS_SOURCE_LOCATION (in_rtx)));
471 #endif
473 else if (idx == 1 && GET_CODE (in_rtx) == ASM_INPUT)
475 #ifndef GENERATOR_FILE
476 if (ASM_INPUT_SOURCE_LOCATION (in_rtx) != UNKNOWN_LOCATION)
477 fprintf (m_outfile, " %s:%i",
478 LOCATION_FILE (ASM_INPUT_SOURCE_LOCATION (in_rtx)),
479 LOCATION_LINE (ASM_INPUT_SOURCE_LOCATION (in_rtx)));
480 #endif
482 else if (idx == 5 && NOTE_P (in_rtx))
484 /* This field is only used for NOTE_INSN_DELETED_LABEL, and
485 other times often contains garbage from INSN->NOTE death. */
486 if (NOTE_KIND (in_rtx) == NOTE_INSN_DELETED_LABEL
487 || NOTE_KIND (in_rtx) == NOTE_INSN_DELETED_DEBUG_LABEL)
488 fprintf (m_outfile, " %d", XINT (in_rtx, idx));
490 #if !defined(GENERATOR_FILE) && NUM_UNSPECV_VALUES > 0
491 else if (idx == 1
492 && GET_CODE (in_rtx) == UNSPEC_VOLATILE
493 && XINT (in_rtx, 1) >= 0
494 && XINT (in_rtx, 1) < NUM_UNSPECV_VALUES)
495 fprintf (m_outfile, " %s", unspecv_strings[XINT (in_rtx, 1)]);
496 #endif
497 #if !defined(GENERATOR_FILE) && NUM_UNSPEC_VALUES > 0
498 else if (idx == 1
499 && (GET_CODE (in_rtx) == UNSPEC
500 || GET_CODE (in_rtx) == UNSPEC_VOLATILE)
501 && XINT (in_rtx, 1) >= 0
502 && XINT (in_rtx, 1) < NUM_UNSPEC_VALUES)
503 fprintf (m_outfile, " %s", unspec_strings[XINT (in_rtx, 1)]);
504 #endif
505 else
507 int value = XINT (in_rtx, idx);
508 const char *name;
509 int is_insn = INSN_P (in_rtx);
511 /* Don't print INSN_CODEs in compact mode. */
512 if (m_compact && is_insn && &INSN_CODE (in_rtx) == &XINT (in_rtx, idx))
514 m_sawclose = false;
515 return;
518 if (flag_dump_unnumbered
519 && (is_insn || NOTE_P (in_rtx)))
520 fputc ('#', m_outfile);
521 else
522 fprintf (m_outfile, " %d", value);
524 if (is_insn && &INSN_CODE (in_rtx) == &XINT (in_rtx, idx)
525 && XINT (in_rtx, idx) >= 0
526 && (name = get_insn_name (XINT (in_rtx, idx))) != NULL)
527 fprintf (m_outfile, " {%s}", name);
528 m_sawclose = false;
532 /* Subroutine of print_rtx_operand for handling code 'r'. */
534 void
535 rtx_writer::print_rtx_operand_code_r (const_rtx in_rtx)
537 int is_insn = INSN_P (in_rtx);
538 unsigned int regno = REGNO (in_rtx);
540 #ifndef GENERATOR_FILE
541 /* For hard registers and virtuals, always print the
542 regno, except in compact mode. */
543 if (regno <= LAST_VIRTUAL_REGISTER && !m_compact)
544 fprintf (m_outfile, " %d", regno);
545 if (regno < FIRST_PSEUDO_REGISTER)
546 fprintf (m_outfile, " %s", reg_names[regno]);
547 else if (regno <= LAST_VIRTUAL_REGISTER)
549 if (regno == VIRTUAL_INCOMING_ARGS_REGNUM)
550 fprintf (m_outfile, " virtual-incoming-args");
551 else if (regno == VIRTUAL_STACK_VARS_REGNUM)
552 fprintf (m_outfile, " virtual-stack-vars");
553 else if (regno == VIRTUAL_STACK_DYNAMIC_REGNUM)
554 fprintf (m_outfile, " virtual-stack-dynamic");
555 else if (regno == VIRTUAL_OUTGOING_ARGS_REGNUM)
556 fprintf (m_outfile, " virtual-outgoing-args");
557 else if (regno == VIRTUAL_CFA_REGNUM)
558 fprintf (m_outfile, " virtual-cfa");
559 else if (regno == VIRTUAL_PREFERRED_STACK_BOUNDARY_REGNUM)
560 fprintf (m_outfile, " virtual-preferred-stack-boundary");
561 else
562 fprintf (m_outfile, " virtual-reg-%d", regno-FIRST_VIRTUAL_REGISTER);
564 else
565 #endif
566 if (flag_dump_unnumbered && is_insn)
567 fputc ('#', m_outfile);
568 else if (m_compact)
570 /* In compact mode, print pseudos with '< and '>' wrapping the regno,
571 offseting it by (LAST_VIRTUAL_REGISTER + 1), so that the
572 first non-virtual pseudo is dumped as "<0>". */
573 gcc_assert (regno > LAST_VIRTUAL_REGISTER);
574 fprintf (m_outfile, " <%d>", regno - (LAST_VIRTUAL_REGISTER + 1));
576 else
577 fprintf (m_outfile, " %d", regno);
579 #ifndef GENERATOR_FILE
580 if (REG_ATTRS (in_rtx))
582 fputs (" [", m_outfile);
583 if (regno != ORIGINAL_REGNO (in_rtx))
584 fprintf (m_outfile, "orig:%i", ORIGINAL_REGNO (in_rtx));
585 if (REG_EXPR (in_rtx))
586 print_mem_expr (m_outfile, REG_EXPR (in_rtx));
588 if (maybe_ne (REG_OFFSET (in_rtx), 0))
590 fprintf (m_outfile, "+");
591 print_poly_int (m_outfile, REG_OFFSET (in_rtx));
593 fputs (" ]", m_outfile);
595 if (regno != ORIGINAL_REGNO (in_rtx))
596 fprintf (m_outfile, " [%d]", ORIGINAL_REGNO (in_rtx));
597 #endif
600 /* Subroutine of print_rtx_operand for handling code 'u'. */
602 void
603 rtx_writer::print_rtx_operand_code_u (const_rtx in_rtx, int idx)
605 /* Don't print insn UIDs for PREV/NEXT_INSN in compact mode. */
606 if (m_compact && INSN_CHAIN_CODE_P (GET_CODE (in_rtx)) && idx < 2)
607 return;
609 if (XEXP (in_rtx, idx) != NULL)
611 rtx sub = XEXP (in_rtx, idx);
612 enum rtx_code subc = GET_CODE (sub);
614 if (GET_CODE (in_rtx) == LABEL_REF)
616 if (subc == NOTE
617 && NOTE_KIND (sub) == NOTE_INSN_DELETED_LABEL)
619 if (flag_dump_unnumbered)
620 fprintf (m_outfile, " [# deleted]");
621 else
622 fprintf (m_outfile, " [%d deleted]", INSN_UID (sub));
623 m_sawclose = false;
624 return;
627 if (subc != CODE_LABEL)
629 print_rtx_operand_code_e (in_rtx, idx);
630 return;
634 if (flag_dump_unnumbered
635 || (flag_dump_unnumbered_links && idx <= 1
636 && (INSN_P (in_rtx) || NOTE_P (in_rtx)
637 || LABEL_P (in_rtx) || BARRIER_P (in_rtx))))
638 fputs (" #", m_outfile);
639 else
640 fprintf (m_outfile, " %d", INSN_UID (sub));
642 else
643 fputs (" 0", m_outfile);
644 m_sawclose = false;
647 /* Subroutine of print_rtx. Print operand IDX of IN_RTX. */
649 void
650 rtx_writer::print_rtx_operand (const_rtx in_rtx, int idx)
652 const char *format_ptr = GET_RTX_FORMAT (GET_CODE (in_rtx));
654 switch (format_ptr[idx])
656 const char *str;
658 case 'T':
659 str = XTMPL (in_rtx, idx);
660 goto string;
662 case 'S':
663 case 's':
664 str = XSTR (in_rtx, idx);
665 string:
667 if (str == 0)
668 fputs (" (nil)", m_outfile);
669 else
670 fprintf (m_outfile, " (\"%s\")", str);
671 m_sawclose = true;
672 break;
674 case '0':
675 print_rtx_operand_code_0 (in_rtx, idx);
676 break;
678 case 'e':
679 print_rtx_operand_code_e (in_rtx, idx);
680 break;
682 case 'E':
683 case 'V':
684 print_rtx_operand_codes_E_and_V (in_rtx, idx);
685 break;
687 case 'w':
688 if (! m_simple)
689 fprintf (m_outfile, " ");
690 fprintf (m_outfile, HOST_WIDE_INT_PRINT_DEC, XWINT (in_rtx, idx));
691 if (! m_simple && !m_compact)
692 fprintf (m_outfile, " [" HOST_WIDE_INT_PRINT_HEX "]",
693 (unsigned HOST_WIDE_INT) XWINT (in_rtx, idx));
694 break;
696 case 'i':
697 print_rtx_operand_code_i (in_rtx, idx);
698 break;
700 case 'p':
701 fprintf (m_outfile, " ");
702 print_poly_int (m_outfile, SUBREG_BYTE (in_rtx));
703 break;
705 case 'r':
706 print_rtx_operand_code_r (in_rtx);
707 break;
709 /* Print NOTE_INSN names rather than integer codes. */
711 case 'n':
712 fprintf (m_outfile, " %s", GET_NOTE_INSN_NAME (XINT (in_rtx, idx)));
713 m_sawclose = false;
714 break;
716 case 'u':
717 print_rtx_operand_code_u (in_rtx, idx);
718 break;
720 case 't':
721 #ifndef GENERATOR_FILE
722 if (idx == 0 && GET_CODE (in_rtx) == DEBUG_IMPLICIT_PTR)
723 print_mem_expr (m_outfile, DEBUG_IMPLICIT_PTR_DECL (in_rtx));
724 else if (idx == 0 && GET_CODE (in_rtx) == DEBUG_PARAMETER_REF)
725 print_mem_expr (m_outfile, DEBUG_PARAMETER_REF_DECL (in_rtx));
726 else
727 dump_addr (m_outfile, " ", XTREE (in_rtx, idx));
728 #endif
729 break;
731 case '*':
732 fputs (" Unknown", m_outfile);
733 m_sawclose = false;
734 break;
736 case 'B':
737 /* Don't print basic block ids in compact mode. */
738 if (m_compact)
739 break;
740 #ifndef GENERATOR_FILE
741 if (XBBDEF (in_rtx, idx))
742 fprintf (m_outfile, " %i", XBBDEF (in_rtx, idx)->index);
743 #endif
744 break;
746 default:
747 gcc_unreachable ();
751 /* Subroutine of rtx_writer::print_rtx.
752 In compact mode, determine if operand IDX of IN_RTX is interesting
753 to dump, or (if in a trailing position) it can be omitted. */
755 bool
756 rtx_writer::operand_has_default_value_p (const_rtx in_rtx, int idx)
758 const char *format_ptr = GET_RTX_FORMAT (GET_CODE (in_rtx));
760 switch (format_ptr[idx])
762 case 'e':
763 case 'u':
764 return XEXP (in_rtx, idx) == NULL_RTX;
766 case 's':
767 return XSTR (in_rtx, idx) == NULL;
769 case '0':
770 switch (GET_CODE (in_rtx))
772 case JUMP_INSN:
773 /* JUMP_LABELs are always omitted in compact mode, so treat
774 any value here as omittable, so that earlier operands can
775 potentially be omitted also. */
776 return m_compact;
778 default:
779 return false;
783 default:
784 return false;
788 /* Print IN_RTX onto m_outfile. This is the recursive part of printing. */
790 void
791 rtx_writer::print_rtx (const_rtx in_rtx)
793 int idx = 0;
795 if (m_sawclose)
797 if (m_simple)
798 fputc (' ', m_outfile);
799 else
800 fprintf (m_outfile, "\n%s%*s", print_rtx_head, m_indent * 2, "");
801 m_sawclose = false;
804 if (in_rtx == 0)
806 fputs ("(nil)", m_outfile);
807 m_sawclose = true;
808 return;
810 else if (GET_CODE (in_rtx) > NUM_RTX_CODE)
812 fprintf (m_outfile, "(??? bad code %d\n%s%*s)", GET_CODE (in_rtx),
813 print_rtx_head, m_indent * 2, "");
814 m_sawclose = true;
815 return;
818 fputc ('(', m_outfile);
820 /* Print name of expression code. */
822 /* Handle reuse. */
823 #ifndef GENERATOR_FILE
824 if (m_rtx_reuse_manager)
826 int reuse_id;
827 if (m_rtx_reuse_manager->has_reuse_id (in_rtx, &reuse_id))
829 /* Have we already seen the defn of this rtx? */
830 if (m_rtx_reuse_manager->seen_def_p (reuse_id))
832 fprintf (m_outfile, "reuse_rtx %i)", reuse_id);
833 m_sawclose = true;
834 return;
836 else
838 /* First time we've seen this reused-rtx. */
839 fprintf (m_outfile, "%i|", reuse_id);
840 m_rtx_reuse_manager->set_seen_def (reuse_id);
844 #endif /* #ifndef GENERATOR_FILE */
846 /* In compact mode, prefix the code of insns with "c",
847 giving "cinsn", "cnote" etc. */
848 if (m_compact && is_a <const rtx_insn *, const struct rtx_def> (in_rtx))
850 /* "ccode_label" is slightly awkward, so special-case it as
851 just "clabel". */
852 rtx_code code = GET_CODE (in_rtx);
853 if (code == CODE_LABEL)
854 fprintf (m_outfile, "clabel");
855 else
856 fprintf (m_outfile, "c%s", GET_RTX_NAME (code));
858 else if (m_simple && CONST_INT_P (in_rtx))
859 ; /* no code. */
860 else
861 fprintf (m_outfile, "%s", GET_RTX_NAME (GET_CODE (in_rtx)));
863 if (! m_simple)
865 if (RTX_FLAG (in_rtx, in_struct))
866 fputs ("/s", m_outfile);
868 if (RTX_FLAG (in_rtx, volatil))
869 fputs ("/v", m_outfile);
871 if (RTX_FLAG (in_rtx, unchanging))
872 fputs ("/u", m_outfile);
874 if (RTX_FLAG (in_rtx, frame_related))
875 fputs ("/f", m_outfile);
877 if (RTX_FLAG (in_rtx, jump))
878 fputs ("/j", m_outfile);
880 if (RTX_FLAG (in_rtx, call))
881 fputs ("/c", m_outfile);
883 if (RTX_FLAG (in_rtx, return_val))
884 fputs ("/i", m_outfile);
886 /* Print REG_NOTE names for EXPR_LIST and INSN_LIST. */
887 if ((GET_CODE (in_rtx) == EXPR_LIST
888 || GET_CODE (in_rtx) == INSN_LIST
889 || GET_CODE (in_rtx) == INT_LIST)
890 && (int)GET_MODE (in_rtx) < REG_NOTE_MAX
891 && !m_in_call_function_usage)
892 fprintf (m_outfile, ":%s",
893 GET_REG_NOTE_NAME (GET_MODE (in_rtx)));
895 /* For other rtl, print the mode if it's not VOID. */
896 else if (GET_MODE (in_rtx) != VOIDmode)
897 fprintf (m_outfile, ":%s", GET_MODE_NAME (GET_MODE (in_rtx)));
899 #ifndef GENERATOR_FILE
900 if (GET_CODE (in_rtx) == VAR_LOCATION)
902 if (TREE_CODE (PAT_VAR_LOCATION_DECL (in_rtx)) == STRING_CST)
903 fputs (" <debug string placeholder>", m_outfile);
904 else
905 print_mem_expr (m_outfile, PAT_VAR_LOCATION_DECL (in_rtx));
906 fputc (' ', m_outfile);
907 print_rtx (PAT_VAR_LOCATION_LOC (in_rtx));
908 if (PAT_VAR_LOCATION_STATUS (in_rtx)
909 == VAR_INIT_STATUS_UNINITIALIZED)
910 fprintf (m_outfile, " [uninit]");
911 m_sawclose = true;
912 idx = GET_RTX_LENGTH (VAR_LOCATION);
914 #endif
917 #ifndef GENERATOR_FILE
918 if (CONST_DOUBLE_AS_FLOAT_P (in_rtx))
919 idx = 5;
920 #endif
922 /* For insns, print the INSN_UID. */
923 if (INSN_CHAIN_CODE_P (GET_CODE (in_rtx)))
925 if (flag_dump_unnumbered)
926 fprintf (m_outfile, " #");
927 else
928 fprintf (m_outfile, " %d", INSN_UID (in_rtx));
931 /* Determine which is the final operand to print.
932 In compact mode, skip trailing operands that have the default values
933 e.g. trailing "(nil)" values. */
934 int limit = GET_RTX_LENGTH (GET_CODE (in_rtx));
935 if (m_compact)
936 while (limit > idx && operand_has_default_value_p (in_rtx, limit - 1))
937 limit--;
939 /* Get the format string and skip the first elements if we have handled
940 them already. */
942 for (; idx < limit; idx++)
943 print_rtx_operand (in_rtx, idx);
945 switch (GET_CODE (in_rtx))
947 #ifndef GENERATOR_FILE
948 case MEM:
949 if (UNLIKELY (final_insns_dump_p))
950 fprintf (m_outfile, " [");
951 else
952 fprintf (m_outfile, " [" HOST_WIDE_INT_PRINT_DEC,
953 (HOST_WIDE_INT) MEM_ALIAS_SET (in_rtx));
955 if (MEM_EXPR (in_rtx))
956 print_mem_expr (m_outfile, MEM_EXPR (in_rtx));
957 else
958 fputc (' ', m_outfile);
960 if (MEM_OFFSET_KNOWN_P (in_rtx))
962 fprintf (m_outfile, "+");
963 print_poly_int (m_outfile, MEM_OFFSET (in_rtx));
966 if (MEM_SIZE_KNOWN_P (in_rtx))
968 fprintf (m_outfile, " S");
969 print_poly_int (m_outfile, MEM_SIZE (in_rtx));
972 if (MEM_ALIGN (in_rtx) != 1)
973 fprintf (m_outfile, " A%u", MEM_ALIGN (in_rtx));
975 if (!ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (in_rtx)))
976 fprintf (m_outfile, " AS%u", MEM_ADDR_SPACE (in_rtx));
978 fputc (']', m_outfile);
979 break;
981 case CONST_DOUBLE:
982 if (FLOAT_MODE_P (GET_MODE (in_rtx)))
984 char s[60];
986 real_to_decimal (s, CONST_DOUBLE_REAL_VALUE (in_rtx),
987 sizeof (s), 0, 1);
988 fprintf (m_outfile, " %s", s);
990 real_to_hexadecimal (s, CONST_DOUBLE_REAL_VALUE (in_rtx),
991 sizeof (s), 0, 1);
992 fprintf (m_outfile, " [%s]", s);
994 break;
996 case CONST_WIDE_INT:
997 fprintf (m_outfile, " ");
998 cwi_output_hex (m_outfile, in_rtx);
999 break;
1001 case CONST_POLY_INT:
1002 fprintf (m_outfile, " [");
1003 print_dec (CONST_POLY_INT_COEFFS (in_rtx)[0], m_outfile, SIGNED);
1004 for (unsigned int i = 1; i < NUM_POLY_INT_COEFFS; ++i)
1006 fprintf (m_outfile, ", ");
1007 print_dec (CONST_POLY_INT_COEFFS (in_rtx)[i], m_outfile, SIGNED);
1009 fprintf (m_outfile, "]");
1010 break;
1011 #endif
1013 case CODE_LABEL:
1014 if (!m_compact)
1015 fprintf (m_outfile, " [%d uses]", LABEL_NUSES (in_rtx));
1016 switch (LABEL_KIND (in_rtx))
1018 case LABEL_NORMAL: break;
1019 case LABEL_STATIC_ENTRY: fputs (" [entry]", m_outfile); break;
1020 case LABEL_GLOBAL_ENTRY: fputs (" [global entry]", m_outfile); break;
1021 case LABEL_WEAK_ENTRY: fputs (" [weak entry]", m_outfile); break;
1022 default: gcc_unreachable ();
1024 break;
1026 default:
1027 break;
1030 fputc (')', m_outfile);
1031 m_sawclose = true;
1034 /* Emit a closing parenthesis and newline. */
1036 void
1037 rtx_writer::finish_directive ()
1039 fprintf (m_outfile, ")\n");
1040 m_sawclose = false;
1043 /* Print an rtx on the current line of FILE. Initially indent IND
1044 characters. */
1046 void
1047 print_inline_rtx (FILE *outf, const_rtx x, int ind)
1049 rtx_writer w (outf, ind, false, false, NULL);
1050 w.print_rtx (x);
1053 /* Call this function from the debugger to see what X looks like. */
1055 DEBUG_FUNCTION void
1056 debug_rtx (const_rtx x)
1058 rtx_writer w (stderr, 0, false, false, NULL);
1059 w.print_rtx (x);
1060 fprintf (stderr, "\n");
1063 /* Dump rtx REF. */
1065 DEBUG_FUNCTION void
1066 debug (const rtx_def &ref)
1068 debug_rtx (&ref);
1071 DEBUG_FUNCTION void
1072 debug (const rtx_def *ptr)
1074 if (ptr)
1075 debug (*ptr);
1076 else
1077 fprintf (stderr, "<nil>\n");
1080 /* Like debug_rtx but with no newline, as debug_helper will add one.
1082 Note: No debug_slim(rtx_insn *) variant implemented, as this
1083 function can serve for both rtx and rtx_insn. */
1085 static void
1086 debug_slim (const_rtx x)
1088 rtx_writer w (stderr, 0, false, false, NULL);
1089 w.print_rtx (x);
1092 DEFINE_DEBUG_VEC (rtx_def *)
1093 DEFINE_DEBUG_VEC (rtx_insn *)
1094 DEFINE_DEBUG_HASH_SET (rtx_def *)
1095 DEFINE_DEBUG_HASH_SET (rtx_insn *)
1097 /* Count of rtx's to print with debug_rtx_list.
1098 This global exists because gdb user defined commands have no arguments. */
1100 DEBUG_VARIABLE int debug_rtx_count = 0; /* 0 is treated as equivalent to 1 */
1102 /* Call this function to print list from X on.
1104 N is a count of the rtx's to print. Positive values print from the specified
1105 rtx_insn on. Negative values print a window around the rtx_insn.
1106 EG: -5 prints 2 rtx_insn's on either side (in addition to the specified
1107 rtx_insn). */
1109 DEBUG_FUNCTION void
1110 debug_rtx_list (const rtx_insn *x, int n)
1112 int i,count;
1113 const rtx_insn *insn;
1115 count = n == 0 ? 1 : n < 0 ? -n : n;
1117 /* If we are printing a window, back up to the start. */
1119 if (n < 0)
1120 for (i = count / 2; i > 0; i--)
1122 if (PREV_INSN (x) == 0)
1123 break;
1124 x = PREV_INSN (x);
1127 for (i = count, insn = x; i > 0 && insn != 0; i--, insn = NEXT_INSN (insn))
1129 debug_rtx (insn);
1130 fprintf (stderr, "\n");
1134 /* Call this function to print an rtx_insn list from START to END
1135 inclusive. */
1137 DEBUG_FUNCTION void
1138 debug_rtx_range (const rtx_insn *start, const rtx_insn *end)
1140 while (1)
1142 debug_rtx (start);
1143 fprintf (stderr, "\n");
1144 if (!start || start == end)
1145 break;
1146 start = NEXT_INSN (start);
1150 /* Call this function to search an rtx_insn list to find one with insn uid UID,
1151 and then call debug_rtx_list to print it, using DEBUG_RTX_COUNT.
1152 The found insn is returned to enable further debugging analysis. */
1154 DEBUG_FUNCTION const rtx_insn *
1155 debug_rtx_find (const rtx_insn *x, int uid)
1157 while (x != 0 && INSN_UID (x) != uid)
1158 x = NEXT_INSN (x);
1159 if (x != 0)
1161 debug_rtx_list (x, debug_rtx_count);
1162 return x;
1164 else
1166 fprintf (stderr, "insn uid %d not found\n", uid);
1167 return 0;
1171 /* External entry point for printing a chain of insns
1172 starting with RTX_FIRST.
1173 A blank line separates insns.
1175 If RTX_FIRST is not an insn, then it alone is printed, with no newline. */
1177 void
1178 rtx_writer::print_rtl (const_rtx rtx_first)
1180 const rtx_insn *tmp_rtx;
1182 if (rtx_first == 0)
1184 fputs (print_rtx_head, m_outfile);
1185 fputs ("(nil)\n", m_outfile);
1187 else
1188 switch (GET_CODE (rtx_first))
1190 case INSN:
1191 case JUMP_INSN:
1192 case CALL_INSN:
1193 case NOTE:
1194 case CODE_LABEL:
1195 case JUMP_TABLE_DATA:
1196 case BARRIER:
1197 for (tmp_rtx = as_a <const rtx_insn *> (rtx_first);
1198 tmp_rtx != 0;
1199 tmp_rtx = NEXT_INSN (tmp_rtx))
1201 fputs (print_rtx_head, m_outfile);
1202 print_rtx (tmp_rtx);
1203 fprintf (m_outfile, "\n");
1205 break;
1207 default:
1208 fputs (print_rtx_head, m_outfile);
1209 print_rtx (rtx_first);
1213 /* External entry point for printing a chain of insns
1214 starting with RTX_FIRST onto file OUTF.
1215 A blank line separates insns.
1217 If RTX_FIRST is not an insn, then it alone is printed, with no newline. */
1219 void
1220 print_rtl (FILE *outf, const_rtx rtx_first)
1222 rtx_writer w (outf, 0, false, false, NULL);
1223 w.print_rtl (rtx_first);
1226 /* Like print_rtx, except specify a file. */
1228 void
1229 print_rtl_single (FILE *outf, const_rtx x)
1231 rtx_writer w (outf, 0, false, false, NULL);
1232 w.print_rtl_single_with_indent (x, 0);
1235 /* Like print_rtl_single, except specify an indentation. */
1237 void
1238 rtx_writer::print_rtl_single_with_indent (const_rtx x, int ind)
1240 char *s_indent = (char *) alloca ((size_t) ind + 1);
1241 memset ((void *) s_indent, ' ', (size_t) ind);
1242 s_indent[ind] = '\0';
1243 fputs (s_indent, m_outfile);
1244 fputs (print_rtx_head, m_outfile);
1246 int old_indent = m_indent;
1247 m_indent = ind;
1248 m_sawclose = false;
1249 print_rtx (x);
1250 putc ('\n', m_outfile);
1251 m_indent = old_indent;
1255 /* Like print_rtl except without all the detail; for example,
1256 if RTX is a CONST_INT then print in decimal format. */
1258 void
1259 print_simple_rtl (FILE *outf, const_rtx x)
1261 rtx_writer w (outf, 0, true, false, NULL);
1262 w.print_rtl (x);
1265 /* Print the elements of VEC to FILE. */
1267 void
1268 print_rtx_insn_vec (FILE *file, const vec<rtx_insn *> &vec)
1270 fputc('{', file);
1272 unsigned int len = vec.length ();
1273 for (unsigned int i = 0; i < len; i++)
1275 print_rtl_single (file, vec[i]);
1276 if (i < len - 1)
1277 fputs (", ", file);
1280 fputc ('}', file);
1283 #ifndef GENERATOR_FILE
1284 /* The functions below try to print RTL in a form resembling assembler
1285 mnemonics. Because this form is more concise than the "traditional" form
1286 of RTL printing in Lisp-style, the form printed by this file is called
1287 "slim". RTL dumps in slim format can be obtained by appending the "-slim"
1288 option to -fdump-rtl-<pass>. Control flow graph output as a DOT file is
1289 always printed in slim form.
1291 The normal interface to the functionality provided in this pretty-printer
1292 is through the dump_*_slim functions to print to a stream, or via the
1293 print_*_slim functions to print into a user's pretty-printer.
1295 It is also possible to obtain a string for a single pattern as a string
1296 pointer, via str_pattern_slim, but this usage is discouraged. */
1298 /* This recognizes rtx'en classified as expressions. These are always
1299 represent some action on values or results of other expression, that
1300 may be stored in objects representing values. */
1302 static void
1303 print_exp (pretty_printer *pp, const_rtx x, int verbose)
1305 const char *st[4];
1306 const char *fun;
1307 rtx op[4];
1308 int i;
1310 fun = (char *) 0;
1311 for (i = 0; i < 4; i++)
1313 st[i] = (char *) 0;
1314 op[i] = NULL_RTX;
1317 switch (GET_CODE (x))
1319 case PLUS:
1320 op[0] = XEXP (x, 0);
1321 if (CONST_INT_P (XEXP (x, 1))
1322 && INTVAL (XEXP (x, 1)) < 0)
1324 st[1] = "-";
1325 op[1] = GEN_INT (-INTVAL (XEXP (x, 1)));
1327 else
1329 st[1] = "+";
1330 op[1] = XEXP (x, 1);
1332 break;
1333 case LO_SUM:
1334 op[0] = XEXP (x, 0);
1335 st[1] = "+low(";
1336 op[1] = XEXP (x, 1);
1337 st[2] = ")";
1338 break;
1339 case MINUS:
1340 op[0] = XEXP (x, 0);
1341 st[1] = "-";
1342 op[1] = XEXP (x, 1);
1343 break;
1344 case COMPARE:
1345 fun = "cmp";
1346 op[0] = XEXP (x, 0);
1347 op[1] = XEXP (x, 1);
1348 break;
1349 case NEG:
1350 st[0] = "-";
1351 op[0] = XEXP (x, 0);
1352 break;
1353 case FMA:
1354 st[0] = "{";
1355 op[0] = XEXP (x, 0);
1356 st[1] = "*";
1357 op[1] = XEXP (x, 1);
1358 st[2] = "+";
1359 op[2] = XEXP (x, 2);
1360 st[3] = "}";
1361 break;
1362 case MULT:
1363 op[0] = XEXP (x, 0);
1364 st[1] = "*";
1365 op[1] = XEXP (x, 1);
1366 break;
1367 case DIV:
1368 op[0] = XEXP (x, 0);
1369 st[1] = "/";
1370 op[1] = XEXP (x, 1);
1371 break;
1372 case UDIV:
1373 fun = "udiv";
1374 op[0] = XEXP (x, 0);
1375 op[1] = XEXP (x, 1);
1376 break;
1377 case MOD:
1378 op[0] = XEXP (x, 0);
1379 st[1] = "%";
1380 op[1] = XEXP (x, 1);
1381 break;
1382 case UMOD:
1383 fun = "umod";
1384 op[0] = XEXP (x, 0);
1385 op[1] = XEXP (x, 1);
1386 break;
1387 case SMIN:
1388 fun = "smin";
1389 op[0] = XEXP (x, 0);
1390 op[1] = XEXP (x, 1);
1391 break;
1392 case SMAX:
1393 fun = "smax";
1394 op[0] = XEXP (x, 0);
1395 op[1] = XEXP (x, 1);
1396 break;
1397 case UMIN:
1398 fun = "umin";
1399 op[0] = XEXP (x, 0);
1400 op[1] = XEXP (x, 1);
1401 break;
1402 case UMAX:
1403 fun = "umax";
1404 op[0] = XEXP (x, 0);
1405 op[1] = XEXP (x, 1);
1406 break;
1407 case NOT:
1408 st[0] = "~";
1409 op[0] = XEXP (x, 0);
1410 break;
1411 case AND:
1412 op[0] = XEXP (x, 0);
1413 st[1] = "&";
1414 op[1] = XEXP (x, 1);
1415 break;
1416 case IOR:
1417 op[0] = XEXP (x, 0);
1418 st[1] = "|";
1419 op[1] = XEXP (x, 1);
1420 break;
1421 case XOR:
1422 op[0] = XEXP (x, 0);
1423 st[1] = "^";
1424 op[1] = XEXP (x, 1);
1425 break;
1426 case ASHIFT:
1427 op[0] = XEXP (x, 0);
1428 st[1] = "<<";
1429 op[1] = XEXP (x, 1);
1430 break;
1431 case LSHIFTRT:
1432 op[0] = XEXP (x, 0);
1433 st[1] = " 0>>";
1434 op[1] = XEXP (x, 1);
1435 break;
1436 case ASHIFTRT:
1437 op[0] = XEXP (x, 0);
1438 st[1] = ">>";
1439 op[1] = XEXP (x, 1);
1440 break;
1441 case ROTATE:
1442 op[0] = XEXP (x, 0);
1443 st[1] = "<-<";
1444 op[1] = XEXP (x, 1);
1445 break;
1446 case ROTATERT:
1447 op[0] = XEXP (x, 0);
1448 st[1] = ">->";
1449 op[1] = XEXP (x, 1);
1450 break;
1451 case NE:
1452 op[0] = XEXP (x, 0);
1453 st[1] = "!=";
1454 op[1] = XEXP (x, 1);
1455 break;
1456 case EQ:
1457 op[0] = XEXP (x, 0);
1458 st[1] = "==";
1459 op[1] = XEXP (x, 1);
1460 break;
1461 case GE:
1462 op[0] = XEXP (x, 0);
1463 st[1] = ">=";
1464 op[1] = XEXP (x, 1);
1465 break;
1466 case GT:
1467 op[0] = XEXP (x, 0);
1468 st[1] = ">";
1469 op[1] = XEXP (x, 1);
1470 break;
1471 case LE:
1472 op[0] = XEXP (x, 0);
1473 st[1] = "<=";
1474 op[1] = XEXP (x, 1);
1475 break;
1476 case LT:
1477 op[0] = XEXP (x, 0);
1478 st[1] = "<";
1479 op[1] = XEXP (x, 1);
1480 break;
1481 case SIGN_EXTRACT:
1482 fun = (verbose) ? "sign_extract" : "sxt";
1483 op[0] = XEXP (x, 0);
1484 op[1] = XEXP (x, 1);
1485 op[2] = XEXP (x, 2);
1486 break;
1487 case ZERO_EXTRACT:
1488 fun = (verbose) ? "zero_extract" : "zxt";
1489 op[0] = XEXP (x, 0);
1490 op[1] = XEXP (x, 1);
1491 op[2] = XEXP (x, 2);
1492 break;
1493 case SIGN_EXTEND:
1494 fun = (verbose) ? "sign_extend" : "sxn";
1495 op[0] = XEXP (x, 0);
1496 break;
1497 case ZERO_EXTEND:
1498 fun = (verbose) ? "zero_extend" : "zxn";
1499 op[0] = XEXP (x, 0);
1500 break;
1501 case FLOAT_EXTEND:
1502 fun = (verbose) ? "float_extend" : "fxn";
1503 op[0] = XEXP (x, 0);
1504 break;
1505 case TRUNCATE:
1506 fun = (verbose) ? "trunc" : "trn";
1507 op[0] = XEXP (x, 0);
1508 break;
1509 case FLOAT_TRUNCATE:
1510 fun = (verbose) ? "float_trunc" : "ftr";
1511 op[0] = XEXP (x, 0);
1512 break;
1513 case FLOAT:
1514 fun = (verbose) ? "float" : "flt";
1515 op[0] = XEXP (x, 0);
1516 break;
1517 case UNSIGNED_FLOAT:
1518 fun = (verbose) ? "uns_float" : "ufl";
1519 op[0] = XEXP (x, 0);
1520 break;
1521 case FIX:
1522 fun = "fix";
1523 op[0] = XEXP (x, 0);
1524 break;
1525 case UNSIGNED_FIX:
1526 fun = (verbose) ? "uns_fix" : "ufx";
1527 op[0] = XEXP (x, 0);
1528 break;
1529 case PRE_DEC:
1530 st[0] = "--";
1531 op[0] = XEXP (x, 0);
1532 break;
1533 case PRE_INC:
1534 st[0] = "++";
1535 op[0] = XEXP (x, 0);
1536 break;
1537 case POST_DEC:
1538 op[0] = XEXP (x, 0);
1539 st[1] = "--";
1540 break;
1541 case POST_INC:
1542 op[0] = XEXP (x, 0);
1543 st[1] = "++";
1544 break;
1545 case PRE_MODIFY:
1546 st[0] = "pre ";
1547 op[0] = XEXP (XEXP (x, 1), 0);
1548 st[1] = "+=";
1549 op[1] = XEXP (XEXP (x, 1), 1);
1550 break;
1551 case POST_MODIFY:
1552 st[0] = "post ";
1553 op[0] = XEXP (XEXP (x, 1), 0);
1554 st[1] = "+=";
1555 op[1] = XEXP (XEXP (x, 1), 1);
1556 break;
1557 case CALL:
1558 st[0] = "call ";
1559 op[0] = XEXP (x, 0);
1560 if (verbose)
1562 st[1] = " argc:";
1563 op[1] = XEXP (x, 1);
1565 break;
1566 case IF_THEN_ELSE:
1567 st[0] = "{(";
1568 op[0] = XEXP (x, 0);
1569 st[1] = ")?";
1570 op[1] = XEXP (x, 1);
1571 st[2] = ":";
1572 op[2] = XEXP (x, 2);
1573 st[3] = "}";
1574 break;
1575 case TRAP_IF:
1576 fun = "trap_if";
1577 op[0] = TRAP_CONDITION (x);
1578 break;
1579 case PREFETCH:
1580 fun = "prefetch";
1581 op[0] = XEXP (x, 0);
1582 op[1] = XEXP (x, 1);
1583 op[2] = XEXP (x, 2);
1584 break;
1585 case UNSPEC:
1586 case UNSPEC_VOLATILE:
1588 pp_string (pp, "unspec");
1589 if (GET_CODE (x) == UNSPEC_VOLATILE)
1590 pp_string (pp, "/v");
1591 pp_left_bracket (pp);
1592 for (i = 0; i < XVECLEN (x, 0); i++)
1594 if (i != 0)
1595 pp_comma (pp);
1596 print_pattern (pp, XVECEXP (x, 0, i), verbose);
1598 pp_string (pp, "] ");
1599 pp_decimal_int (pp, XINT (x, 1));
1601 break;
1602 default:
1604 /* Most unhandled codes can be printed as pseudo-functions. */
1605 if (GET_RTX_CLASS (GET_CODE (x)) == RTX_UNARY)
1607 fun = GET_RTX_NAME (GET_CODE (x));
1608 op[0] = XEXP (x, 0);
1610 else if (GET_RTX_CLASS (GET_CODE (x)) == RTX_COMPARE
1611 || GET_RTX_CLASS (GET_CODE (x)) == RTX_COMM_COMPARE
1612 || GET_RTX_CLASS (GET_CODE (x)) == RTX_BIN_ARITH
1613 || GET_RTX_CLASS (GET_CODE (x)) == RTX_COMM_ARITH)
1615 fun = GET_RTX_NAME (GET_CODE (x));
1616 op[0] = XEXP (x, 0);
1617 op[1] = XEXP (x, 1);
1619 else if (GET_RTX_CLASS (GET_CODE (x)) == RTX_TERNARY)
1621 fun = GET_RTX_NAME (GET_CODE (x));
1622 op[0] = XEXP (x, 0);
1623 op[1] = XEXP (x, 1);
1624 op[2] = XEXP (x, 2);
1626 else
1627 /* Give up, just print the RTX name. */
1628 st[0] = GET_RTX_NAME (GET_CODE (x));
1630 break;
1633 /* Print this as a function? */
1634 if (fun)
1636 pp_string (pp, fun);
1637 pp_left_paren (pp);
1640 for (i = 0; i < 4; i++)
1642 if (st[i])
1643 pp_string (pp, st[i]);
1645 if (op[i])
1647 if (fun && i != 0)
1648 pp_comma (pp);
1649 print_value (pp, op[i], verbose);
1653 if (fun)
1654 pp_right_paren (pp);
1655 } /* print_exp */
1657 /* Prints rtxes, I customarily classified as values. They're constants,
1658 registers, labels, symbols and memory accesses. */
1660 void
1661 print_value (pretty_printer *pp, const_rtx x, int verbose)
1663 char tmp[1024];
1665 if (!x)
1667 pp_string (pp, "(nil)");
1668 return;
1670 switch (GET_CODE (x))
1672 case CONST_INT:
1673 pp_scalar (pp, HOST_WIDE_INT_PRINT_HEX,
1674 (unsigned HOST_WIDE_INT) INTVAL (x));
1675 break;
1677 case CONST_WIDE_INT:
1679 const char *sep = "<";
1680 int i;
1681 for (i = CONST_WIDE_INT_NUNITS (x) - 1; i >= 0; i--)
1683 pp_string (pp, sep);
1684 sep = ",";
1685 sprintf (tmp, HOST_WIDE_INT_PRINT_HEX,
1686 (unsigned HOST_WIDE_INT) CONST_WIDE_INT_ELT (x, i));
1687 pp_string (pp, tmp);
1689 pp_greater (pp);
1691 break;
1693 case CONST_POLY_INT:
1694 pp_left_bracket (pp);
1695 pp_wide_int (pp, CONST_POLY_INT_COEFFS (x)[0], SIGNED);
1696 for (unsigned int i = 1; i < NUM_POLY_INT_COEFFS; ++i)
1698 pp_string (pp, ", ");
1699 pp_wide_int (pp, CONST_POLY_INT_COEFFS (x)[i], SIGNED);
1701 pp_right_bracket (pp);
1702 break;
1704 case CONST_DOUBLE:
1705 if (FLOAT_MODE_P (GET_MODE (x)))
1707 real_to_decimal (tmp, CONST_DOUBLE_REAL_VALUE (x),
1708 sizeof (tmp), 0, 1);
1709 pp_string (pp, tmp);
1711 else
1712 pp_printf (pp, "<%wx,%wx>",
1713 (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x),
1714 (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (x));
1715 break;
1716 case CONST_FIXED:
1717 fixed_to_decimal (tmp, CONST_FIXED_VALUE (x), sizeof (tmp));
1718 pp_string (pp, tmp);
1719 break;
1720 case CONST_STRING:
1721 pp_string (pp, "\"");
1722 pretty_print_string (pp, XSTR (x, 0), strlen (XSTR (x, 0)));
1723 pp_string (pp, "\"");
1724 break;
1725 case SYMBOL_REF:
1726 pp_printf (pp, "`%s'", XSTR (x, 0));
1727 break;
1728 case LABEL_REF:
1729 pp_printf (pp, "L%d", INSN_UID (label_ref_label (x)));
1730 break;
1731 case CONST:
1732 case HIGH:
1733 case STRICT_LOW_PART:
1734 pp_printf (pp, "%s(", GET_RTX_NAME (GET_CODE (x)));
1735 print_value (pp, XEXP (x, 0), verbose);
1736 pp_right_paren (pp);
1737 break;
1738 case REG:
1739 if (REGNO (x) < FIRST_PSEUDO_REGISTER)
1741 if (ISDIGIT (reg_names[REGNO (x)][0]))
1742 pp_modulo (pp);
1743 pp_string (pp, reg_names[REGNO (x)]);
1745 else
1746 pp_printf (pp, "r%d", REGNO (x));
1747 if (verbose)
1748 pp_printf (pp, ":%s", GET_MODE_NAME (GET_MODE (x)));
1749 break;
1750 case SUBREG:
1751 print_value (pp, SUBREG_REG (x), verbose);
1752 pp_printf (pp, "#");
1753 pp_wide_integer (pp, SUBREG_BYTE (x));
1754 break;
1755 case SCRATCH:
1756 case PC:
1757 pp_string (pp, GET_RTX_NAME (GET_CODE (x)));
1758 break;
1759 case MEM:
1760 pp_left_bracket (pp);
1761 print_value (pp, XEXP (x, 0), verbose);
1762 pp_right_bracket (pp);
1763 break;
1764 case DEBUG_EXPR:
1765 pp_printf (pp, "D#%i", DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x)));
1766 break;
1767 default:
1768 print_exp (pp, x, verbose);
1769 break;
1771 } /* print_value */
1773 /* The next step in insn detalization, its pattern recognition. */
1775 void
1776 print_pattern (pretty_printer *pp, const_rtx x, int verbose)
1778 if (! x)
1780 pp_string (pp, "(nil)");
1781 return;
1784 switch (GET_CODE (x))
1786 case SET:
1787 print_value (pp, SET_DEST (x), verbose);
1788 pp_equal (pp);
1789 print_value (pp, SET_SRC (x), verbose);
1790 break;
1791 case RETURN:
1792 case SIMPLE_RETURN:
1793 case EH_RETURN:
1794 pp_string (pp, GET_RTX_NAME (GET_CODE (x)));
1795 break;
1796 case CALL:
1797 print_exp (pp, x, verbose);
1798 break;
1799 case CLOBBER:
1800 case USE:
1801 pp_printf (pp, "%s ", GET_RTX_NAME (GET_CODE (x)));
1802 print_value (pp, XEXP (x, 0), verbose);
1803 break;
1804 case VAR_LOCATION:
1805 pp_string (pp, "loc ");
1806 print_value (pp, PAT_VAR_LOCATION_LOC (x), verbose);
1807 break;
1808 case COND_EXEC:
1809 pp_left_paren (pp);
1810 if (GET_CODE (COND_EXEC_TEST (x)) == NE
1811 && XEXP (COND_EXEC_TEST (x), 1) == const0_rtx)
1812 print_value (pp, XEXP (COND_EXEC_TEST (x), 0), verbose);
1813 else if (GET_CODE (COND_EXEC_TEST (x)) == EQ
1814 && XEXP (COND_EXEC_TEST (x), 1) == const0_rtx)
1816 pp_exclamation (pp);
1817 print_value (pp, XEXP (COND_EXEC_TEST (x), 0), verbose);
1819 else
1820 print_value (pp, COND_EXEC_TEST (x), verbose);
1821 pp_string (pp, ") ");
1822 print_pattern (pp, COND_EXEC_CODE (x), verbose);
1823 break;
1824 case PARALLEL:
1826 int i;
1828 pp_left_brace (pp);
1829 for (i = 0; i < XVECLEN (x, 0); i++)
1831 print_pattern (pp, XVECEXP (x, 0, i), verbose);
1832 pp_semicolon (pp);
1834 pp_right_brace (pp);
1836 break;
1837 case SEQUENCE:
1839 const rtx_sequence *seq = as_a <const rtx_sequence *> (x);
1840 pp_string (pp, "sequence{");
1841 if (INSN_P (seq->element (0)))
1843 /* Print the sequence insns indented. */
1844 const char * save_print_rtx_head = print_rtx_head;
1845 char indented_print_rtx_head[32];
1847 pp_newline (pp);
1848 gcc_assert (strlen (print_rtx_head) < sizeof (indented_print_rtx_head) - 4);
1849 snprintf (indented_print_rtx_head,
1850 sizeof (indented_print_rtx_head),
1851 "%s ", print_rtx_head);
1852 print_rtx_head = indented_print_rtx_head;
1853 for (int i = 0; i < seq->len (); i++)
1854 print_insn_with_notes (pp, seq->insn (i));
1855 pp_printf (pp, "%s ", save_print_rtx_head);
1856 print_rtx_head = save_print_rtx_head;
1858 else
1860 for (int i = 0; i < seq->len (); i++)
1862 print_pattern (pp, seq->element (i), verbose);
1863 pp_semicolon (pp);
1866 pp_right_brace (pp);
1868 break;
1869 case ASM_INPUT:
1870 pp_printf (pp, "asm {%s}", XSTR (x, 0));
1871 break;
1872 case ADDR_VEC:
1873 for (int i = 0; i < XVECLEN (x, 0); i++)
1875 print_value (pp, XVECEXP (x, 0, i), verbose);
1876 pp_semicolon (pp);
1878 break;
1879 case ADDR_DIFF_VEC:
1880 for (int i = 0; i < XVECLEN (x, 1); i++)
1882 print_value (pp, XVECEXP (x, 1, i), verbose);
1883 pp_semicolon (pp);
1885 break;
1886 case TRAP_IF:
1887 pp_string (pp, "trap_if ");
1888 print_value (pp, TRAP_CONDITION (x), verbose);
1889 break;
1890 case UNSPEC:
1891 case UNSPEC_VOLATILE:
1892 /* Fallthru -- leave UNSPECs to print_exp. */
1893 default:
1894 print_value (pp, x, verbose);
1896 } /* print_pattern */
1898 /* This is the main function in slim rtl visualization mechanism.
1900 X is an insn, to be printed into PP.
1902 This function tries to print it properly in human-readable form,
1903 resembling assembler mnemonics (instead of the older Lisp-style
1904 form).
1906 If VERBOSE is TRUE, insns are printed with more complete (but
1907 longer) pattern names and with extra information, and prefixed
1908 with their INSN_UIDs. */
1910 void
1911 print_insn (pretty_printer *pp, const rtx_insn *x, int verbose)
1913 if (verbose)
1915 /* Blech, pretty-print can't print integers with a specified width. */
1916 char uid_prefix[32];
1917 snprintf (uid_prefix, sizeof uid_prefix, " %4d: ", INSN_UID (x));
1918 pp_string (pp, uid_prefix);
1921 switch (GET_CODE (x))
1923 case INSN:
1924 print_pattern (pp, PATTERN (x), verbose);
1925 break;
1927 case DEBUG_INSN:
1929 if (DEBUG_MARKER_INSN_P (x))
1931 switch (INSN_DEBUG_MARKER_KIND (x))
1933 case NOTE_INSN_BEGIN_STMT:
1934 pp_string (pp, "debug begin stmt marker");
1935 break;
1937 case NOTE_INSN_INLINE_ENTRY:
1938 pp_string (pp, "debug inline entry marker");
1939 break;
1941 default:
1942 gcc_unreachable ();
1944 break;
1947 const char *name = "?";
1948 char idbuf[32];
1950 if (DECL_P (INSN_VAR_LOCATION_DECL (x)))
1952 tree id = DECL_NAME (INSN_VAR_LOCATION_DECL (x));
1953 if (id)
1954 name = IDENTIFIER_POINTER (id);
1955 else if (TREE_CODE (INSN_VAR_LOCATION_DECL (x))
1956 == DEBUG_EXPR_DECL)
1958 sprintf (idbuf, "D#%i",
1959 DEBUG_TEMP_UID (INSN_VAR_LOCATION_DECL (x)));
1960 name = idbuf;
1962 else
1964 sprintf (idbuf, "D.%i",
1965 DECL_UID (INSN_VAR_LOCATION_DECL (x)));
1966 name = idbuf;
1969 pp_printf (pp, "debug %s => ", name);
1970 if (VAR_LOC_UNKNOWN_P (INSN_VAR_LOCATION_LOC (x)))
1971 pp_string (pp, "optimized away");
1972 else
1973 print_pattern (pp, INSN_VAR_LOCATION_LOC (x), verbose);
1975 break;
1977 case JUMP_INSN:
1978 print_pattern (pp, PATTERN (x), verbose);
1979 break;
1980 case CALL_INSN:
1981 if (GET_CODE (PATTERN (x)) == PARALLEL)
1982 print_pattern (pp, XVECEXP (PATTERN (x), 0, 0), verbose);
1983 else
1984 print_pattern (pp, PATTERN (x), verbose);
1985 break;
1986 case CODE_LABEL:
1987 pp_printf (pp, "L%d:", INSN_UID (x));
1988 break;
1989 case JUMP_TABLE_DATA:
1990 pp_string (pp, "jump_table_data{\n");
1991 print_pattern (pp, PATTERN (x), verbose);
1992 pp_right_brace (pp);
1993 break;
1994 case BARRIER:
1995 pp_string (pp, "barrier");
1996 break;
1997 case NOTE:
1999 pp_string (pp, GET_NOTE_INSN_NAME (NOTE_KIND (x)));
2000 switch (NOTE_KIND (x))
2002 case NOTE_INSN_EH_REGION_BEG:
2003 case NOTE_INSN_EH_REGION_END:
2004 pp_printf (pp, " %d", NOTE_EH_HANDLER (x));
2005 break;
2007 case NOTE_INSN_BLOCK_BEG:
2008 case NOTE_INSN_BLOCK_END:
2009 pp_printf (pp, " %d", BLOCK_NUMBER (NOTE_BLOCK (x)));
2010 break;
2012 case NOTE_INSN_BASIC_BLOCK:
2013 pp_printf (pp, " %d", NOTE_BASIC_BLOCK (x)->index);
2014 break;
2016 case NOTE_INSN_DELETED_LABEL:
2017 case NOTE_INSN_DELETED_DEBUG_LABEL:
2019 const char *label = NOTE_DELETED_LABEL_NAME (x);
2020 if (label == NULL)
2021 label = "";
2022 pp_printf (pp, " (\"%s\")", label);
2024 break;
2026 case NOTE_INSN_VAR_LOCATION:
2027 pp_left_brace (pp);
2028 print_pattern (pp, NOTE_VAR_LOCATION (x), verbose);
2029 pp_right_brace (pp);
2030 break;
2032 default:
2033 break;
2035 break;
2037 default:
2038 gcc_unreachable ();
2040 } /* print_insn */
2042 /* Pretty-print a slim dump of X (an insn) to PP, including any register
2043 note attached to the instruction. */
2045 void
2046 print_insn_with_notes (pretty_printer *pp, const rtx_insn *x)
2048 pp_string (pp, print_rtx_head);
2049 print_insn (pp, x, 1);
2050 pp_newline (pp);
2051 if (INSN_P (x) && REG_NOTES (x))
2052 for (rtx note = REG_NOTES (x); note; note = XEXP (note, 1))
2054 pp_printf (pp, "%s %s ", print_rtx_head,
2055 GET_REG_NOTE_NAME (REG_NOTE_KIND (note)));
2056 if (GET_CODE (note) == INT_LIST)
2057 pp_printf (pp, "%d", XINT (note, 0));
2058 else
2059 print_pattern (pp, XEXP (note, 0), 1);
2060 pp_newline (pp);
2064 /* Print X, an RTL value node, to file F in slim format. Include
2065 additional information if VERBOSE is nonzero.
2067 Value nodes are constants, registers, labels, symbols and
2068 memory. */
2070 void
2071 dump_value_slim (FILE *f, const_rtx x, int verbose)
2073 pretty_printer rtl_slim_pp;
2074 rtl_slim_pp.set_output_stream (f);
2075 print_value (&rtl_slim_pp, x, verbose);
2076 pp_flush (&rtl_slim_pp);
2079 /* Emit a slim dump of X (an insn) to the file F, including any register
2080 note attached to the instruction. */
2081 void
2082 dump_insn_slim (FILE *f, const rtx_insn *x)
2084 pretty_printer rtl_slim_pp;
2085 rtl_slim_pp.set_output_stream (f);
2086 print_insn_with_notes (&rtl_slim_pp, x);
2087 pp_flush (&rtl_slim_pp);
2090 /* Same as above, but stop at LAST or when COUNT == 0.
2091 If COUNT < 0 it will stop only at LAST or NULL rtx. */
2093 void
2094 dump_rtl_slim (FILE *f, const rtx_insn *first, const rtx_insn *last,
2095 int count, int flags ATTRIBUTE_UNUSED)
2097 const rtx_insn *insn, *tail;
2098 pretty_printer rtl_slim_pp;
2099 rtl_slim_pp.set_output_stream (f);
2101 tail = last ? NEXT_INSN (last) : NULL;
2102 for (insn = first;
2103 (insn != NULL) && (insn != tail) && (count != 0);
2104 insn = NEXT_INSN (insn))
2106 print_insn_with_notes (&rtl_slim_pp, insn);
2107 if (count > 0)
2108 count--;
2111 pp_flush (&rtl_slim_pp);
2114 /* Dumps basic block BB to pretty-printer PP in slim form and without and
2115 no indentation, for use as a label of a DOT graph record-node. */
2117 void
2118 rtl_dump_bb_for_graph (pretty_printer *pp, basic_block bb)
2120 rtx_insn *insn;
2121 bool first = true;
2123 /* TODO: inter-bb stuff. */
2124 FOR_BB_INSNS (bb, insn)
2126 if (! first)
2128 pp_bar (pp);
2129 pp_write_text_to_stream (pp);
2131 first = false;
2132 print_insn_with_notes (pp, insn);
2133 pp_write_text_as_dot_label_to_stream (pp, /*for_record=*/true);
2137 /* Pretty-print pattern X of some insn in non-verbose mode.
2138 Return a string pointer to the pretty-printer buffer.
2140 This function is only exported exists only to accommodate some older users
2141 of the slim RTL pretty printers. Please do not use it for new code. */
2143 const char *
2144 str_pattern_slim (const_rtx x)
2146 pretty_printer rtl_slim_pp;
2147 print_pattern (&rtl_slim_pp, x, 0);
2148 return ggc_strdup (pp_formatted_text (&rtl_slim_pp));
2151 /* Emit a slim dump of X (an insn) to stderr. */
2152 extern void debug_insn_slim (const rtx_insn *);
2153 DEBUG_FUNCTION void
2154 debug_insn_slim (const rtx_insn *x)
2156 dump_insn_slim (stderr, x);
2159 /* Same as above, but using dump_rtl_slim. */
2160 extern void debug_rtl_slim (FILE *, const rtx_insn *, const rtx_insn *,
2161 int, int);
2162 DEBUG_FUNCTION void
2163 debug_rtl_slim (const rtx_insn *first, const rtx_insn *last, int count,
2164 int flags)
2166 dump_rtl_slim (stderr, first, last, count, flags);
2169 extern void debug_bb_slim (basic_block);
2170 DEBUG_FUNCTION void
2171 debug_bb_slim (basic_block bb)
2173 debug_bb (bb, TDF_SLIM | TDF_BLOCKS);
2176 extern void debug_bb_n_slim (int);
2177 DEBUG_FUNCTION void
2178 debug_bb_n_slim (int n)
2180 basic_block bb = BASIC_BLOCK_FOR_FN (cfun, n);
2181 debug_bb_slim (bb);
2184 #endif
2186 #if __GNUC__ >= 10
2187 # pragma GCC diagnostic pop
2188 #endif