1 /* Convert RTL to assembler code and output it, for GNU compiler.
2 Copyright (C) 1987, 88, 89, 92-7, 1998 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
22 /* This is the final pass of the compiler.
23 It looks at the rtl code for a function and outputs assembler code.
25 Call `final_start_function' to output the assembler code for function entry,
26 `final' to output assembler code for some RTL code,
27 `final_end_function' to output assembler code for function exit.
28 If a function is compiled in several pieces, each piece is
29 output separately with `final'.
31 Some optimizations are also done at this level.
32 Move instructions that were made unnecessary by good register allocation
33 are detected and omitted from the output. (Though most of these
34 are removed by the last jump pass.)
36 Instructions to set the condition codes are omitted when it can be
37 seen that the condition codes already had the desired values.
39 In some cases it is sufficient if the inherited condition codes
40 have related values, but this may require the following insn
41 (the one that tests the condition codes) to be modified.
43 The code for the function prologue and epilogue are generated
44 directly as assembler code by the macros FUNCTION_PROLOGUE and
45 FUNCTION_EPILOGUE. Those instructions never exist as rtl. */
69 #include "insn-config.h"
70 #include "insn-flags.h"
71 #include "insn-attr.h"
72 #include "insn-codes.h"
74 #include "conditions.h"
77 #include "hard-reg-set.h"
82 /* Get N_SLINE and N_SOL from stab.h if we can expect the file to exist. */
83 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
84 #if defined (USG) || defined (NO_STAB_H)
85 #include "gstab.h" /* If doing DBX on sysV, use our own stab.h. */
87 #include <stab.h> /* On BSD, use the system's stab.h. */
89 #endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
91 #ifdef XCOFF_DEBUGGING_INFO
95 /* .stabd code for line number. */
100 /* .stabs code for included file name. */
105 #ifndef INT_TYPE_SIZE
106 #define INT_TYPE_SIZE BITS_PER_WORD
109 #ifndef LONG_TYPE_SIZE
110 #define LONG_TYPE_SIZE BITS_PER_WORD
113 /* If we aren't using cc0, CC_STATUS_INIT shouldn't exist. So define a
114 null default for it to save conditionalization later. */
115 #ifndef CC_STATUS_INIT
116 #define CC_STATUS_INIT
119 /* How to start an assembler comment. */
120 #ifndef ASM_COMMENT_START
121 #define ASM_COMMENT_START ";#"
124 /* Is the given character a logical line separator for the assembler? */
125 #ifndef IS_ASM_LOGICAL_LINE_SEPARATOR
126 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == ';')
129 /* Nonzero means this function is a leaf function, with no function calls.
130 This variable exists to be examined in FUNCTION_PROLOGUE
131 and FUNCTION_EPILOGUE. Always zero, unless set by some action. */
134 /* Last insn processed by final_scan_insn. */
135 static rtx debug_insn
= 0;
137 /* Line number of last NOTE. */
138 static int last_linenum
;
140 /* Highest line number in current block. */
141 static int high_block_linenum
;
143 /* Likewise for function. */
144 static int high_function_linenum
;
146 /* Filename of last NOTE. */
147 static char *last_filename
;
149 /* Number of basic blocks seen so far;
150 used if profile_block_flag is set. */
151 static int count_basic_blocks
;
153 /* Number of instrumented arcs when profile_arc_flag is set. */
154 extern int count_instrumented_arcs
;
156 /* Nonzero while outputting an `asm' with operands.
157 This means that inconsistencies are the user's fault, so don't abort.
158 The precise value is the insn being output, to pass to error_for_asm. */
159 static rtx this_is_asm_operands
;
161 /* Number of operands of this insn, for an `asm' with operands. */
162 static int insn_noperands
;
164 /* Compare optimization flag. */
166 static rtx last_ignored_compare
= 0;
168 /* Flag indicating this insn is the start of a new basic block. */
170 static int new_block
= 1;
172 /* All the symbol-blocks (levels of scoping) in the compilation
173 are assigned sequence numbers in order of appearance of the
174 beginnings of the symbol-blocks. Both final and dbxout do this,
175 and assume that they will both give the same number to each block.
176 Final uses these sequence numbers to generate assembler label names
177 LBBnnn and LBEnnn for the beginning and end of the symbol-block.
178 Dbxout uses the sequence numbers to generate references to the same labels
179 from the dbx debugging information.
181 Sdb records this level at the beginning of each function,
182 in order to find the current level when recursing down declarations.
183 It outputs the block beginning and endings
184 at the point in the asm file where the blocks would begin and end. */
186 int next_block_index
;
188 /* Assign a unique number to each insn that is output.
189 This can be used to generate unique local labels. */
191 static int insn_counter
= 0;
194 /* This variable contains machine-dependent flags (defined in tm.h)
195 set and examined by output routines
196 that describe how to interpret the condition codes properly. */
200 /* During output of an insn, this contains a copy of cc_status
201 from before the insn. */
203 CC_STATUS cc_prev_status
;
206 /* Indexed by hardware reg number, is 1 if that register is ever
207 used in the current function.
209 In life_analysis, or in stupid_life_analysis, this is set
210 up to record the hard regs used explicitly. Reload adds
211 in the hard regs used for holding pseudo regs. Final uses
212 it to generate the code in the function prologue and epilogue
213 to save and restore registers as needed. */
215 char regs_ever_live
[FIRST_PSEUDO_REGISTER
];
217 /* Nonzero means current function must be given a frame pointer.
218 Set in stmt.c if anything is allocated on the stack there.
219 Set in reload1.c if anything is allocated on the stack there. */
221 int frame_pointer_needed
;
223 /* Assign unique numbers to labels generated for profiling. */
225 int profile_label_no
;
227 /* Length so far allocated in PENDING_BLOCKS. */
229 static int max_block_depth
;
231 /* Stack of sequence numbers of symbol-blocks of which we have seen the
232 beginning but not yet the end. Sequence numbers are assigned at
233 the beginning; this stack allows us to find the sequence number
234 of a block that is ending. */
236 static int *pending_blocks
;
238 /* Number of elements currently in use in PENDING_BLOCKS. */
240 static int block_depth
;
242 /* Nonzero if have enabled APP processing of our assembler output. */
246 /* If we are outputting an insn sequence, this contains the sequence rtx.
251 #ifdef ASSEMBLER_DIALECT
253 /* Number of the assembler dialect to use, starting at 0. */
254 static int dialect_number
;
257 /* Indexed by line number, nonzero if there is a note for that line. */
259 static char *line_note_exists
;
261 /* Linked list to hold line numbers for each basic block. */
264 struct bb_list
*next
; /* pointer to next basic block */
265 int line_num
; /* line number */
266 int file_label_num
; /* LPBC<n> label # for stored filename */
267 int func_label_num
; /* LPBC<n> label # for stored function name */
270 static struct bb_list
*bb_head
= 0; /* Head of basic block list */
271 static struct bb_list
**bb_tail
= &bb_head
; /* Ptr to store next bb ptr */
272 static int bb_file_label_num
= -1; /* Current label # for file */
273 static int bb_func_label_num
= -1; /* Current label # for func */
275 /* Linked list to hold the strings for each file and function name output. */
278 struct bb_str
*next
; /* pointer to next string */
279 char *string
; /* string */
280 int label_num
; /* label number */
281 int length
; /* string length */
284 extern rtx peephole
PROTO((rtx
));
286 static struct bb_str
*sbb_head
= 0; /* Head of string list. */
287 static struct bb_str
**sbb_tail
= &sbb_head
; /* Ptr to store next bb str */
288 static int sbb_label_num
= 0; /* Last label used */
290 #ifdef HAVE_ATTR_length
291 static int asm_insn_count
PROTO((rtx
));
293 static void profile_function
PROTO((FILE *));
294 static void profile_after_prologue
PROTO((FILE *));
295 static void add_bb
PROTO((FILE *));
296 static int add_bb_string
PROTO((char *, int));
297 static void output_source_line
PROTO((FILE *, rtx
));
298 static rtx walk_alter_subreg
PROTO((rtx
));
299 static void output_asm_name
PROTO((void));
300 static void output_operand
PROTO((rtx
, int));
301 #ifdef LEAF_REGISTERS
302 static void leaf_renumber_regs
PROTO((rtx
));
305 static int alter_cond
PROTO((rtx
));
308 extern char *getpwd ();
310 /* Initialize data in final at the beginning of a compilation. */
313 init_final (filename
)
316 next_block_index
= 2;
318 max_block_depth
= 20;
319 pending_blocks
= (int *) xmalloc (20 * sizeof *pending_blocks
);
322 #ifdef ASSEMBLER_DIALECT
323 dialect_number
= ASSEMBLER_DIALECT
;
327 /* Called at end of source file,
328 to output the block-profiling table for this entire compilation. */
336 if (profile_block_flag
|| profile_arc_flag
)
339 int align
= exact_log2 (BIGGEST_ALIGNMENT
/ BITS_PER_UNIT
);
343 int long_bytes
= LONG_TYPE_SIZE
/ BITS_PER_UNIT
;
344 int pointer_bytes
= POINTER_SIZE
/ BITS_PER_UNIT
;
346 if (profile_block_flag
)
347 size
= long_bytes
* count_basic_blocks
;
349 size
= long_bytes
* count_instrumented_arcs
;
352 rounded
+= (BIGGEST_ALIGNMENT
/ BITS_PER_UNIT
) - 1;
353 rounded
= (rounded
/ (BIGGEST_ALIGNMENT
/ BITS_PER_UNIT
)
354 * (BIGGEST_ALIGNMENT
/ BITS_PER_UNIT
));
358 /* Output the main header, of 11 words:
359 0: 1 if this file is initialized, else 0.
360 1: address of file name (LPBX1).
361 2: address of table of counts (LPBX2).
362 3: number of counts in the table.
363 4: always 0, for compatibility with Sun.
365 The following are GNU extensions:
367 5: address of table of start addrs of basic blocks (LPBX3).
368 6: Number of bytes in this header.
369 7: address of table of function names (LPBX4).
370 8: address of table of line numbers (LPBX5) or 0.
371 9: address of table of file names (LPBX6) or 0.
372 10: space reserved for basic block profiling. */
374 ASM_OUTPUT_ALIGN (asm_out_file
, align
);
376 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file
, "LPBX", 0);
378 assemble_integer (const0_rtx
, long_bytes
, 1);
380 /* address of filename */
381 ASM_GENERATE_INTERNAL_LABEL (name
, "LPBX", 1);
382 assemble_integer (gen_rtx_SYMBOL_REF (Pmode
, name
), pointer_bytes
, 1);
384 /* address of count table */
385 ASM_GENERATE_INTERNAL_LABEL (name
, "LPBX", 2);
386 assemble_integer (gen_rtx_SYMBOL_REF (Pmode
, name
), pointer_bytes
, 1);
388 /* count of the # of basic blocks or # of instrumented arcs */
389 if (profile_block_flag
)
390 assemble_integer (GEN_INT (count_basic_blocks
), long_bytes
, 1);
392 assemble_integer (GEN_INT (count_instrumented_arcs
), long_bytes
,
395 /* zero word (link field) */
396 assemble_integer (const0_rtx
, pointer_bytes
, 1);
398 /* address of basic block start address table */
399 if (profile_block_flag
)
401 ASM_GENERATE_INTERNAL_LABEL (name
, "LPBX", 3);
402 assemble_integer (gen_rtx_SYMBOL_REF (Pmode
, name
), pointer_bytes
,
406 assemble_integer (const0_rtx
, pointer_bytes
, 1);
408 /* byte count for extended structure. */
409 assemble_integer (GEN_INT (10 * UNITS_PER_WORD
), long_bytes
, 1);
411 /* address of function name table */
412 if (profile_block_flag
)
414 ASM_GENERATE_INTERNAL_LABEL (name
, "LPBX", 4);
415 assemble_integer (gen_rtx_SYMBOL_REF (Pmode
, name
), pointer_bytes
,
419 assemble_integer (const0_rtx
, pointer_bytes
, 1);
421 /* address of line number and filename tables if debugging. */
422 if (write_symbols
!= NO_DEBUG
&& profile_block_flag
)
424 ASM_GENERATE_INTERNAL_LABEL (name
, "LPBX", 5);
425 assemble_integer (gen_rtx_SYMBOL_REF (Pmode
, name
), pointer_bytes
, 1);
426 ASM_GENERATE_INTERNAL_LABEL (name
, "LPBX", 6);
427 assemble_integer (gen_rtx_SYMBOL_REF (Pmode
, name
), pointer_bytes
, 1);
431 assemble_integer (const0_rtx
, pointer_bytes
, 1);
432 assemble_integer (const0_rtx
, pointer_bytes
, 1);
435 /* space for extension ptr (link field) */
436 assemble_integer (const0_rtx
, UNITS_PER_WORD
, 1);
438 /* Output the file name changing the suffix to .d for Sun tcov
440 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file
, "LPBX", 1);
442 char *cwd
= getpwd ();
443 int len
= strlen (filename
) + strlen (cwd
) + 1;
444 char *data_file
= (char *) alloca (len
+ 4);
446 strcpy (data_file
, cwd
);
447 strcat (data_file
, "/");
448 strcat (data_file
, filename
);
449 strip_off_ending (data_file
, len
);
450 if (profile_block_flag
)
451 strcat (data_file
, ".d");
453 strcat (data_file
, ".da");
454 assemble_string (data_file
, strlen (data_file
) + 1);
457 /* Make space for the table of counts. */
460 /* Realign data section. */
461 ASM_OUTPUT_ALIGN (asm_out_file
, align
);
462 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file
, "LPBX", 2);
464 assemble_zeros (size
);
468 ASM_GENERATE_INTERNAL_LABEL (name
, "LPBX", 2);
469 #ifdef ASM_OUTPUT_SHARED_LOCAL
470 if (flag_shared_data
)
471 ASM_OUTPUT_SHARED_LOCAL (asm_out_file
, name
, size
, rounded
);
474 #ifdef ASM_OUTPUT_ALIGNED_DECL_LOCAL
475 ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file
, NULL_TREE
, name
, size
,
478 #ifdef ASM_OUTPUT_ALIGNED_LOCAL
479 ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file
, name
, size
,
482 ASM_OUTPUT_LOCAL (asm_out_file
, name
, size
, rounded
);
487 /* Output any basic block strings */
488 if (profile_block_flag
)
490 readonly_data_section ();
493 ASM_OUTPUT_ALIGN (asm_out_file
, align
);
494 for (sptr
= sbb_head
; sptr
!= 0; sptr
= sptr
->next
)
496 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file
, "LPBC",
498 assemble_string (sptr
->string
, sptr
->length
);
503 /* Output the table of addresses. */
504 if (profile_block_flag
)
506 /* Realign in new section */
507 ASM_OUTPUT_ALIGN (asm_out_file
, align
);
508 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file
, "LPBX", 3);
509 for (i
= 0; i
< count_basic_blocks
; i
++)
511 ASM_GENERATE_INTERNAL_LABEL (name
, "LPB", i
);
512 assemble_integer (gen_rtx_SYMBOL_REF (Pmode
, name
),
517 /* Output the table of function names. */
518 if (profile_block_flag
)
520 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file
, "LPBX", 4);
521 for ((ptr
= bb_head
), (i
= 0); ptr
!= 0; (ptr
= ptr
->next
), i
++)
523 if (ptr
->func_label_num
>= 0)
525 ASM_GENERATE_INTERNAL_LABEL (name
, "LPBC",
526 ptr
->func_label_num
);
527 assemble_integer (gen_rtx_SYMBOL_REF (Pmode
, name
),
531 assemble_integer (const0_rtx
, pointer_bytes
, 1);
534 for ( ; i
< count_basic_blocks
; i
++)
535 assemble_integer (const0_rtx
, pointer_bytes
, 1);
538 if (write_symbols
!= NO_DEBUG
&& profile_block_flag
)
540 /* Output the table of line numbers. */
541 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file
, "LPBX", 5);
542 for ((ptr
= bb_head
), (i
= 0); ptr
!= 0; (ptr
= ptr
->next
), i
++)
543 assemble_integer (GEN_INT (ptr
->line_num
), long_bytes
, 1);
545 for ( ; i
< count_basic_blocks
; i
++)
546 assemble_integer (const0_rtx
, long_bytes
, 1);
548 /* Output the table of file names. */
549 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file
, "LPBX", 6);
550 for ((ptr
= bb_head
), (i
= 0); ptr
!= 0; (ptr
= ptr
->next
), i
++)
552 if (ptr
->file_label_num
>= 0)
554 ASM_GENERATE_INTERNAL_LABEL (name
, "LPBC",
555 ptr
->file_label_num
);
556 assemble_integer (gen_rtx_SYMBOL_REF (Pmode
, name
),
560 assemble_integer (const0_rtx
, pointer_bytes
, 1);
563 for ( ; i
< count_basic_blocks
; i
++)
564 assemble_integer (const0_rtx
, pointer_bytes
, 1);
567 /* End with the address of the table of addresses,
568 so we can find it easily, as the last word in the file's text. */
569 if (profile_block_flag
)
571 ASM_GENERATE_INTERNAL_LABEL (name
, "LPBX", 3);
572 assemble_integer (gen_rtx_SYMBOL_REF (Pmode
, name
), pointer_bytes
,
578 /* Enable APP processing of subsequent output.
579 Used before the output from an `asm' statement. */
586 fputs (ASM_APP_ON
, asm_out_file
);
591 /* Disable APP processing of subsequent output.
592 Called from varasm.c before most kinds of output. */
599 fputs (ASM_APP_OFF
, asm_out_file
);
604 /* Return the number of slots filled in the current
605 delayed branch sequence (we don't count the insn needing the
606 delay slot). Zero if not in a delayed branch sequence. */
610 dbr_sequence_length ()
612 if (final_sequence
!= 0)
613 return XVECLEN (final_sequence
, 0) - 1;
619 /* The next two pages contain routines used to compute the length of an insn
620 and to shorten branches. */
622 /* Arrays for insn lengths, and addresses. The latter is referenced by
623 `insn_current_length'. */
625 static short *insn_lengths
;
628 /* Address of insn being processed. Used by `insn_current_length'. */
629 int insn_current_address
;
631 /* Indicate that branch shortening hasn't yet been done. */
639 /* Obtain the current length of an insn. If branch shortening has been done,
640 get its actual length. Otherwise, get its maximum length. */
643 get_attr_length (insn
)
646 #ifdef HAVE_ATTR_length
652 return insn_lengths
[INSN_UID (insn
)];
654 switch (GET_CODE (insn
))
662 length
= insn_default_length (insn
);
666 body
= PATTERN (insn
);
667 if (GET_CODE (body
) == ADDR_VEC
|| GET_CODE (body
) == ADDR_DIFF_VEC
)
669 /* This only takes room if jump tables go into the text section. */
670 #if !defined(READONLY_DATA_SECTION) || defined(JUMP_TABLES_IN_TEXT_SECTION)
671 length
= (XVECLEN (body
, GET_CODE (body
) == ADDR_DIFF_VEC
)
672 * GET_MODE_SIZE (GET_MODE (body
)));
674 /* Be pessimistic and assume worst-case alignment. */
675 length
+= (GET_MODE_SIZE (GET_MODE (body
)) - 1);
681 length
= insn_default_length (insn
);
685 body
= PATTERN (insn
);
686 if (GET_CODE (body
) == USE
|| GET_CODE (body
) == CLOBBER
)
689 else if (GET_CODE (body
) == ASM_INPUT
|| asm_noperands (body
) >= 0)
690 length
= asm_insn_count (body
) * insn_default_length (insn
);
691 else if (GET_CODE (body
) == SEQUENCE
)
692 for (i
= 0; i
< XVECLEN (body
, 0); i
++)
693 length
+= get_attr_length (XVECEXP (body
, 0, i
));
695 length
= insn_default_length (insn
);
702 #ifdef ADJUST_INSN_LENGTH
703 ADJUST_INSN_LENGTH (insn
, length
);
706 #else /* not HAVE_ATTR_length */
708 #endif /* not HAVE_ATTR_length */
711 /* Make a pass over all insns and compute their actual lengths by shortening
712 any branches of variable length if possible. */
714 /* Give a default value for the lowest address in a function. */
716 #ifndef FIRST_INSN_ADDRESS
717 #define FIRST_INSN_ADDRESS 0
721 shorten_branches (first
)
724 #ifdef HAVE_ATTR_length
726 int something_changed
= 1;
728 char *varying_length
;
732 /* In order to make sure that all instructions have valid length info,
733 we must split them before we compute the address/length info. */
735 for (insn
= NEXT_INSN (first
); insn
; insn
= NEXT_INSN (insn
))
736 if (GET_RTX_CLASS (GET_CODE (insn
)) == 'i')
737 insn
= try_split (PATTERN (insn
), insn
, 1);
739 /* Compute maximum UID and allocate arrays. */
740 for (insn
= first
; insn
; insn
= NEXT_INSN (insn
))
741 if (INSN_UID (insn
) > max_uid
)
742 max_uid
= INSN_UID (insn
);
745 insn_lengths
= (short *) oballoc (max_uid
* sizeof (short));
746 insn_addresses
= (int *) oballoc (max_uid
* sizeof (int));
747 varying_length
= (char *) oballoc (max_uid
* sizeof (char));
749 /* Compute initial lengths, addresses, and varying flags for each insn. */
750 for (insn_current_address
= FIRST_INSN_ADDRESS
, insn
= first
;
752 insn_current_address
+= insn_lengths
[uid
], insn
= NEXT_INSN (insn
))
754 uid
= INSN_UID (insn
);
755 insn_addresses
[uid
] = insn_current_address
;
756 insn_lengths
[uid
] = 0;
757 varying_length
[uid
] = 0;
759 if (GET_CODE (insn
) == NOTE
|| GET_CODE (insn
) == BARRIER
760 || GET_CODE (insn
) == CODE_LABEL
)
762 if (INSN_DELETED_P (insn
))
765 body
= PATTERN (insn
);
766 if (GET_CODE (body
) == ADDR_VEC
|| GET_CODE (body
) == ADDR_DIFF_VEC
)
768 /* This only takes room if read-only data goes into the text
770 #if !defined(READONLY_DATA_SECTION) || defined(JUMP_TABLES_IN_TEXT_SECTION)
771 int unitsize
= GET_MODE_SIZE (GET_MODE (body
));
773 insn_lengths
[uid
] = (XVECLEN (body
, GET_CODE (body
) == ADDR_DIFF_VEC
)
774 * GET_MODE_SIZE (GET_MODE (body
)));
776 /* We don't know what address the ADDR_VEC/ADDR_DIFF_VEC will end
777 up at after branch shortening. As a result, it is impossible
778 to determine how much padding we need at this point. Therefore,
779 assume worst possible alignment. */
780 insn_lengths
[uid
] += unitsize
- 1;
786 else if (asm_noperands (body
) >= 0)
787 insn_lengths
[uid
] = asm_insn_count (body
) * insn_default_length (insn
);
788 else if (GET_CODE (body
) == SEQUENCE
)
791 int const_delay_slots
;
793 const_delay_slots
= const_num_delay_slots (XVECEXP (body
, 0, 0));
795 const_delay_slots
= 0;
797 /* Inside a delay slot sequence, we do not do any branch shortening
798 if the shortening could change the number of delay slots
800 for (i
= 0; i
< XVECLEN (body
, 0); i
++)
802 rtx inner_insn
= XVECEXP (body
, 0, i
);
803 int inner_uid
= INSN_UID (inner_insn
);
806 if (asm_noperands (PATTERN (XVECEXP (body
, 0, i
))) >= 0)
807 inner_length
= (asm_insn_count (PATTERN (inner_insn
))
808 * insn_default_length (inner_insn
));
810 inner_length
= insn_default_length (inner_insn
);
812 insn_lengths
[inner_uid
] = inner_length
;
813 if (const_delay_slots
)
815 if ((varying_length
[inner_uid
]
816 = insn_variable_length_p (inner_insn
)) != 0)
817 varying_length
[uid
] = 1;
818 insn_addresses
[inner_uid
] = (insn_current_address
+
822 varying_length
[inner_uid
] = 0;
823 insn_lengths
[uid
] += inner_length
;
826 else if (GET_CODE (body
) != USE
&& GET_CODE (body
) != CLOBBER
)
828 insn_lengths
[uid
] = insn_default_length (insn
);
829 varying_length
[uid
] = insn_variable_length_p (insn
);
832 /* If needed, do any adjustment. */
833 #ifdef ADJUST_INSN_LENGTH
834 ADJUST_INSN_LENGTH (insn
, insn_lengths
[uid
]);
838 /* Now loop over all the insns finding varying length insns. For each,
839 get the current insn length. If it has changed, reflect the change.
840 When nothing changes for a full pass, we are done. */
842 while (something_changed
)
844 something_changed
= 0;
845 for (insn_current_address
= FIRST_INSN_ADDRESS
, insn
= first
;
847 insn
= NEXT_INSN (insn
))
850 #ifdef SHORTEN_WITH_ADJUST_INSN_LENGTH
851 #ifdef ADJUST_INSN_LENGTH
856 uid
= INSN_UID (insn
);
857 insn_addresses
[uid
] = insn_current_address
;
858 if (! varying_length
[uid
])
860 insn_current_address
+= insn_lengths
[uid
];
863 if (GET_CODE (insn
) == INSN
&& GET_CODE (PATTERN (insn
)) == SEQUENCE
)
867 body
= PATTERN (insn
);
869 for (i
= 0; i
< XVECLEN (body
, 0); i
++)
871 rtx inner_insn
= XVECEXP (body
, 0, i
);
872 int inner_uid
= INSN_UID (inner_insn
);
875 insn_addresses
[inner_uid
] = insn_current_address
;
877 /* insn_current_length returns 0 for insns with a
878 non-varying length. */
879 if (! varying_length
[inner_uid
])
880 inner_length
= insn_lengths
[inner_uid
];
882 inner_length
= insn_current_length (inner_insn
);
884 if (inner_length
!= insn_lengths
[inner_uid
])
886 insn_lengths
[inner_uid
] = inner_length
;
887 something_changed
= 1;
889 insn_current_address
+= insn_lengths
[inner_uid
];
890 new_length
+= inner_length
;
895 new_length
= insn_current_length (insn
);
896 insn_current_address
+= new_length
;
899 #ifdef SHORTEN_WITH_ADJUST_INSN_LENGTH
900 #ifdef ADJUST_INSN_LENGTH
901 /* If needed, do any adjustment. */
902 tmp_length
= new_length
;
903 ADJUST_INSN_LENGTH (insn
, new_length
);
904 insn_current_address
+= (new_length
- tmp_length
);
908 if (new_length
!= insn_lengths
[uid
])
910 insn_lengths
[uid
] = new_length
;
911 something_changed
= 1;
914 /* For a non-optimizing compile, do only a single pass. */
918 #endif /* HAVE_ATTR_length */
921 #ifdef HAVE_ATTR_length
922 /* Given the body of an INSN known to be generated by an ASM statement, return
923 the number of machine instructions likely to be generated for this insn.
924 This is used to compute its length. */
927 asm_insn_count (body
)
933 if (GET_CODE (body
) == ASM_INPUT
)
934 template = XSTR (body
, 0);
936 template = decode_asm_operands (body
, NULL_PTR
, NULL_PTR
,
939 for ( ; *template; template++)
940 if (IS_ASM_LOGICAL_LINE_SEPARATOR(*template) || *template == '\n')
947 /* Output assembler code for the start of a function,
948 and initialize some of the variables in this file
949 for the new function. The label for the function and associated
950 assembler pseudo-ops have already been output in `assemble_start_function'.
952 FIRST is the first insn of the rtl for the function being compiled.
953 FILE is the file to write assembler code to.
954 OPTIMIZE is nonzero if we should eliminate redundant
955 test and compare insns. */
958 final_start_function (first
, file
, optimize
)
965 this_is_asm_operands
= 0;
967 #ifdef NON_SAVING_SETJMP
968 /* A function that calls setjmp should save and restore all the
969 call-saved registers on a system where longjmp clobbers them. */
970 if (NON_SAVING_SETJMP
&& current_function_calls_setjmp
)
974 for (i
= 0; i
< FIRST_PSEUDO_REGISTER
; i
++)
975 if (!call_used_regs
[i
] && !call_fixed_regs
[i
])
976 regs_ever_live
[i
] = 1;
980 /* Initial line number is supposed to be output
981 before the function's prologue and label
982 so that the function's address will not appear to be
983 in the last statement of the preceding function. */
984 if (NOTE_LINE_NUMBER (first
) != NOTE_INSN_DELETED
)
985 last_linenum
= high_block_linenum
= high_function_linenum
986 = NOTE_LINE_NUMBER (first
);
988 #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
989 /* Output DWARF definition of the function. */
990 if (dwarf2out_do_frame ())
991 dwarf2out_begin_prologue ();
994 /* For SDB and XCOFF, the function beginning must be marked between
995 the function label and the prologue. We always need this, even when
996 -g1 was used. Defer on MIPS systems so that parameter descriptions
997 follow function entry. */
998 #if defined(SDB_DEBUGGING_INFO) && !defined(MIPS_DEBUGGING_INFO)
999 if (write_symbols
== SDB_DEBUG
)
1000 sdbout_begin_function (last_linenum
);
1003 #ifdef XCOFF_DEBUGGING_INFO
1004 if (write_symbols
== XCOFF_DEBUG
)
1005 xcoffout_begin_function (file
, last_linenum
);
1008 /* But only output line number for other debug info types if -g2
1010 if (NOTE_LINE_NUMBER (first
) != NOTE_INSN_DELETED
)
1011 output_source_line (file
, first
);
1013 #ifdef LEAF_REG_REMAP
1015 leaf_renumber_regs (first
);
1018 /* The Sun386i and perhaps other machines don't work right
1019 if the profiling code comes after the prologue. */
1020 #ifdef PROFILE_BEFORE_PROLOGUE
1022 profile_function (file
);
1023 #endif /* PROFILE_BEFORE_PROLOGUE */
1025 #if defined (DWARF2_UNWIND_INFO) && defined (HAVE_prologue)
1026 if (dwarf2out_do_frame ())
1027 dwarf2out_frame_debug (NULL_RTX
);
1030 #ifdef FUNCTION_PROLOGUE
1031 /* First output the function prologue: code to set up the stack frame. */
1032 FUNCTION_PROLOGUE (file
, get_frame_size ());
1035 #if defined (SDB_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
1036 if (write_symbols
== SDB_DEBUG
|| write_symbols
== XCOFF_DEBUG
)
1037 next_block_index
= 1;
1040 /* If the machine represents the prologue as RTL, the profiling code must
1041 be emitted when NOTE_INSN_PROLOGUE_END is scanned. */
1042 #ifdef HAVE_prologue
1043 if (! HAVE_prologue
)
1045 profile_after_prologue (file
);
1049 /* If we are doing basic block profiling, remember a printable version
1050 of the function name. */
1051 if (profile_block_flag
)
1054 = add_bb_string ((*decl_printable_name
) (current_function_decl
, 2), FALSE
);
1059 profile_after_prologue (file
)
1062 #ifdef FUNCTION_BLOCK_PROFILER
1063 if (profile_block_flag
)
1065 FUNCTION_BLOCK_PROFILER (file
, count_basic_blocks
);
1067 #endif /* FUNCTION_BLOCK_PROFILER */
1069 #ifndef PROFILE_BEFORE_PROLOGUE
1071 profile_function (file
);
1072 #endif /* not PROFILE_BEFORE_PROLOGUE */
1076 profile_function (file
)
1079 int align
= MIN (BIGGEST_ALIGNMENT
, LONG_TYPE_SIZE
);
1080 #if defined(ASM_OUTPUT_REG_PUSH)
1081 #if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
1082 int sval
= current_function_returns_struct
;
1084 #if defined(STATIC_CHAIN_INCOMING_REGNUM) || defined(STATIC_CHAIN_REGNUM)
1085 int cxt
= current_function_needs_context
;
1087 #endif /* ASM_OUTPUT_REG_PUSH */
1090 ASM_OUTPUT_ALIGN (file
, floor_log2 (align
/ BITS_PER_UNIT
));
1091 ASM_OUTPUT_INTERNAL_LABEL (file
, "LP", profile_label_no
);
1092 assemble_integer (const0_rtx
, LONG_TYPE_SIZE
/ BITS_PER_UNIT
, 1);
1094 function_section (current_function_decl
);
1096 #if defined(STRUCT_VALUE_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
1098 ASM_OUTPUT_REG_PUSH (file
, STRUCT_VALUE_INCOMING_REGNUM
);
1100 #if defined(STRUCT_VALUE_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
1103 ASM_OUTPUT_REG_PUSH (file
, STRUCT_VALUE_REGNUM
);
1108 #if defined(STATIC_CHAIN_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
1110 ASM_OUTPUT_REG_PUSH (file
, STATIC_CHAIN_INCOMING_REGNUM
);
1112 #if defined(STATIC_CHAIN_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
1115 ASM_OUTPUT_REG_PUSH (file
, STATIC_CHAIN_REGNUM
);
1120 FUNCTION_PROFILER (file
, profile_label_no
);
1122 #if defined(STATIC_CHAIN_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
1124 ASM_OUTPUT_REG_POP (file
, STATIC_CHAIN_INCOMING_REGNUM
);
1126 #if defined(STATIC_CHAIN_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
1129 ASM_OUTPUT_REG_POP (file
, STATIC_CHAIN_REGNUM
);
1134 #if defined(STRUCT_VALUE_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
1136 ASM_OUTPUT_REG_POP (file
, STRUCT_VALUE_INCOMING_REGNUM
);
1138 #if defined(STRUCT_VALUE_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
1141 ASM_OUTPUT_REG_POP (file
, STRUCT_VALUE_REGNUM
);
1147 /* Output assembler code for the end of a function.
1148 For clarity, args are same as those of `final_start_function'
1149 even though not all of them are needed. */
1152 final_end_function (first
, file
, optimize
)
1159 fputs (ASM_APP_OFF
, file
);
1163 #ifdef SDB_DEBUGGING_INFO
1164 if (write_symbols
== SDB_DEBUG
)
1165 sdbout_end_function (high_function_linenum
);
1168 #ifdef DWARF_DEBUGGING_INFO
1169 if (write_symbols
== DWARF_DEBUG
)
1170 dwarfout_end_function ();
1173 #ifdef XCOFF_DEBUGGING_INFO
1174 if (write_symbols
== XCOFF_DEBUG
)
1175 xcoffout_end_function (file
, high_function_linenum
);
1178 #ifdef FUNCTION_EPILOGUE
1179 /* Finally, output the function epilogue:
1180 code to restore the stack frame and return to the caller. */
1181 FUNCTION_EPILOGUE (file
, get_frame_size ());
1184 #ifdef SDB_DEBUGGING_INFO
1185 if (write_symbols
== SDB_DEBUG
)
1186 sdbout_end_epilogue ();
1189 #ifdef DWARF_DEBUGGING_INFO
1190 if (write_symbols
== DWARF_DEBUG
)
1191 dwarfout_end_epilogue ();
1194 #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
1195 if (dwarf2out_do_frame ())
1196 dwarf2out_end_epilogue ();
1199 #ifdef XCOFF_DEBUGGING_INFO
1200 if (write_symbols
== XCOFF_DEBUG
)
1201 xcoffout_end_epilogue (file
);
1204 bb_func_label_num
= -1; /* not in function, nuke label # */
1206 /* If FUNCTION_EPILOGUE is not defined, then the function body
1207 itself contains return instructions wherever needed. */
1210 /* Add a block to the linked list that remembers the current line/file/function
1211 for basic block profiling. Emit the label in front of the basic block and
1212 the instructions that increment the count field. */
1218 struct bb_list
*ptr
= (struct bb_list
*) permalloc (sizeof (struct bb_list
));
1220 /* Add basic block to linked list. */
1222 ptr
->line_num
= last_linenum
;
1223 ptr
->file_label_num
= bb_file_label_num
;
1224 ptr
->func_label_num
= bb_func_label_num
;
1226 bb_tail
= &ptr
->next
;
1228 /* Enable the table of basic-block use counts
1229 to point at the code it applies to. */
1230 ASM_OUTPUT_INTERNAL_LABEL (file
, "LPB", count_basic_blocks
);
1232 /* Before first insn of this basic block, increment the
1233 count of times it was entered. */
1234 #ifdef BLOCK_PROFILER
1235 BLOCK_PROFILER (file
, count_basic_blocks
);
1242 count_basic_blocks
++;
1245 /* Add a string to be used for basic block profiling. */
1248 add_bb_string (string
, perm_p
)
1253 struct bb_str
*ptr
= 0;
1257 string
= "<unknown>";
1261 /* Allocate a new string if the current string isn't permanent. If
1262 the string is permanent search for the same string in other
1265 len
= strlen (string
) + 1;
1268 char *p
= (char *) permalloc (len
);
1269 bcopy (string
, p
, len
);
1273 for (ptr
= sbb_head
; ptr
!= (struct bb_str
*) 0; ptr
= ptr
->next
)
1274 if (ptr
->string
== string
)
1277 /* Allocate a new string block if we need to. */
1280 ptr
= (struct bb_str
*) permalloc (sizeof (*ptr
));
1283 ptr
->label_num
= sbb_label_num
++;
1284 ptr
->string
= string
;
1286 sbb_tail
= &ptr
->next
;
1289 return ptr
->label_num
;
1293 /* Output assembler code for some insns: all or part of a function.
1294 For description of args, see `final_start_function', above.
1296 PRESCAN is 1 if we are not really outputting,
1297 just scanning as if we were outputting.
1298 Prescanning deletes and rearranges insns just like ordinary output.
1299 PRESCAN is -2 if we are outputting after having prescanned.
1300 In this case, don't try to delete or rearrange insns
1301 because that has already been done.
1302 Prescanning is done only on certain machines. */
1305 final (first
, file
, optimize
, prescan
)
1314 last_ignored_compare
= 0;
1317 check_exception_handler_labels ();
1319 /* Make a map indicating which line numbers appear in this function.
1320 When producing SDB debugging info, delete troublesome line number
1321 notes from inlined functions in other files as well as duplicate
1322 line number notes. */
1323 #ifdef SDB_DEBUGGING_INFO
1324 if (write_symbols
== SDB_DEBUG
)
1327 for (insn
= first
; insn
; insn
= NEXT_INSN (insn
))
1328 if (GET_CODE (insn
) == NOTE
&& NOTE_LINE_NUMBER (insn
) > 0)
1330 if ((RTX_INTEGRATED_P (insn
)
1331 && strcmp (NOTE_SOURCE_FILE (insn
), main_input_filename
) != 0)
1333 && NOTE_LINE_NUMBER (insn
) == NOTE_LINE_NUMBER (last
)
1334 && NOTE_SOURCE_FILE (insn
) == NOTE_SOURCE_FILE (last
)))
1336 NOTE_LINE_NUMBER (insn
) = NOTE_INSN_DELETED
;
1337 NOTE_SOURCE_FILE (insn
) = 0;
1341 if (NOTE_LINE_NUMBER (insn
) > max_line
)
1342 max_line
= NOTE_LINE_NUMBER (insn
);
1348 for (insn
= first
; insn
; insn
= NEXT_INSN (insn
))
1349 if (GET_CODE (insn
) == NOTE
&& NOTE_LINE_NUMBER (insn
) > max_line
)
1350 max_line
= NOTE_LINE_NUMBER (insn
);
1353 line_note_exists
= (char *) oballoc (max_line
+ 1);
1354 bzero (line_note_exists
, max_line
+ 1);
1356 for (insn
= first
; insn
; insn
= NEXT_INSN (insn
))
1357 if (GET_CODE (insn
) == NOTE
&& NOTE_LINE_NUMBER (insn
) > 0)
1358 line_note_exists
[NOTE_LINE_NUMBER (insn
)] = 1;
1364 /* Output the insns. */
1365 for (insn
= NEXT_INSN (first
); insn
;)
1367 #ifdef HAVE_ATTR_length
1368 insn_current_address
= insn_addresses
[INSN_UID (insn
)];
1370 insn
= final_scan_insn (insn
, file
, optimize
, prescan
, 0);
1373 /* Do basic-block profiling here
1374 if the last insn was a conditional branch. */
1375 if (profile_block_flag
&& new_block
)
1379 /* The final scan for one insn, INSN.
1380 Args are same as in `final', except that INSN
1381 is the insn being scanned.
1382 Value returned is the next insn to be scanned.
1384 NOPEEPHOLES is the flag to disallow peephole processing (currently
1385 used for within delayed branch sequence output). */
1388 final_scan_insn (insn
, file
, optimize
, prescan
, nopeepholes
)
1402 /* Ignore deleted insns. These can occur when we split insns (due to a
1403 template of "#") while not optimizing. */
1404 if (INSN_DELETED_P (insn
))
1405 return NEXT_INSN (insn
);
1407 switch (GET_CODE (insn
))
1413 /* Align the beginning of a loop, for higher speed
1414 on certain machines. */
1416 if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_LOOP_BEG
&& optimize
> 0)
1418 #ifdef ASM_OUTPUT_LOOP_ALIGN
1419 rtx next
= next_nonnote_insn (insn
);
1420 if (next
&& GET_CODE (next
) == CODE_LABEL
)
1422 ASM_OUTPUT_LOOP_ALIGN (asm_out_file
);
1427 if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_LOOP_END
)
1430 if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_EH_REGION_BEG
1431 && ! exceptions_via_longjmp
)
1433 ASM_OUTPUT_INTERNAL_LABEL (file
, "LEHB", NOTE_BLOCK_NUMBER (insn
));
1434 add_eh_table_entry (NOTE_BLOCK_NUMBER (insn
));
1435 #ifdef ASM_OUTPUT_EH_REGION_BEG
1436 ASM_OUTPUT_EH_REGION_BEG (file
, NOTE_BLOCK_NUMBER (insn
));
1441 if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_EH_REGION_END
1442 && ! exceptions_via_longjmp
)
1444 ASM_OUTPUT_INTERNAL_LABEL (file
, "LEHE", NOTE_BLOCK_NUMBER (insn
));
1445 #ifdef ASM_OUTPUT_EH_REGION_END
1446 ASM_OUTPUT_EH_REGION_END (file
, NOTE_BLOCK_NUMBER (insn
));
1451 if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_PROLOGUE_END
)
1453 #ifdef FUNCTION_END_PROLOGUE
1454 FUNCTION_END_PROLOGUE (file
);
1456 profile_after_prologue (file
);
1460 #ifdef FUNCTION_BEGIN_EPILOGUE
1461 if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_EPILOGUE_BEG
)
1463 FUNCTION_BEGIN_EPILOGUE (file
);
1468 if (write_symbols
== NO_DEBUG
)
1470 if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_FUNCTION_BEG
)
1472 #if defined(SDB_DEBUGGING_INFO) && defined(MIPS_DEBUGGING_INFO)
1473 /* MIPS stabs require the parameter descriptions to be after the
1474 function entry point rather than before. */
1475 if (write_symbols
== SDB_DEBUG
)
1476 sdbout_begin_function (last_linenum
);
1479 #ifdef DWARF_DEBUGGING_INFO
1480 /* This outputs a marker where the function body starts, so it
1481 must be after the prologue. */
1482 if (write_symbols
== DWARF_DEBUG
)
1483 dwarfout_begin_function ();
1487 if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_DELETED
)
1488 break; /* An insn that was "deleted" */
1491 fputs (ASM_APP_OFF
, file
);
1494 if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_BLOCK_BEG
1495 && (debug_info_level
== DINFO_LEVEL_NORMAL
1496 || debug_info_level
== DINFO_LEVEL_VERBOSE
1497 || write_symbols
== DWARF_DEBUG
1498 || write_symbols
== DWARF2_DEBUG
))
1500 /* Beginning of a symbol-block. Assign it a sequence number
1501 and push the number onto the stack PENDING_BLOCKS. */
1503 if (block_depth
== max_block_depth
)
1505 /* PENDING_BLOCKS is full; make it longer. */
1506 max_block_depth
*= 2;
1508 = (int *) xrealloc (pending_blocks
,
1509 max_block_depth
* sizeof (int));
1511 pending_blocks
[block_depth
++] = next_block_index
;
1513 high_block_linenum
= last_linenum
;
1515 /* Output debugging info about the symbol-block beginning. */
1517 #ifdef SDB_DEBUGGING_INFO
1518 if (write_symbols
== SDB_DEBUG
)
1519 sdbout_begin_block (file
, last_linenum
, next_block_index
);
1521 #ifdef XCOFF_DEBUGGING_INFO
1522 if (write_symbols
== XCOFF_DEBUG
)
1523 xcoffout_begin_block (file
, last_linenum
, next_block_index
);
1525 #ifdef DBX_DEBUGGING_INFO
1526 if (write_symbols
== DBX_DEBUG
)
1527 ASM_OUTPUT_INTERNAL_LABEL (file
, "LBB", next_block_index
);
1529 #ifdef DWARF_DEBUGGING_INFO
1530 if (write_symbols
== DWARF_DEBUG
)
1531 dwarfout_begin_block (next_block_index
);
1533 #ifdef DWARF2_DEBUGGING_INFO
1534 if (write_symbols
== DWARF2_DEBUG
)
1535 dwarf2out_begin_block (next_block_index
);
1540 else if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_BLOCK_END
1541 && (debug_info_level
== DINFO_LEVEL_NORMAL
1542 || debug_info_level
== DINFO_LEVEL_VERBOSE
1543 || write_symbols
== DWARF_DEBUG
1544 || write_symbols
== DWARF2_DEBUG
))
1546 /* End of a symbol-block. Pop its sequence number off
1547 PENDING_BLOCKS and output debugging info based on that. */
1551 #ifdef XCOFF_DEBUGGING_INFO
1552 if (write_symbols
== XCOFF_DEBUG
&& block_depth
>= 0)
1553 xcoffout_end_block (file
, high_block_linenum
,
1554 pending_blocks
[block_depth
]);
1556 #ifdef DBX_DEBUGGING_INFO
1557 if (write_symbols
== DBX_DEBUG
&& block_depth
>= 0)
1558 ASM_OUTPUT_INTERNAL_LABEL (file
, "LBE",
1559 pending_blocks
[block_depth
]);
1561 #ifdef SDB_DEBUGGING_INFO
1562 if (write_symbols
== SDB_DEBUG
&& block_depth
>= 0)
1563 sdbout_end_block (file
, high_block_linenum
,
1564 pending_blocks
[block_depth
]);
1566 #ifdef DWARF_DEBUGGING_INFO
1567 if (write_symbols
== DWARF_DEBUG
&& block_depth
>= 0)
1568 dwarfout_end_block (pending_blocks
[block_depth
]);
1570 #ifdef DWARF2_DEBUGGING_INFO
1571 if (write_symbols
== DWARF2_DEBUG
&& block_depth
>= 0)
1572 dwarf2out_end_block (pending_blocks
[block_depth
]);
1575 else if (NOTE_LINE_NUMBER (insn
) == NOTE_INSN_DELETED_LABEL
1576 && (debug_info_level
== DINFO_LEVEL_NORMAL
1577 || debug_info_level
== DINFO_LEVEL_VERBOSE
))
1579 #ifdef DWARF_DEBUGGING_INFO
1580 if (write_symbols
== DWARF_DEBUG
)
1581 dwarfout_label (insn
);
1583 #ifdef DWARF2_DEBUGGING_INFO
1584 if (write_symbols
== DWARF2_DEBUG
)
1585 dwarf2out_label (insn
);
1588 else if (NOTE_LINE_NUMBER (insn
) > 0)
1589 /* This note is a line-number. */
1593 #if 0 /* This is what we used to do. */
1594 output_source_line (file
, insn
);
1598 /* If there is anything real after this note,
1599 output it. If another line note follows, omit this one. */
1600 for (note
= NEXT_INSN (insn
); note
; note
= NEXT_INSN (note
))
1602 if (GET_CODE (note
) != NOTE
&& GET_CODE (note
) != CODE_LABEL
)
1604 /* These types of notes can be significant
1605 so make sure the preceding line number stays. */
1606 else if (GET_CODE (note
) == NOTE
1607 && (NOTE_LINE_NUMBER (note
) == NOTE_INSN_BLOCK_BEG
1608 || NOTE_LINE_NUMBER (note
) == NOTE_INSN_BLOCK_END
1609 || NOTE_LINE_NUMBER (note
) == NOTE_INSN_FUNCTION_BEG
))
1611 else if (GET_CODE (note
) == NOTE
&& NOTE_LINE_NUMBER (note
) > 0)
1613 /* Another line note follows; we can delete this note
1614 if no intervening line numbers have notes elsewhere. */
1616 for (num
= NOTE_LINE_NUMBER (insn
) + 1;
1617 num
< NOTE_LINE_NUMBER (note
);
1619 if (line_note_exists
[num
])
1622 if (num
>= NOTE_LINE_NUMBER (note
))
1628 /* Output this line note
1629 if it is the first or the last line note in a row. */
1631 output_source_line (file
, insn
);
1636 #ifdef ASM_OUTPUT_ALIGN_CODE
1637 /* Don't litter the assembler output with needless alignments. A
1638 BARRIER will be placed at the end of every function if HAVE_epilogue
1640 if (NEXT_INSN (insn
))
1641 ASM_OUTPUT_ALIGN_CODE (file
);
1643 #if defined (DWARF2_UNWIND_INFO) && !defined (ACCUMULATE_OUTGOING_ARGS)
1644 /* If we push arguments, we need to check all insns for stack
1646 if (dwarf2out_do_frame ())
1647 dwarf2out_frame_debug (insn
);
1657 #ifdef FINAL_PRESCAN_LABEL
1658 FINAL_PRESCAN_INSN (insn
, NULL_PTR
, 0);
1661 #ifdef SDB_DEBUGGING_INFO
1662 if (write_symbols
== SDB_DEBUG
&& LABEL_NAME (insn
))
1663 sdbout_label (insn
);
1665 #ifdef DWARF_DEBUGGING_INFO
1666 if (write_symbols
== DWARF_DEBUG
&& LABEL_NAME (insn
))
1667 dwarfout_label (insn
);
1669 #ifdef DWARF2_DEBUGGING_INFO
1670 if (write_symbols
== DWARF2_DEBUG
&& LABEL_NAME (insn
))
1671 dwarf2out_label (insn
);
1675 fputs (ASM_APP_OFF
, file
);
1678 if (NEXT_INSN (insn
) != 0
1679 && GET_CODE (NEXT_INSN (insn
)) == JUMP_INSN
)
1681 rtx nextbody
= PATTERN (NEXT_INSN (insn
));
1683 /* If this label is followed by a jump-table,
1684 make sure we put the label in the read-only section. Also
1685 possibly write the label and jump table together. */
1687 if (GET_CODE (nextbody
) == ADDR_VEC
1688 || GET_CODE (nextbody
) == ADDR_DIFF_VEC
)
1690 #ifndef JUMP_TABLES_IN_TEXT_SECTION
1691 readonly_data_section ();
1692 #ifdef READONLY_DATA_SECTION
1693 ASM_OUTPUT_ALIGN (file
,
1694 exact_log2 (BIGGEST_ALIGNMENT
1696 #endif /* READONLY_DATA_SECTION */
1697 #else /* JUMP_TABLES_IN_TEXT_SECTION */
1698 function_section (current_function_decl
);
1699 #endif /* JUMP_TABLES_IN_TEXT_SECTION */
1700 #ifdef ASM_OUTPUT_CASE_LABEL
1701 ASM_OUTPUT_CASE_LABEL (file
, "L", CODE_LABEL_NUMBER (insn
),
1704 ASM_OUTPUT_INTERNAL_LABEL (file
, "L", CODE_LABEL_NUMBER (insn
));
1710 ASM_OUTPUT_INTERNAL_LABEL (file
, "L", CODE_LABEL_NUMBER (insn
));
1715 register rtx body
= PATTERN (insn
);
1716 int insn_code_number
;
1722 /* An INSN, JUMP_INSN or CALL_INSN.
1723 First check for special kinds that recog doesn't recognize. */
1725 if (GET_CODE (body
) == USE
/* These are just declarations */
1726 || GET_CODE (body
) == CLOBBER
)
1730 /* If there is a REG_CC_SETTER note on this insn, it means that
1731 the setting of the condition code was done in the delay slot
1732 of the insn that branched here. So recover the cc status
1733 from the insn that set it. */
1735 note
= find_reg_note (insn
, REG_CC_SETTER
, NULL_RTX
);
1738 NOTICE_UPDATE_CC (PATTERN (XEXP (note
, 0)), XEXP (note
, 0));
1739 cc_prev_status
= cc_status
;
1743 /* Detect insns that are really jump-tables
1744 and output them as such. */
1746 if (GET_CODE (body
) == ADDR_VEC
|| GET_CODE (body
) == ADDR_DIFF_VEC
)
1748 register int vlen
, idx
;
1755 fputs (ASM_APP_OFF
, file
);
1759 vlen
= XVECLEN (body
, GET_CODE (body
) == ADDR_DIFF_VEC
);
1760 for (idx
= 0; idx
< vlen
; idx
++)
1762 if (GET_CODE (body
) == ADDR_VEC
)
1764 #ifdef ASM_OUTPUT_ADDR_VEC_ELT
1765 ASM_OUTPUT_ADDR_VEC_ELT
1766 (file
, CODE_LABEL_NUMBER (XEXP (XVECEXP (body
, 0, idx
), 0)));
1773 #ifdef ASM_OUTPUT_ADDR_DIFF_ELT
1774 ASM_OUTPUT_ADDR_DIFF_ELT
1776 CODE_LABEL_NUMBER (XEXP (XVECEXP (body
, 1, idx
), 0)),
1777 CODE_LABEL_NUMBER (XEXP (XEXP (body
, 0), 0)));
1783 #ifdef ASM_OUTPUT_CASE_END
1784 ASM_OUTPUT_CASE_END (file
,
1785 CODE_LABEL_NUMBER (PREV_INSN (insn
)),
1789 function_section (current_function_decl
);
1794 /* Do basic-block profiling when we reach a new block.
1795 Done here to avoid jump tables. */
1796 if (profile_block_flag
&& new_block
)
1799 if (GET_CODE (body
) == ASM_INPUT
)
1801 /* There's no telling what that did to the condition codes. */
1807 fputs (ASM_APP_ON
, file
);
1810 fprintf (asm_out_file
, "\t%s\n", XSTR (body
, 0));
1814 /* Detect `asm' construct with operands. */
1815 if (asm_noperands (body
) >= 0)
1817 int noperands
= asm_noperands (body
);
1818 rtx
*ops
= (rtx
*) alloca (noperands
* sizeof (rtx
));
1821 /* There's no telling what that did to the condition codes. */
1828 fputs (ASM_APP_ON
, file
);
1832 /* Get out the operand values. */
1833 string
= decode_asm_operands (body
, ops
, NULL_PTR
,
1834 NULL_PTR
, NULL_PTR
);
1835 /* Inhibit aborts on what would otherwise be compiler bugs. */
1836 insn_noperands
= noperands
;
1837 this_is_asm_operands
= insn
;
1839 /* Output the insn using them. */
1840 output_asm_insn (string
, ops
);
1841 this_is_asm_operands
= 0;
1845 if (prescan
<= 0 && app_on
)
1847 fputs (ASM_APP_OFF
, file
);
1851 if (GET_CODE (body
) == SEQUENCE
)
1853 /* A delayed-branch sequence */
1859 final_sequence
= body
;
1861 /* The first insn in this SEQUENCE might be a JUMP_INSN that will
1862 force the restoration of a comparison that was previously
1863 thought unnecessary. If that happens, cancel this sequence
1864 and cause that insn to be restored. */
1866 next
= final_scan_insn (XVECEXP (body
, 0, 0), file
, 0, prescan
, 1);
1867 if (next
!= XVECEXP (body
, 0, 1))
1873 for (i
= 1; i
< XVECLEN (body
, 0); i
++)
1875 rtx insn
= XVECEXP (body
, 0, i
);
1876 rtx next
= NEXT_INSN (insn
);
1877 /* We loop in case any instruction in a delay slot gets
1880 insn
= final_scan_insn (insn
, file
, 0, prescan
, 1);
1881 while (insn
!= next
);
1883 #ifdef DBR_OUTPUT_SEQEND
1884 DBR_OUTPUT_SEQEND (file
);
1888 /* If the insn requiring the delay slot was a CALL_INSN, the
1889 insns in the delay slot are actually executed before the
1890 called function. Hence we don't preserve any CC-setting
1891 actions in these insns and the CC must be marked as being
1892 clobbered by the function. */
1893 if (GET_CODE (XVECEXP (body
, 0, 0)) == CALL_INSN
)
1898 /* Following a conditional branch sequence, we have a new basic
1900 if (profile_block_flag
)
1902 rtx insn
= XVECEXP (body
, 0, 0);
1903 rtx body
= PATTERN (insn
);
1905 if ((GET_CODE (insn
) == JUMP_INSN
&& GET_CODE (body
) == SET
1906 && GET_CODE (SET_SRC (body
)) != LABEL_REF
)
1907 || (GET_CODE (insn
) == JUMP_INSN
1908 && GET_CODE (body
) == PARALLEL
1909 && GET_CODE (XVECEXP (body
, 0, 0)) == SET
1910 && GET_CODE (SET_SRC (XVECEXP (body
, 0, 0))) != LABEL_REF
))
1916 /* We have a real machine instruction as rtl. */
1918 body
= PATTERN (insn
);
1921 set
= single_set(insn
);
1923 /* Check for redundant test and compare instructions
1924 (when the condition codes are already set up as desired).
1925 This is done only when optimizing; if not optimizing,
1926 it should be possible for the user to alter a variable
1927 with the debugger in between statements
1928 and the next statement should reexamine the variable
1929 to compute the condition codes. */
1934 rtx set
= single_set(insn
);
1938 && GET_CODE (SET_DEST (set
)) == CC0
1939 && insn
!= last_ignored_compare
)
1941 if (GET_CODE (SET_SRC (set
)) == SUBREG
)
1942 SET_SRC (set
) = alter_subreg (SET_SRC (set
));
1943 else if (GET_CODE (SET_SRC (set
)) == COMPARE
)
1945 if (GET_CODE (XEXP (SET_SRC (set
), 0)) == SUBREG
)
1946 XEXP (SET_SRC (set
), 0)
1947 = alter_subreg (XEXP (SET_SRC (set
), 0));
1948 if (GET_CODE (XEXP (SET_SRC (set
), 1)) == SUBREG
)
1949 XEXP (SET_SRC (set
), 1)
1950 = alter_subreg (XEXP (SET_SRC (set
), 1));
1952 if ((cc_status
.value1
!= 0
1953 && rtx_equal_p (SET_SRC (set
), cc_status
.value1
))
1954 || (cc_status
.value2
!= 0
1955 && rtx_equal_p (SET_SRC (set
), cc_status
.value2
)))
1957 /* Don't delete insn if it has an addressing side-effect. */
1958 if (! FIND_REG_INC_NOTE (insn
, 0)
1959 /* or if anything in it is volatile. */
1960 && ! volatile_refs_p (PATTERN (insn
)))
1962 /* We don't really delete the insn; just ignore it. */
1963 last_ignored_compare
= insn
;
1971 /* Following a conditional branch, we have a new basic block.
1972 But if we are inside a sequence, the new block starts after the
1973 last insn of the sequence. */
1974 if (profile_block_flag
&& final_sequence
== 0
1975 && ((GET_CODE (insn
) == JUMP_INSN
&& GET_CODE (body
) == SET
1976 && GET_CODE (SET_SRC (body
)) != LABEL_REF
)
1977 || (GET_CODE (insn
) == JUMP_INSN
&& GET_CODE (body
) == PARALLEL
1978 && GET_CODE (XVECEXP (body
, 0, 0)) == SET
1979 && GET_CODE (SET_SRC (XVECEXP (body
, 0, 0))) != LABEL_REF
)))
1983 /* Don't bother outputting obvious no-ops, even without -O.
1984 This optimization is fast and doesn't interfere with debugging.
1985 Don't do this if the insn is in a delay slot, since this
1986 will cause an improper number of delay insns to be written. */
1987 if (final_sequence
== 0
1989 && GET_CODE (insn
) == INSN
&& GET_CODE (body
) == SET
1990 && GET_CODE (SET_SRC (body
)) == REG
1991 && GET_CODE (SET_DEST (body
)) == REG
1992 && REGNO (SET_SRC (body
)) == REGNO (SET_DEST (body
)))
1997 /* If this is a conditional branch, maybe modify it
1998 if the cc's are in a nonstandard state
1999 so that it accomplishes the same thing that it would
2000 do straightforwardly if the cc's were set up normally. */
2002 if (cc_status
.flags
!= 0
2003 && GET_CODE (insn
) == JUMP_INSN
2004 && GET_CODE (body
) == SET
2005 && SET_DEST (body
) == pc_rtx
2006 && GET_CODE (SET_SRC (body
)) == IF_THEN_ELSE
2007 && GET_RTX_CLASS (GET_CODE (XEXP (SET_SRC (body
), 0))) == '<'
2008 && XEXP (XEXP (SET_SRC (body
), 0), 0) == cc0_rtx
2009 /* This is done during prescan; it is not done again
2010 in final scan when prescan has been done. */
2013 /* This function may alter the contents of its argument
2014 and clear some of the cc_status.flags bits.
2015 It may also return 1 meaning condition now always true
2016 or -1 meaning condition now always false
2017 or 2 meaning condition nontrivial but altered. */
2018 register int result
= alter_cond (XEXP (SET_SRC (body
), 0));
2019 /* If condition now has fixed value, replace the IF_THEN_ELSE
2020 with its then-operand or its else-operand. */
2022 SET_SRC (body
) = XEXP (SET_SRC (body
), 1);
2024 SET_SRC (body
) = XEXP (SET_SRC (body
), 2);
2026 /* The jump is now either unconditional or a no-op.
2027 If it has become a no-op, don't try to output it.
2028 (It would not be recognized.) */
2029 if (SET_SRC (body
) == pc_rtx
)
2031 PUT_CODE (insn
, NOTE
);
2032 NOTE_LINE_NUMBER (insn
) = NOTE_INSN_DELETED
;
2033 NOTE_SOURCE_FILE (insn
) = 0;
2036 else if (GET_CODE (SET_SRC (body
)) == RETURN
)
2037 /* Replace (set (pc) (return)) with (return). */
2038 PATTERN (insn
) = body
= SET_SRC (body
);
2040 /* Rerecognize the instruction if it has changed. */
2042 INSN_CODE (insn
) = -1;
2045 /* Make same adjustments to instructions that examine the
2046 condition codes without jumping and instructions that
2047 handle conditional moves (if this machine has either one). */
2049 if (cc_status
.flags
!= 0
2052 rtx cond_rtx
, then_rtx
, else_rtx
;
2054 if (GET_CODE (insn
) != JUMP_INSN
2055 && GET_CODE (SET_SRC (set
)) == IF_THEN_ELSE
)
2057 cond_rtx
= XEXP (SET_SRC (set
), 0);
2058 then_rtx
= XEXP (SET_SRC (set
), 1);
2059 else_rtx
= XEXP (SET_SRC (set
), 2);
2063 cond_rtx
= SET_SRC (set
);
2064 then_rtx
= const_true_rtx
;
2065 else_rtx
= const0_rtx
;
2068 switch (GET_CODE (cond_rtx
))
2081 register int result
;
2082 if (XEXP (cond_rtx
, 0) != cc0_rtx
)
2084 result
= alter_cond (cond_rtx
);
2086 validate_change (insn
, &SET_SRC (set
), then_rtx
, 0);
2087 else if (result
== -1)
2088 validate_change (insn
, &SET_SRC (set
), else_rtx
, 0);
2089 else if (result
== 2)
2090 INSN_CODE (insn
) = -1;
2091 if (SET_DEST (set
) == SET_SRC (set
))
2093 PUT_CODE (insn
, NOTE
);
2094 NOTE_LINE_NUMBER (insn
) = NOTE_INSN_DELETED
;
2095 NOTE_SOURCE_FILE (insn
) = 0;
2107 /* Do machine-specific peephole optimizations if desired. */
2109 if (optimize
&& !flag_no_peephole
&& !nopeepholes
)
2111 rtx next
= peephole (insn
);
2112 /* When peepholing, if there were notes within the peephole,
2113 emit them before the peephole. */
2114 if (next
!= 0 && next
!= NEXT_INSN (insn
))
2116 rtx prev
= PREV_INSN (insn
);
2119 for (note
= NEXT_INSN (insn
); note
!= next
;
2120 note
= NEXT_INSN (note
))
2121 final_scan_insn (note
, file
, optimize
, prescan
, nopeepholes
);
2123 /* In case this is prescan, put the notes
2124 in proper position for later rescan. */
2125 note
= NEXT_INSN (insn
);
2126 PREV_INSN (note
) = prev
;
2127 NEXT_INSN (prev
) = note
;
2128 NEXT_INSN (PREV_INSN (next
)) = insn
;
2129 PREV_INSN (insn
) = PREV_INSN (next
);
2130 NEXT_INSN (insn
) = next
;
2131 PREV_INSN (next
) = insn
;
2134 /* PEEPHOLE might have changed this. */
2135 body
= PATTERN (insn
);
2138 /* Try to recognize the instruction.
2139 If successful, verify that the operands satisfy the
2140 constraints for the instruction. Crash if they don't,
2141 since `reload' should have changed them so that they do. */
2143 insn_code_number
= recog_memoized (insn
);
2144 insn_extract (insn
);
2145 for (i
= 0; i
< insn_n_operands
[insn_code_number
]; i
++)
2147 if (GET_CODE (recog_operand
[i
]) == SUBREG
)
2148 recog_operand
[i
] = alter_subreg (recog_operand
[i
]);
2149 else if (GET_CODE (recog_operand
[i
]) == PLUS
2150 || GET_CODE (recog_operand
[i
]) == MULT
)
2151 recog_operand
[i
] = walk_alter_subreg (recog_operand
[i
]);
2154 for (i
= 0; i
< insn_n_dups
[insn_code_number
]; i
++)
2156 if (GET_CODE (*recog_dup_loc
[i
]) == SUBREG
)
2157 *recog_dup_loc
[i
] = alter_subreg (*recog_dup_loc
[i
]);
2158 else if (GET_CODE (*recog_dup_loc
[i
]) == PLUS
2159 || GET_CODE (*recog_dup_loc
[i
]) == MULT
)
2160 *recog_dup_loc
[i
] = walk_alter_subreg (*recog_dup_loc
[i
]);
2163 #ifdef REGISTER_CONSTRAINTS
2164 if (! constrain_operands (insn_code_number
, 1))
2165 fatal_insn_not_found (insn
);
2168 /* Some target machines need to prescan each insn before
2171 #ifdef FINAL_PRESCAN_INSN
2172 FINAL_PRESCAN_INSN (insn
, recog_operand
,
2173 insn_n_operands
[insn_code_number
]);
2177 cc_prev_status
= cc_status
;
2179 /* Update `cc_status' for this instruction.
2180 The instruction's output routine may change it further.
2181 If the output routine for a jump insn needs to depend
2182 on the cc status, it should look at cc_prev_status. */
2184 NOTICE_UPDATE_CC (body
, insn
);
2189 #if defined (DWARF2_UNWIND_INFO) && !defined (ACCUMULATE_OUTGOING_ARGS)
2190 /* If we push arguments, we want to know where the calls are. */
2191 if (GET_CODE (insn
) == CALL_INSN
&& dwarf2out_do_frame ())
2192 dwarf2out_frame_debug (insn
);
2195 /* If the proper template needs to be chosen by some C code,
2196 run that code and get the real template. */
2198 template = insn_template
[insn_code_number
];
2201 template = (*insn_outfun
[insn_code_number
]) (recog_operand
, insn
);
2203 /* If the C code returns 0, it means that it is a jump insn
2204 which follows a deleted test insn, and that test insn
2205 needs to be reinserted. */
2208 if (prev_nonnote_insn (insn
) != last_ignored_compare
)
2211 return prev_nonnote_insn (insn
);
2215 /* If the template is the string "#", it means that this insn must
2217 if (template[0] == '#' && template[1] == '\0')
2219 rtx
new = try_split (body
, insn
, 0);
2221 /* If we didn't split the insn, go away. */
2222 if (new == insn
&& PATTERN (new) == body
)
2225 #ifdef HAVE_ATTR_length
2226 /* This instruction should have been split in shorten_branches,
2227 to ensure that we would have valid length info for the
2239 /* Output assembler code from the template. */
2241 output_asm_insn (template, recog_operand
);
2243 #if defined (DWARF2_UNWIND_INFO)
2244 #if !defined (ACCUMULATE_OUTGOING_ARGS)
2245 /* If we push arguments, we need to check all insns for stack
2247 if (GET_CODE (insn
) == INSN
&& dwarf2out_do_frame ())
2248 dwarf2out_frame_debug (insn
);
2250 #if defined (HAVE_prologue)
2251 /* If this insn is part of the prologue, emit DWARF v2
2253 if (RTX_FRAME_RELATED_P (insn
) && dwarf2out_do_frame ())
2254 dwarf2out_frame_debug (insn
);
2260 /* It's not at all clear why we did this and doing so interferes
2261 with tests we'd like to do to use REG_WAS_0 notes, so let's try
2264 /* Mark this insn as having been output. */
2265 INSN_DELETED_P (insn
) = 1;
2271 return NEXT_INSN (insn
);
2274 /* Output debugging info to the assembler file FILE
2275 based on the NOTE-insn INSN, assumed to be a line number. */
2278 output_source_line (file
, insn
)
2282 register char *filename
= NOTE_SOURCE_FILE (insn
);
2284 /* Remember filename for basic block profiling.
2285 Filenames are allocated on the permanent obstack
2286 or are passed in ARGV, so we don't have to save
2289 if (profile_block_flag
&& last_filename
!= filename
)
2290 bb_file_label_num
= add_bb_string (filename
, TRUE
);
2292 last_filename
= filename
;
2293 last_linenum
= NOTE_LINE_NUMBER (insn
);
2294 high_block_linenum
= MAX (last_linenum
, high_block_linenum
);
2295 high_function_linenum
= MAX (last_linenum
, high_function_linenum
);
2297 if (write_symbols
!= NO_DEBUG
)
2299 #ifdef SDB_DEBUGGING_INFO
2300 if (write_symbols
== SDB_DEBUG
2301 #if 0 /* People like having line numbers even in wrong file! */
2302 /* COFF can't handle multiple source files--lose, lose. */
2303 && !strcmp (filename
, main_input_filename
)
2305 /* COFF relative line numbers must be positive. */
2306 && last_linenum
> sdb_begin_function_line
)
2308 #ifdef ASM_OUTPUT_SOURCE_LINE
2309 ASM_OUTPUT_SOURCE_LINE (file
, last_linenum
);
2311 fprintf (file
, "\t.ln\t%d\n",
2312 ((sdb_begin_function_line
> -1)
2313 ? last_linenum
- sdb_begin_function_line
: 1));
2318 #if defined (DBX_DEBUGGING_INFO)
2319 if (write_symbols
== DBX_DEBUG
)
2320 dbxout_source_line (file
, filename
, NOTE_LINE_NUMBER (insn
));
2323 #if defined (XCOFF_DEBUGGING_INFO)
2324 if (write_symbols
== XCOFF_DEBUG
)
2325 xcoffout_source_line (file
, filename
, insn
);
2328 #ifdef DWARF_DEBUGGING_INFO
2329 if (write_symbols
== DWARF_DEBUG
)
2330 dwarfout_line (filename
, NOTE_LINE_NUMBER (insn
));
2333 #ifdef DWARF2_DEBUGGING_INFO
2334 if (write_symbols
== DWARF2_DEBUG
)
2335 dwarf2out_line (filename
, NOTE_LINE_NUMBER (insn
));
2340 /* If X is a SUBREG, replace it with a REG or a MEM,
2341 based on the thing it is a subreg of. */
2347 register rtx y
= SUBREG_REG (x
);
2348 if (GET_CODE (y
) == SUBREG
)
2349 y
= alter_subreg (y
);
2351 if (GET_CODE (y
) == REG
)
2353 /* If the containing reg really gets a hard reg, so do we. */
2355 REGNO (x
) = REGNO (y
) + SUBREG_WORD (x
);
2357 else if (GET_CODE (y
) == MEM
)
2359 register int offset
= SUBREG_WORD (x
) * UNITS_PER_WORD
;
2360 if (BYTES_BIG_ENDIAN
)
2361 offset
-= (MIN (UNITS_PER_WORD
, GET_MODE_SIZE (GET_MODE (x
)))
2362 - MIN (UNITS_PER_WORD
, GET_MODE_SIZE (GET_MODE (y
))));
2364 MEM_VOLATILE_P (x
) = MEM_VOLATILE_P (y
);
2365 XEXP (x
, 0) = plus_constant (XEXP (y
, 0), offset
);
2371 /* Do alter_subreg on all the SUBREGs contained in X. */
2374 walk_alter_subreg (x
)
2377 switch (GET_CODE (x
))
2381 XEXP (x
, 0) = walk_alter_subreg (XEXP (x
, 0));
2382 XEXP (x
, 1) = walk_alter_subreg (XEXP (x
, 1));
2386 XEXP (x
, 0) = walk_alter_subreg (XEXP (x
, 0));
2390 return alter_subreg (x
);
2401 /* Given BODY, the body of a jump instruction, alter the jump condition
2402 as required by the bits that are set in cc_status.flags.
2403 Not all of the bits there can be handled at this level in all cases.
2405 The value is normally 0.
2406 1 means that the condition has become always true.
2407 -1 means that the condition has become always false.
2408 2 means that COND has been altered. */
2416 if (cc_status
.flags
& CC_REVERSED
)
2419 PUT_CODE (cond
, swap_condition (GET_CODE (cond
)));
2422 if (cc_status
.flags
& CC_INVERTED
)
2425 PUT_CODE (cond
, reverse_condition (GET_CODE (cond
)));
2428 if (cc_status
.flags
& CC_NOT_POSITIVE
)
2429 switch (GET_CODE (cond
))
2434 /* Jump becomes unconditional. */
2440 /* Jump becomes no-op. */
2444 PUT_CODE (cond
, EQ
);
2449 PUT_CODE (cond
, NE
);
2457 if (cc_status
.flags
& CC_NOT_NEGATIVE
)
2458 switch (GET_CODE (cond
))
2462 /* Jump becomes unconditional. */
2467 /* Jump becomes no-op. */
2472 PUT_CODE (cond
, EQ
);
2478 PUT_CODE (cond
, NE
);
2486 if (cc_status
.flags
& CC_NO_OVERFLOW
)
2487 switch (GET_CODE (cond
))
2490 /* Jump becomes unconditional. */
2494 PUT_CODE (cond
, EQ
);
2499 PUT_CODE (cond
, NE
);
2504 /* Jump becomes no-op. */
2511 if (cc_status
.flags
& (CC_Z_IN_NOT_N
| CC_Z_IN_N
))
2512 switch (GET_CODE (cond
))
2518 PUT_CODE (cond
, cc_status
.flags
& CC_Z_IN_N
? GE
: LT
);
2523 PUT_CODE (cond
, cc_status
.flags
& CC_Z_IN_N
? LT
: GE
);
2528 if (cc_status
.flags
& CC_NOT_SIGNED
)
2529 /* The flags are valid if signed condition operators are converted
2531 switch (GET_CODE (cond
))
2534 PUT_CODE (cond
, LEU
);
2539 PUT_CODE (cond
, LTU
);
2544 PUT_CODE (cond
, GTU
);
2549 PUT_CODE (cond
, GEU
);
2561 /* Report inconsistency between the assembler template and the operands.
2562 In an `asm', it's the user's fault; otherwise, the compiler's fault. */
2565 output_operand_lossage (str
)
2568 if (this_is_asm_operands
)
2569 error_for_asm (this_is_asm_operands
, "invalid `asm': %s", str
);
2574 /* Output of assembler code from a template, and its subroutines. */
2576 /* Output text from TEMPLATE to the assembler output file,
2577 obeying %-directions to substitute operands taken from
2578 the vector OPERANDS.
2580 %N (for N a digit) means print operand N in usual manner.
2581 %lN means require operand N to be a CODE_LABEL or LABEL_REF
2582 and print the label name with no punctuation.
2583 %cN means require operand N to be a constant
2584 and print the constant expression with no punctuation.
2585 %aN means expect operand N to be a memory address
2586 (not a memory reference!) and print a reference
2588 %nN means expect operand N to be a constant
2589 and print a constant expression for minus the value
2590 of the operand, with no other punctuation. */
2595 if (flag_print_asm_name
)
2597 /* Annotate the assembly with a comment describing the pattern and
2598 alternative used. */
2601 register int num
= INSN_CODE (debug_insn
);
2602 fprintf (asm_out_file
, " %s %d %s",
2603 ASM_COMMENT_START
, INSN_UID (debug_insn
), insn_name
[num
]);
2604 if (insn_n_alternatives
[num
] > 1)
2605 fprintf (asm_out_file
, "/%d", which_alternative
+ 1);
2607 /* Clear this so only the first assembler insn
2608 of any rtl insn will get the special comment for -dp. */
2615 output_asm_insn (template, operands
)
2622 /* An insn may return a null string template
2623 in a case where no assembler code is needed. */
2628 putc ('\t', asm_out_file
);
2630 #ifdef ASM_OUTPUT_OPCODE
2631 ASM_OUTPUT_OPCODE (asm_out_file
, p
);
2639 putc (c
, asm_out_file
);
2640 #ifdef ASM_OUTPUT_OPCODE
2641 while ((c
= *p
) == '\t')
2643 putc (c
, asm_out_file
);
2646 ASM_OUTPUT_OPCODE (asm_out_file
, p
);
2650 #ifdef ASSEMBLER_DIALECT
2655 /* If we want the first dialect, do nothing. Otherwise, skip
2656 DIALECT_NUMBER of strings ending with '|'. */
2657 for (i
= 0; i
< dialect_number
; i
++)
2659 while (*p
&& *p
++ != '|')
2669 /* Skip to close brace. */
2670 while (*p
&& *p
++ != '}')
2679 /* %% outputs a single %. */
2683 putc (c
, asm_out_file
);
2685 /* %= outputs a number which is unique to each insn in the entire
2686 compilation. This is useful for making local labels that are
2687 referred to more than once in a given insn. */
2691 fprintf (asm_out_file
, "%d", insn_counter
);
2693 /* % followed by a letter and some digits
2694 outputs an operand in a special way depending on the letter.
2695 Letters `acln' are implemented directly.
2696 Other letters are passed to `output_operand' so that
2697 the PRINT_OPERAND macro can define them. */
2698 else if ((*p
>= 'a' && *p
<= 'z')
2699 || (*p
>= 'A' && *p
<= 'Z'))
2704 if (! (*p
>= '0' && *p
<= '9'))
2705 output_operand_lossage ("operand number missing after %-letter");
2706 else if (this_is_asm_operands
&& c
>= (unsigned) insn_noperands
)
2707 output_operand_lossage ("operand number out of range");
2708 else if (letter
== 'l')
2709 output_asm_label (operands
[c
]);
2710 else if (letter
== 'a')
2711 output_address (operands
[c
]);
2712 else if (letter
== 'c')
2714 if (CONSTANT_ADDRESS_P (operands
[c
]))
2715 output_addr_const (asm_out_file
, operands
[c
]);
2717 output_operand (operands
[c
], 'c');
2719 else if (letter
== 'n')
2721 if (GET_CODE (operands
[c
]) == CONST_INT
)
2722 fprintf (asm_out_file
, HOST_WIDE_INT_PRINT_DEC
,
2723 - INTVAL (operands
[c
]));
2726 putc ('-', asm_out_file
);
2727 output_addr_const (asm_out_file
, operands
[c
]);
2731 output_operand (operands
[c
], letter
);
2733 while ((c
= *p
) >= '0' && c
<= '9') p
++;
2735 /* % followed by a digit outputs an operand the default way. */
2736 else if (*p
>= '0' && *p
<= '9')
2739 if (this_is_asm_operands
&& c
>= (unsigned) insn_noperands
)
2740 output_operand_lossage ("operand number out of range");
2742 output_operand (operands
[c
], 0);
2743 while ((c
= *p
) >= '0' && c
<= '9') p
++;
2745 /* % followed by punctuation: output something for that
2746 punctuation character alone, with no operand.
2747 The PRINT_OPERAND macro decides what is actually done. */
2748 #ifdef PRINT_OPERAND_PUNCT_VALID_P
2749 else if (PRINT_OPERAND_PUNCT_VALID_P (*p
))
2750 output_operand (NULL_RTX
, *p
++);
2753 output_operand_lossage ("invalid %%-code");
2757 putc (c
, asm_out_file
);
2762 putc ('\n', asm_out_file
);
2765 /* Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol. */
2768 output_asm_label (x
)
2773 if (GET_CODE (x
) == LABEL_REF
)
2774 ASM_GENERATE_INTERNAL_LABEL (buf
, "L", CODE_LABEL_NUMBER (XEXP (x
, 0)));
2775 else if (GET_CODE (x
) == CODE_LABEL
)
2776 ASM_GENERATE_INTERNAL_LABEL (buf
, "L", CODE_LABEL_NUMBER (x
));
2778 output_operand_lossage ("`%l' operand isn't a label");
2780 assemble_name (asm_out_file
, buf
);
2783 /* Print operand X using machine-dependent assembler syntax.
2784 The macro PRINT_OPERAND is defined just to control this function.
2785 CODE is a non-digit that preceded the operand-number in the % spec,
2786 such as 'z' if the spec was `%z3'. CODE is 0 if there was no char
2787 between the % and the digits.
2788 When CODE is a non-letter, X is 0.
2790 The meanings of the letters are machine-dependent and controlled
2791 by PRINT_OPERAND. */
2794 output_operand (x
, code
)
2798 if (x
&& GET_CODE (x
) == SUBREG
)
2799 x
= alter_subreg (x
);
2801 /* If X is a pseudo-register, abort now rather than writing trash to the
2804 if (x
&& GET_CODE (x
) == REG
&& REGNO (x
) >= FIRST_PSEUDO_REGISTER
)
2807 PRINT_OPERAND (asm_out_file
, x
, code
);
2810 /* Print a memory reference operand for address X
2811 using machine-dependent assembler syntax.
2812 The macro PRINT_OPERAND_ADDRESS exists just to control this function. */
2818 walk_alter_subreg (x
);
2819 PRINT_OPERAND_ADDRESS (asm_out_file
, x
);
2822 /* Print an integer constant expression in assembler syntax.
2823 Addition and subtraction are the only arithmetic
2824 that may appear in these expressions. */
2827 output_addr_const (file
, x
)
2834 switch (GET_CODE (x
))
2844 assemble_name (file
, XSTR (x
, 0));
2848 ASM_GENERATE_INTERNAL_LABEL (buf
, "L", CODE_LABEL_NUMBER (XEXP (x
, 0)));
2849 assemble_name (file
, buf
);
2853 ASM_GENERATE_INTERNAL_LABEL (buf
, "L", CODE_LABEL_NUMBER (x
));
2854 assemble_name (file
, buf
);
2858 fprintf (file
, HOST_WIDE_INT_PRINT_DEC
, INTVAL (x
));
2862 /* This used to output parentheses around the expression,
2863 but that does not work on the 386 (either ATT or BSD assembler). */
2864 output_addr_const (file
, XEXP (x
, 0));
2868 if (GET_MODE (x
) == VOIDmode
)
2870 /* We can use %d if the number is one word and positive. */
2871 if (CONST_DOUBLE_HIGH (x
))
2872 fprintf (file
, HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
2873 CONST_DOUBLE_HIGH (x
), CONST_DOUBLE_LOW (x
));
2874 else if (CONST_DOUBLE_LOW (x
) < 0)
2875 fprintf (file
, HOST_WIDE_INT_PRINT_HEX
, CONST_DOUBLE_LOW (x
));
2877 fprintf (file
, HOST_WIDE_INT_PRINT_DEC
, CONST_DOUBLE_LOW (x
));
2880 /* We can't handle floating point constants;
2881 PRINT_OPERAND must handle them. */
2882 output_operand_lossage ("floating constant misused");
2886 /* Some assemblers need integer constants to appear last (eg masm). */
2887 if (GET_CODE (XEXP (x
, 0)) == CONST_INT
)
2889 output_addr_const (file
, XEXP (x
, 1));
2890 if (INTVAL (XEXP (x
, 0)) >= 0)
2891 fprintf (file
, "+");
2892 output_addr_const (file
, XEXP (x
, 0));
2896 output_addr_const (file
, XEXP (x
, 0));
2897 if (INTVAL (XEXP (x
, 1)) >= 0)
2898 fprintf (file
, "+");
2899 output_addr_const (file
, XEXP (x
, 1));
2904 /* Avoid outputting things like x-x or x+5-x,
2905 since some assemblers can't handle that. */
2906 x
= simplify_subtraction (x
);
2907 if (GET_CODE (x
) != MINUS
)
2910 output_addr_const (file
, XEXP (x
, 0));
2911 fprintf (file
, "-");
2912 if (GET_CODE (XEXP (x
, 1)) == CONST_INT
2913 && INTVAL (XEXP (x
, 1)) < 0)
2915 fprintf (file
, ASM_OPEN_PAREN
);
2916 output_addr_const (file
, XEXP (x
, 1));
2917 fprintf (file
, ASM_CLOSE_PAREN
);
2920 output_addr_const (file
, XEXP (x
, 1));
2925 output_addr_const (file
, XEXP (x
, 0));
2929 output_operand_lossage ("invalid expression as operand");
2933 /* A poor man's fprintf, with the added features of %I, %R, %L, and %U.
2934 %R prints the value of REGISTER_PREFIX.
2935 %L prints the value of LOCAL_LABEL_PREFIX.
2936 %U prints the value of USER_LABEL_PREFIX.
2937 %I prints the value of IMMEDIATE_PREFIX.
2938 %O runs ASM_OUTPUT_OPCODE to transform what follows in the string.
2939 Also supported are %d, %x, %s, %e, %f, %g and %%.
2941 We handle alternate assembler dialects here, just like output_asm_insn. */
2944 asm_fprintf
VPROTO((FILE *file
, char *p
, ...))
2954 VA_START (argptr
, p
);
2957 file
= va_arg (argptr
, FILE *);
2958 p
= va_arg (argptr
, char *);
2966 #ifdef ASSEMBLER_DIALECT
2971 /* If we want the first dialect, do nothing. Otherwise, skip
2972 DIALECT_NUMBER of strings ending with '|'. */
2973 for (i
= 0; i
< dialect_number
; i
++)
2975 while (*p
&& *p
++ != '|')
2985 /* Skip to close brace. */
2986 while (*p
&& *p
++ != '}')
2997 while ((c
>= '0' && c
<= '9') || c
== '.')
3005 fprintf (file
, "%%");
3008 case 'd': case 'i': case 'u':
3009 case 'x': case 'p': case 'X':
3013 fprintf (file
, buf
, va_arg (argptr
, int));
3017 /* This is a prefix to the 'd', 'i', 'u', 'x', 'p', and 'X' cases,
3018 but we do not check for those cases. It means that the value
3019 is a HOST_WIDE_INT, which may be either `int' or `long'. */
3021 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
3023 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
3033 fprintf (file
, buf
, va_arg (argptr
, HOST_WIDE_INT
));
3040 fprintf (file
, buf
, va_arg (argptr
, long));
3048 fprintf (file
, buf
, va_arg (argptr
, double));
3054 fprintf (file
, buf
, va_arg (argptr
, char *));
3058 #ifdef ASM_OUTPUT_OPCODE
3059 ASM_OUTPUT_OPCODE (asm_out_file
, p
);
3064 #ifdef REGISTER_PREFIX
3065 fprintf (file
, "%s", REGISTER_PREFIX
);
3070 #ifdef IMMEDIATE_PREFIX
3071 fprintf (file
, "%s", IMMEDIATE_PREFIX
);
3076 #ifdef LOCAL_LABEL_PREFIX
3077 fprintf (file
, "%s", LOCAL_LABEL_PREFIX
);
3082 #ifdef USER_LABEL_PREFIX
3083 fprintf (file
, "%s", USER_LABEL_PREFIX
);
3097 /* Split up a CONST_DOUBLE or integer constant rtx
3098 into two rtx's for single words,
3099 storing in *FIRST the word that comes first in memory in the target
3100 and in *SECOND the other. */
3103 split_double (value
, first
, second
)
3105 rtx
*first
, *second
;
3107 if (GET_CODE (value
) == CONST_INT
)
3109 if (HOST_BITS_PER_WIDE_INT
>= (2 * BITS_PER_WORD
))
3111 /* In this case the CONST_INT holds both target words.
3112 Extract the bits from it into two word-sized pieces. */
3114 HOST_WIDE_INT word_mask
;
3115 /* Avoid warnings for shift count >= BITS_PER_WORD. */
3116 int shift_count
= BITS_PER_WORD
- 1;
3118 word_mask
= (HOST_WIDE_INT
) 1 << shift_count
;
3119 word_mask
|= word_mask
- 1;
3120 low
= GEN_INT (INTVAL (value
) & word_mask
);
3121 high
= GEN_INT ((INTVAL (value
) >> (shift_count
+ 1)) & word_mask
);
3122 if (WORDS_BIG_ENDIAN
)
3135 /* The rule for using CONST_INT for a wider mode
3136 is that we regard the value as signed.
3137 So sign-extend it. */
3138 rtx high
= (INTVAL (value
) < 0 ? constm1_rtx
: const0_rtx
);
3139 if (WORDS_BIG_ENDIAN
)
3151 else if (GET_CODE (value
) != CONST_DOUBLE
)
3153 if (WORDS_BIG_ENDIAN
)
3155 *first
= const0_rtx
;
3161 *second
= const0_rtx
;
3164 else if (GET_MODE (value
) == VOIDmode
3165 /* This is the old way we did CONST_DOUBLE integers. */
3166 || GET_MODE_CLASS (GET_MODE (value
)) == MODE_INT
)
3168 /* In an integer, the words are defined as most and least significant.
3169 So order them by the target's convention. */
3170 if (WORDS_BIG_ENDIAN
)
3172 *first
= GEN_INT (CONST_DOUBLE_HIGH (value
));
3173 *second
= GEN_INT (CONST_DOUBLE_LOW (value
));
3177 *first
= GEN_INT (CONST_DOUBLE_LOW (value
));
3178 *second
= GEN_INT (CONST_DOUBLE_HIGH (value
));
3183 #ifdef REAL_ARITHMETIC
3184 REAL_VALUE_TYPE r
; long l
[2];
3185 REAL_VALUE_FROM_CONST_DOUBLE (r
, value
);
3187 /* Note, this converts the REAL_VALUE_TYPE to the target's
3188 format, splits up the floating point double and outputs
3189 exactly 32 bits of it into each of l[0] and l[1] --
3190 not necessarily BITS_PER_WORD bits. */
3191 REAL_VALUE_TO_TARGET_DOUBLE (r
, l
);
3193 *first
= GEN_INT ((HOST_WIDE_INT
) l
[0]);
3194 *second
= GEN_INT ((HOST_WIDE_INT
) l
[1]);
3196 if ((HOST_FLOAT_FORMAT
!= TARGET_FLOAT_FORMAT
3197 || HOST_BITS_PER_WIDE_INT
!= BITS_PER_WORD
)
3198 && ! flag_pretend_float
)
3202 #ifdef HOST_WORDS_BIG_ENDIAN
3209 /* Host and target agree => no need to swap. */
3210 *first
= GEN_INT (CONST_DOUBLE_LOW (value
));
3211 *second
= GEN_INT (CONST_DOUBLE_HIGH (value
));
3215 *second
= GEN_INT (CONST_DOUBLE_LOW (value
));
3216 *first
= GEN_INT (CONST_DOUBLE_HIGH (value
));
3218 #endif /* no REAL_ARITHMETIC */
3222 /* Return nonzero if this function has no function calls. */
3229 if (profile_flag
|| profile_block_flag
|| profile_arc_flag
)
3232 for (insn
= get_insns (); insn
; insn
= NEXT_INSN (insn
))
3234 if (GET_CODE (insn
) == CALL_INSN
)
3236 if (GET_CODE (insn
) == INSN
3237 && GET_CODE (PATTERN (insn
)) == SEQUENCE
3238 && GET_CODE (XVECEXP (PATTERN (insn
), 0, 0)) == CALL_INSN
)
3241 for (insn
= current_function_epilogue_delay_list
; insn
; insn
= XEXP (insn
, 1))
3243 if (GET_CODE (XEXP (insn
, 0)) == CALL_INSN
)
3245 if (GET_CODE (XEXP (insn
, 0)) == INSN
3246 && GET_CODE (PATTERN (XEXP (insn
, 0))) == SEQUENCE
3247 && GET_CODE (XVECEXP (PATTERN (XEXP (insn
, 0)), 0, 0)) == CALL_INSN
)
3254 /* On some machines, a function with no call insns
3255 can run faster if it doesn't create its own register window.
3256 When output, the leaf function should use only the "output"
3257 registers. Ordinarily, the function would be compiled to use
3258 the "input" registers to find its arguments; it is a candidate
3259 for leaf treatment if it uses only the "input" registers.
3260 Leaf function treatment means renumbering so the function
3261 uses the "output" registers instead. */
3263 #ifdef LEAF_REGISTERS
3265 static char permitted_reg_in_leaf_functions
[] = LEAF_REGISTERS
;
3267 /* Return 1 if this function uses only the registers that can be
3268 safely renumbered. */
3271 only_leaf_regs_used ()
3275 for (i
= 0; i
< FIRST_PSEUDO_REGISTER
; i
++)
3277 if ((regs_ever_live
[i
] || global_regs
[i
])
3278 && ! permitted_reg_in_leaf_functions
[i
])
3284 /* Scan all instructions and renumber all registers into those
3285 available in leaf functions. */
3288 leaf_renumber_regs (first
)
3293 /* Renumber only the actual patterns.
3294 The reg-notes can contain frame pointer refs,
3295 and renumbering them could crash, and should not be needed. */
3296 for (insn
= first
; insn
; insn
= NEXT_INSN (insn
))
3297 if (GET_RTX_CLASS (GET_CODE (insn
)) == 'i')
3298 leaf_renumber_regs_insn (PATTERN (insn
));
3299 for (insn
= current_function_epilogue_delay_list
; insn
; insn
= XEXP (insn
, 1))
3300 if (GET_RTX_CLASS (GET_CODE (XEXP (insn
, 0))) == 'i')
3301 leaf_renumber_regs_insn (PATTERN (XEXP (insn
, 0)));
3304 /* Scan IN_RTX and its subexpressions, and renumber all regs into those
3305 available in leaf functions. */
3308 leaf_renumber_regs_insn (in_rtx
)
3309 register rtx in_rtx
;
3312 register char *format_ptr
;
3317 /* Renumber all input-registers into output-registers.
3318 renumbered_regs would be 1 for an output-register;
3321 if (GET_CODE (in_rtx
) == REG
)
3325 /* Don't renumber the same reg twice. */
3329 newreg
= REGNO (in_rtx
);
3330 /* Don't try to renumber pseudo regs. It is possible for a pseudo reg
3331 to reach here as part of a REG_NOTE. */
3332 if (newreg
>= FIRST_PSEUDO_REGISTER
)
3337 newreg
= LEAF_REG_REMAP (newreg
);
3340 regs_ever_live
[REGNO (in_rtx
)] = 0;
3341 regs_ever_live
[newreg
] = 1;
3342 REGNO (in_rtx
) = newreg
;
3346 if (GET_RTX_CLASS (GET_CODE (in_rtx
)) == 'i')
3348 /* Inside a SEQUENCE, we find insns.
3349 Renumber just the patterns of these insns,
3350 just as we do for the top-level insns. */
3351 leaf_renumber_regs_insn (PATTERN (in_rtx
));
3355 format_ptr
= GET_RTX_FORMAT (GET_CODE (in_rtx
));
3357 for (i
= 0; i
< GET_RTX_LENGTH (GET_CODE (in_rtx
)); i
++)
3358 switch (*format_ptr
++)
3361 leaf_renumber_regs_insn (XEXP (in_rtx
, i
));
3365 if (NULL
!= XVEC (in_rtx
, i
))
3367 for (j
= 0; j
< XVECLEN (in_rtx
, i
); j
++)
3368 leaf_renumber_regs_insn (XVECEXP (in_rtx
, i
, j
));