comparison 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
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
56 /* String printed at beginning of each RTL when it is dumped. 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 57 This string is set to ASM_COMMENT_START when the RTL is dumped in
58 the assembly output file. */ 58 the assembly output file. */
59 const char *print_rtx_head = ""; 59 const char *print_rtx_head = "";
60 60
61 #ifdef GENERATOR_FILE
62 /* These are defined from the .opt file when not used in generator
63 programs. */
64
61 /* Nonzero means suppress output of instruction numbers 65 /* Nonzero means suppress output of instruction numbers
62 in debugging dumps. 66 in debugging dumps.
63 This must be defined here so that programs like gencodes can be linked. */ 67 This must be defined here so that programs like gencodes can be linked. */
64 int flag_dump_unnumbered = 0; 68 int flag_dump_unnumbered = 0;
65 69
66 /* Nonzero means suppress output of instruction numbers for previous 70 /* Nonzero means suppress output of instruction numbers for previous
67 and next insns in debugging dumps. 71 and next insns in debugging dumps.
68 This must be defined here so that programs like gencodes can be linked. */ 72 This must be defined here so that programs like gencodes can be linked. */
69 int flag_dump_unnumbered_links = 0; 73 int flag_dump_unnumbered_links = 0;
74 #endif
70 75
71 /* Nonzero means use simplified format without flags, modes, etc. */ 76 /* Nonzero means use simplified format without flags, modes, etc. */
72 int flag_simple = 0; 77 int flag_simple = 0;
73 78
74 /* Nonzero if we are dumping graphical description. */ 79 /* Nonzero if we are dumping graphical description. */
331 break; 336 break;
332 337
333 case 'e': 338 case 'e':
334 do_e: 339 do_e:
335 indent += 2; 340 indent += 2;
341 if (i == 7 && INSN_P (in_rtx))
342 /* Put REG_NOTES on their own line. */
343 fprintf (outfile, "\n%s%*s",
344 print_rtx_head, indent * 2, "");
336 if (!sawclose) 345 if (!sawclose)
337 fprintf (outfile, " "); 346 fprintf (outfile, " ");
338 print_rtx (XEXP (in_rtx, i)); 347 print_rtx (XEXP (in_rtx, i));
339 indent -= 2; 348 indent -= 2;
340 break; 349 break;
376 fprintf (outfile, " [" HOST_WIDE_INT_PRINT_HEX "]", 385 fprintf (outfile, " [" HOST_WIDE_INT_PRINT_HEX "]",
377 (unsigned HOST_WIDE_INT) XWINT (in_rtx, i)); 386 (unsigned HOST_WIDE_INT) XWINT (in_rtx, i));
378 break; 387 break;
379 388
380 case 'i': 389 case 'i':
381 if (i == 4 && INSN_P (in_rtx)) 390 if (i == 5 && INSN_P (in_rtx))
382 { 391 {
383 #ifndef GENERATOR_FILE 392 #ifndef GENERATOR_FILE
384 /* Pretty-print insn locators. Ignore scoping as it is mostly 393 /* Pretty-print insn locators. Ignore scoping as it is mostly
385 redundant with line number information and do not print anything 394 redundant with line number information and do not print anything
386 when there is no location information available. */ 395 when there is no location information available. */
409 /* This field is only used for NOTE_INSN_DELETED_LABEL, and 418 /* This field is only used for NOTE_INSN_DELETED_LABEL, and
410 other times often contains garbage from INSN->NOTE death. */ 419 other times often contains garbage from INSN->NOTE death. */
411 if (NOTE_KIND (in_rtx) == NOTE_INSN_DELETED_LABEL) 420 if (NOTE_KIND (in_rtx) == NOTE_INSN_DELETED_LABEL)
412 fprintf (outfile, " %d", XINT (in_rtx, i)); 421 fprintf (outfile, " %d", XINT (in_rtx, i));
413 } 422 }
423 #if !defined(GENERATOR_FILE) && NUM_UNSPECV_VALUES > 0
424 else if (i == 1
425 && GET_CODE (in_rtx) == UNSPEC_VOLATILE
426 && XINT (in_rtx, 1) >= 0
427 && XINT (in_rtx, 1) < NUM_UNSPECV_VALUES)
428 fprintf (outfile, " %s", unspecv_strings[XINT (in_rtx, 1)]);
429 #endif
430 #if !defined(GENERATOR_FILE) && NUM_UNSPEC_VALUES > 0
431 else if (i == 1
432 && (GET_CODE (in_rtx) == UNSPEC
433 || GET_CODE (in_rtx) == UNSPEC_VOLATILE)
434 && XINT (in_rtx, 1) >= 0
435 && XINT (in_rtx, 1) < NUM_UNSPEC_VALUES)
436 fprintf (outfile, " %s", unspec_strings[XINT (in_rtx, 1)]);
437 #endif
414 else 438 else
415 { 439 {
416 int value = XINT (in_rtx, i); 440 int value = XINT (in_rtx, i);
417 const char *name; 441 const char *name;
418 442
431 fprintf (outfile, " %d virtual-stack-dynamic", value); 455 fprintf (outfile, " %d virtual-stack-dynamic", value);
432 else if (value == VIRTUAL_OUTGOING_ARGS_REGNUM) 456 else if (value == VIRTUAL_OUTGOING_ARGS_REGNUM)
433 fprintf (outfile, " %d virtual-outgoing-args", value); 457 fprintf (outfile, " %d virtual-outgoing-args", value);
434 else if (value == VIRTUAL_CFA_REGNUM) 458 else if (value == VIRTUAL_CFA_REGNUM)
435 fprintf (outfile, " %d virtual-cfa", value); 459 fprintf (outfile, " %d virtual-cfa", value);
460 else if (value == VIRTUAL_PREFERRED_STACK_BOUNDARY_REGNUM)
461 fprintf (outfile, " %d virtual-preferred-stack-boundary",
462 value);
436 else 463 else
437 fprintf (outfile, " %d virtual-reg-%d", value, 464 fprintf (outfile, " %d virtual-reg-%d", value,
438 value-FIRST_VIRTUAL_REGISTER); 465 value-FIRST_VIRTUAL_REGISTER);
439 } 466 }
440 else 467 else
512 sawclose = 0; 539 sawclose = 0;
513 break; 540 break;
514 541
515 case 't': 542 case 't':
516 #ifndef GENERATOR_FILE 543 #ifndef GENERATOR_FILE
517 dump_addr (outfile, " ", XTREE (in_rtx, i)); 544 if (i == 0 && GET_CODE (in_rtx) == DEBUG_IMPLICIT_PTR)
545 print_mem_expr (outfile, DEBUG_IMPLICIT_PTR_DECL (in_rtx));
546 else
547 dump_addr (outfile, " ", XTREE (in_rtx, i));
518 #endif 548 #endif
519 break; 549 break;
520 550
521 case '*': 551 case '*':
522 fputs (" Unknown", outfile); 552 fputs (" Unknown", outfile);
624 indent = oldindent; 654 indent = oldindent;
625 } 655 }
626 656
627 /* Call this function from the debugger to see what X looks like. */ 657 /* Call this function from the debugger to see what X looks like. */
628 658
629 void 659 DEBUG_FUNCTION void
630 debug_rtx (const_rtx x) 660 debug_rtx (const_rtx x)
631 { 661 {
632 outfile = stderr; 662 outfile = stderr;
633 sawclose = 0; 663 sawclose = 0;
634 print_rtx (x); 664 print_rtx (x);
636 } 666 }
637 667
638 /* Count of rtx's to print with debug_rtx_list. 668 /* Count of rtx's to print with debug_rtx_list.
639 This global exists because gdb user defined commands have no arguments. */ 669 This global exists because gdb user defined commands have no arguments. */
640 670
641 int debug_rtx_count = 0; /* 0 is treated as equivalent to 1 */ 671 DEBUG_VARIABLE int debug_rtx_count = 0; /* 0 is treated as equivalent to 1 */
642 672
643 /* Call this function to print list from X on. 673 /* Call this function to print list from X on.
644 674
645 N is a count of the rtx's to print. Positive values print from the specified 675 N is a count of the rtx's to print. Positive values print from the specified
646 rtx on. Negative values print a window around the rtx. 676 rtx on. Negative values print a window around the rtx.
647 EG: -5 prints 2 rtx's on either side (in addition to the specified rtx). */ 677 EG: -5 prints 2 rtx's on either side (in addition to the specified rtx). */
648 678
649 void 679 DEBUG_FUNCTION void
650 debug_rtx_list (const_rtx x, int n) 680 debug_rtx_list (const_rtx x, int n)
651 { 681 {
652 int i,count; 682 int i,count;
653 const_rtx insn; 683 const_rtx insn;
654 684
671 } 701 }
672 } 702 }
673 703
674 /* Call this function to print an rtx list from START to END inclusive. */ 704 /* Call this function to print an rtx list from START to END inclusive. */
675 705
676 void 706 DEBUG_FUNCTION void
677 debug_rtx_range (const_rtx start, const_rtx end) 707 debug_rtx_range (const_rtx start, const_rtx end)
678 { 708 {
679 while (1) 709 while (1)
680 { 710 {
681 debug_rtx (start); 711 debug_rtx (start);
688 718
689 /* Call this function to search an rtx list to find one with insn uid UID, 719 /* Call this function to search an rtx list to find one with insn uid UID,
690 and then call debug_rtx_list to print it, using DEBUG_RTX_COUNT. 720 and then call debug_rtx_list to print it, using DEBUG_RTX_COUNT.
691 The found insn is returned to enable further debugging analysis. */ 721 The found insn is returned to enable further debugging analysis. */
692 722
693 const_rtx 723 DEBUG_FUNCTION const_rtx
694 debug_rtx_find (const_rtx x, int uid) 724 debug_rtx_find (const_rtx x, int uid)
695 { 725 {
696 while (x != 0 && INSN_UID (x) != uid) 726 while (x != 0 && INSN_UID (x) != uid)
697 x = NEXT_INSN (x); 727 x = NEXT_INSN (x);
698 if (x != 0) 728 if (x != 0)