1 /* Analyze RTL for C-Compiler
2 Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
27 #include "hard-reg-set.h"
28 #include "insn-config.h"
33 /* Forward declarations */
34 static int global_reg_mentioned_p_1 PARAMS ((rtx *, void *));
35 static void set_of_1 PARAMS ((rtx, rtx, void *));
36 static void insn_dependent_p_1 PARAMS ((rtx, rtx, void *));
37 static int computed_jump_p_1 PARAMS ((rtx));
38 static void parms_set PARAMS ((rtx, rtx, void *));
40 /* Bit flags that specify the machine subtype we are compiling for.
41 Bits are tested using macros TARGET_... defined in the tm.h file
42 and set by `-m...' switches. Must be defined in rtlanal.c. */
46 /* Return 1 if the value of X is unstable
47 (would be different at a different point in the program).
48 The frame pointer, arg pointer, etc. are considered stable
49 (within one function) and so is anything marked `unchanging'. */
55 RTX_CODE code = GET_CODE (x);
62 return ! RTX_UNCHANGING_P (x) || rtx_unstable_p (XEXP (x, 0));
77 /* As in rtx_varies_p, we have to use the actual rtx, not reg number. */
78 if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
79 /* The arg pointer varies if it is not a fixed register. */
80 || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM])
81 || RTX_UNCHANGING_P (x))
83 #ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
84 /* ??? When call-clobbered, the value is stable modulo the restore
85 that must happen after a call. This currently screws up local-alloc
86 into believing that the restore is not needed. */
87 if (x == pic_offset_table_rtx)
93 if (MEM_VOLATILE_P (x))
102 fmt = GET_RTX_FORMAT (code);
103 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
106 if (rtx_unstable_p (XEXP (x, i)))
109 else if (fmt[i] == 'E')
112 for (j = 0; j < XVECLEN (x, i); j++)
113 if (rtx_unstable_p (XVECEXP (x, i, j)))
120 /* Return 1 if X has a value that can vary even between two
121 executions of the program. 0 means X can be compared reliably
122 against certain constants or near-constants.
123 FOR_ALIAS is nonzero if we are called from alias analysis; if it is
124 zero, we are slightly more conservative.
125 The frame pointer and the arg pointer are considered constant. */
128 rtx_varies_p (x, for_alias)
132 RTX_CODE code = GET_CODE (x);
139 return ! RTX_UNCHANGING_P (x) || rtx_varies_p (XEXP (x, 0), for_alias);
153 /* Note that we have to test for the actual rtx used for the frame
154 and arg pointers and not just the register number in case we have
155 eliminated the frame and/or arg pointer and are using it
157 if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
158 /* The arg pointer varies if it is not a fixed register. */
159 || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]))
161 if (x == pic_offset_table_rtx
162 #ifdef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
163 /* ??? When call-clobbered, the value is stable modulo the restore
164 that must happen after a call. This currently screws up
165 local-alloc into believing that the restore is not needed, so we
166 must return 0 only if we are called from alias analysis. */
174 /* The operand 0 of a LO_SUM is considered constant
175 (in fact it is related specifically to operand 1)
176 during alias analysis. */
177 return (! for_alias && rtx_varies_p (XEXP (x, 0), for_alias))
178 || rtx_varies_p (XEXP (x, 1), for_alias);
181 if (MEM_VOLATILE_P (x))
190 fmt = GET_RTX_FORMAT (code);
191 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
194 if (rtx_varies_p (XEXP (x, i), for_alias))
197 else if (fmt[i] == 'E')
200 for (j = 0; j < XVECLEN (x, i); j++)
201 if (rtx_varies_p (XVECEXP (x, i, j), for_alias))
208 /* Return 0 if the use of X as an address in a MEM can cause a trap. */
211 rtx_addr_can_trap_p (x)
214 enum rtx_code code = GET_CODE (x);
219 return SYMBOL_REF_WEAK (x);
225 /* As in rtx_varies_p, we have to use the actual rtx, not reg number. */
226 if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
227 || x == stack_pointer_rtx
228 /* The arg pointer varies if it is not a fixed register. */
229 || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]))
231 /* All of the virtual frame registers are stack references. */
232 if (REGNO (x) >= FIRST_VIRTUAL_REGISTER
233 && REGNO (x) <= LAST_VIRTUAL_REGISTER)
238 return rtx_addr_can_trap_p (XEXP (x, 0));
241 /* An address is assumed not to trap if it is an address that can't
242 trap plus a constant integer or it is the pic register plus a
244 return ! ((! rtx_addr_can_trap_p (XEXP (x, 0))
245 && GET_CODE (XEXP (x, 1)) == CONST_INT)
246 || (XEXP (x, 0) == pic_offset_table_rtx
247 && CONSTANT_P (XEXP (x, 1))));
251 return rtx_addr_can_trap_p (XEXP (x, 1));
258 return rtx_addr_can_trap_p (XEXP (x, 0));
264 /* If it isn't one of the case above, it can cause a trap. */
268 /* Return 1 if X refers to a memory location whose address
269 cannot be compared reliably with constant addresses,
270 or if X refers to a BLKmode memory object.
271 FOR_ALIAS is nonzero if we are called from alias analysis; if it is
272 zero, we are slightly more conservative. */
275 rtx_addr_varies_p (x, for_alias)
288 return GET_MODE (x) == BLKmode || rtx_varies_p (XEXP (x, 0), for_alias);
290 fmt = GET_RTX_FORMAT (code);
291 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
294 if (rtx_addr_varies_p (XEXP (x, i), for_alias))
297 else if (fmt[i] == 'E')
300 for (j = 0; j < XVECLEN (x, i); j++)
301 if (rtx_addr_varies_p (XVECEXP (x, i, j), for_alias))
307 /* Return the value of the integer term in X, if one is apparent;
309 Only obvious integer terms are detected.
310 This is used in cse.c with the `related_value' field. */
316 if (GET_CODE (x) == CONST)
319 if (GET_CODE (x) == MINUS
320 && GET_CODE (XEXP (x, 1)) == CONST_INT)
321 return - INTVAL (XEXP (x, 1));
322 if (GET_CODE (x) == PLUS
323 && GET_CODE (XEXP (x, 1)) == CONST_INT)
324 return INTVAL (XEXP (x, 1));
328 /* If X is a constant, return the value sans apparent integer term;
330 Only obvious integer terms are detected. */
333 get_related_value (x)
336 if (GET_CODE (x) != CONST)
339 if (GET_CODE (x) == PLUS
340 && GET_CODE (XEXP (x, 1)) == CONST_INT)
342 else if (GET_CODE (x) == MINUS
343 && GET_CODE (XEXP (x, 1)) == CONST_INT)
348 /* Given a tablejump insn INSN, return the RTL expression for the offset
349 into the jump table. If the offset cannot be determined, then return
352 If EARLIEST is non-zero, it is a pointer to a place where the earliest
353 insn used in locating the offset was found. */
356 get_jump_table_offset (insn, earliest)
370 if (GET_CODE (insn) != JUMP_INSN
371 || ! (label = JUMP_LABEL (insn))
372 || ! (table = NEXT_INSN (label))
373 || GET_CODE (table) != JUMP_INSN
374 || (GET_CODE (PATTERN (table)) != ADDR_VEC
375 && GET_CODE (PATTERN (table)) != ADDR_DIFF_VEC)
376 || ! (set = single_set (insn)))
381 /* Some targets (eg, ARM) emit a tablejump that also
382 contains the out-of-range target. */
383 if (GET_CODE (x) == IF_THEN_ELSE
384 && GET_CODE (XEXP (x, 2)) == LABEL_REF)
387 /* Search backwards and locate the expression stored in X. */
388 for (old_x = NULL_RTX; GET_CODE (x) == REG && x != old_x;
389 old_x = x, x = find_last_value (x, &insn, NULL_RTX, 0))
392 /* If X is an expression using a relative address then strip
393 off the addition / subtraction of PC, PIC_OFFSET_TABLE_REGNUM,
394 or the jump table label. */
395 if (GET_CODE (PATTERN (table)) == ADDR_DIFF_VEC
396 && (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS))
398 for (i = 0; i < 2; i++)
403 if (y == pc_rtx || y == pic_offset_table_rtx)
406 for (old_y = NULL_RTX; GET_CODE (y) == REG && y != old_y;
407 old_y = y, y = find_last_value (y, &old_insn, NULL_RTX, 0))
410 if ((GET_CODE (y) == LABEL_REF && XEXP (y, 0) == label))
419 for (old_x = NULL_RTX; GET_CODE (x) == REG && x != old_x;
420 old_x = x, x = find_last_value (x, &insn, NULL_RTX, 0))
424 /* Strip off any sign or zero extension. */
425 if (GET_CODE (x) == SIGN_EXTEND || GET_CODE (x) == ZERO_EXTEND)
429 for (old_x = NULL_RTX; GET_CODE (x) == REG && x != old_x;
430 old_x = x, x = find_last_value (x, &insn, NULL_RTX, 0))
434 /* If X isn't a MEM then this isn't a tablejump we understand. */
435 if (GET_CODE (x) != MEM)
438 /* Strip off the MEM. */
441 for (old_x = NULL_RTX; GET_CODE (x) == REG && x != old_x;
442 old_x = x, x = find_last_value (x, &insn, NULL_RTX, 0))
445 /* If X isn't a PLUS than this isn't a tablejump we understand. */
446 if (GET_CODE (x) != PLUS)
449 /* At this point we should have an expression representing the jump table
450 plus an offset. Examine each operand in order to determine which one
451 represents the jump table. Knowing that tells us that the other operand
452 must represent the offset. */
453 for (i = 0; i < 2; i++)
458 for (old_y = NULL_RTX; GET_CODE (y) == REG && y != old_y;
459 old_y = y, y = find_last_value (y, &old_insn, NULL_RTX, 0))
462 if ((GET_CODE (y) == CONST || GET_CODE (y) == LABEL_REF)
463 && reg_mentioned_p (label, y))
472 /* Strip off the addition / subtraction of PIC_OFFSET_TABLE_REGNUM. */
473 if (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS)
474 for (i = 0; i < 2; i++)
475 if (XEXP (x, i) == pic_offset_table_rtx)
484 /* Return the RTL expression representing the offset. */
488 /* A subroutine of global_reg_mentioned_p, returns 1 if *LOC mentions
489 a global register. */
492 global_reg_mentioned_p_1 (loc, data)
494 void *data ATTRIBUTE_UNUSED;
502 switch (GET_CODE (x))
505 if (GET_CODE (SUBREG_REG (x)) == REG)
507 if (REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER
508 && global_regs[subreg_regno (x)])
516 if (regno < FIRST_PSEUDO_REGISTER && global_regs[regno])
530 /* A non-constant call might use a global register. */
540 /* Returns non-zero if X mentions a global register. */
543 global_reg_mentioned_p (x)
549 if (GET_CODE (x) == CALL_INSN)
551 if (! CONST_OR_PURE_CALL_P (x))
553 x = CALL_INSN_FUNCTION_USAGE (x);
561 return for_each_rtx (&x, global_reg_mentioned_p_1, NULL);
564 /* Return the number of places FIND appears within X. If COUNT_DEST is
565 zero, we do not count occurrences inside the destination of a SET. */
568 count_occurrences (x, find, count_dest)
574 const char *format_ptr;
595 if (GET_CODE (find) == MEM && rtx_equal_p (x, find))
600 if (SET_DEST (x) == find && ! count_dest)
601 return count_occurrences (SET_SRC (x), find, count_dest);
608 format_ptr = GET_RTX_FORMAT (code);
611 for (i = 0; i < GET_RTX_LENGTH (code); i++)
613 switch (*format_ptr++)
616 count += count_occurrences (XEXP (x, i), find, count_dest);
620 for (j = 0; j < XVECLEN (x, i); j++)
621 count += count_occurrences (XVECEXP (x, i, j), find, count_dest);
628 /* Nonzero if register REG appears somewhere within IN.
629 Also works if REG is not a register; in this case it checks
630 for a subexpression of IN that is Lisp "equal" to REG. */
633 reg_mentioned_p (reg, in)
646 if (GET_CODE (in) == LABEL_REF)
647 return reg == XEXP (in, 0);
649 code = GET_CODE (in);
653 /* Compare registers by number. */
655 return GET_CODE (reg) == REG && REGNO (in) == REGNO (reg);
657 /* These codes have no constituent expressions
665 return GET_CODE (reg) == CONST_INT && INTVAL (in) == INTVAL (reg);
669 /* These are kept unique for a given value. */
676 if (GET_CODE (reg) == code && rtx_equal_p (reg, in))
679 fmt = GET_RTX_FORMAT (code);
681 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
686 for (j = XVECLEN (in, i) - 1; j >= 0; j--)
687 if (reg_mentioned_p (reg, XVECEXP (in, i, j)))
690 else if (fmt[i] == 'e'
691 && reg_mentioned_p (reg, XEXP (in, i)))
697 /* Return 1 if in between BEG and END, exclusive of BEG and END, there is
698 no CODE_LABEL insn. */
701 no_labels_between_p (beg, end)
707 for (p = NEXT_INSN (beg); p != end; p = NEXT_INSN (p))
708 if (GET_CODE (p) == CODE_LABEL)
713 /* Return 1 if in between BEG and END, exclusive of BEG and END, there is
714 no JUMP_INSN insn. */
717 no_jumps_between_p (beg, end)
721 for (p = NEXT_INSN (beg); p != end; p = NEXT_INSN (p))
722 if (GET_CODE (p) == JUMP_INSN)
727 /* Nonzero if register REG is used in an insn between
728 FROM_INSN and TO_INSN (exclusive of those two). */
731 reg_used_between_p (reg, from_insn, to_insn)
732 rtx reg, from_insn, to_insn;
736 if (from_insn == to_insn)
739 for (insn = NEXT_INSN (from_insn); insn != to_insn; insn = NEXT_INSN (insn))
741 && (reg_overlap_mentioned_p (reg, PATTERN (insn))
742 || (GET_CODE (insn) == CALL_INSN
743 && (find_reg_fusage (insn, USE, reg)
744 || find_reg_fusage (insn, CLOBBER, reg)))))
749 /* Nonzero if the old value of X, a register, is referenced in BODY. If X
750 is entirely replaced by a new value and the only use is as a SET_DEST,
751 we do not consider it a reference. */
754 reg_referenced_p (x, body)
760 switch (GET_CODE (body))
763 if (reg_overlap_mentioned_p (x, SET_SRC (body)))
766 /* If the destination is anything other than CC0, PC, a REG or a SUBREG
767 of a REG that occupies all of the REG, the insn references X if
768 it is mentioned in the destination. */
769 if (GET_CODE (SET_DEST (body)) != CC0
770 && GET_CODE (SET_DEST (body)) != PC
771 && GET_CODE (SET_DEST (body)) != REG
772 && ! (GET_CODE (SET_DEST (body)) == SUBREG
773 && GET_CODE (SUBREG_REG (SET_DEST (body))) == REG
774 && (((GET_MODE_SIZE (GET_MODE (SUBREG_REG (SET_DEST (body))))
775 + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
776 == ((GET_MODE_SIZE (GET_MODE (SET_DEST (body)))
777 + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)))
778 && reg_overlap_mentioned_p (x, SET_DEST (body)))
783 for (i = ASM_OPERANDS_INPUT_LENGTH (body) - 1; i >= 0; i--)
784 if (reg_overlap_mentioned_p (x, ASM_OPERANDS_INPUT (body, i)))
791 return reg_overlap_mentioned_p (x, body);
794 return reg_overlap_mentioned_p (x, TRAP_CONDITION (body));
797 return reg_overlap_mentioned_p (x, XEXP (body, 0));
800 case UNSPEC_VOLATILE:
801 for (i = XVECLEN (body, 0) - 1; i >= 0; i--)
802 if (reg_overlap_mentioned_p (x, XVECEXP (body, 0, i)))
807 for (i = XVECLEN (body, 0) - 1; i >= 0; i--)
808 if (reg_referenced_p (x, XVECEXP (body, 0, i)))
813 if (GET_CODE (XEXP (body, 0)) == MEM)
814 if (reg_overlap_mentioned_p (x, XEXP (XEXP (body, 0), 0)))
819 if (reg_overlap_mentioned_p (x, COND_EXEC_TEST (body)))
821 return reg_referenced_p (x, COND_EXEC_CODE (body));
828 /* Nonzero if register REG is referenced in an insn between
829 FROM_INSN and TO_INSN (exclusive of those two). Sets of REG do
833 reg_referenced_between_p (reg, from_insn, to_insn)
834 rtx reg, from_insn, to_insn;
838 if (from_insn == to_insn)
841 for (insn = NEXT_INSN (from_insn); insn != to_insn; insn = NEXT_INSN (insn))
843 && (reg_referenced_p (reg, PATTERN (insn))
844 || (GET_CODE (insn) == CALL_INSN
845 && find_reg_fusage (insn, USE, reg))))
850 /* Nonzero if register REG is set or clobbered in an insn between
851 FROM_INSN and TO_INSN (exclusive of those two). */
854 reg_set_between_p (reg, from_insn, to_insn)
855 rtx reg, from_insn, to_insn;
859 if (from_insn == to_insn)
862 for (insn = NEXT_INSN (from_insn); insn != to_insn; insn = NEXT_INSN (insn))
863 if (INSN_P (insn) && reg_set_p (reg, insn))
868 /* Internals of reg_set_between_p. */
870 reg_set_p (reg, insn)
875 /* We can be passed an insn or part of one. If we are passed an insn,
876 check if a side-effect of the insn clobbers REG. */
879 if (FIND_REG_INC_NOTE (insn, reg)
880 || (GET_CODE (insn) == CALL_INSN
881 /* We'd like to test call_used_regs here, but rtlanal.c can't
882 reference that variable due to its use in genattrtab. So
883 we'll just be more conservative.
885 ??? Unless we could ensure that the CALL_INSN_FUNCTION_USAGE
886 information holds all clobbered registers. */
887 && ((GET_CODE (reg) == REG
888 && REGNO (reg) < FIRST_PSEUDO_REGISTER)
889 || GET_CODE (reg) == MEM
890 || find_reg_fusage (insn, CLOBBER, reg))))
893 body = PATTERN (insn);
896 return set_of (reg, insn) != NULL_RTX;
899 /* Similar to reg_set_between_p, but check all registers in X. Return 0
900 only if none of them are modified between START and END. Do not
901 consider non-registers one way or the other. */
904 regs_set_between_p (x, start, end)
908 enum rtx_code code = GET_CODE (x);
925 return reg_set_between_p (x, start, end);
931 fmt = GET_RTX_FORMAT (code);
932 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
934 if (fmt[i] == 'e' && regs_set_between_p (XEXP (x, i), start, end))
937 else if (fmt[i] == 'E')
938 for (j = XVECLEN (x, i) - 1; j >= 0; j--)
939 if (regs_set_between_p (XVECEXP (x, i, j), start, end))
946 /* Similar to reg_set_between_p, but check all registers in X. Return 0
947 only if none of them are modified between START and END. Return 1 if
948 X contains a MEM; this routine does not perform any memory aliasing. */
951 modified_between_p (x, start, end)
955 enum rtx_code code = GET_CODE (x);
974 /* If the memory is not constant, assume it is modified. If it is
975 constant, we still have to check the address. */
976 if (! RTX_UNCHANGING_P (x))
981 return reg_set_between_p (x, start, end);
987 fmt = GET_RTX_FORMAT (code);
988 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
990 if (fmt[i] == 'e' && modified_between_p (XEXP (x, i), start, end))
993 else if (fmt[i] == 'E')
994 for (j = XVECLEN (x, i) - 1; j >= 0; j--)
995 if (modified_between_p (XVECEXP (x, i, j), start, end))
1002 /* Similar to reg_set_p, but check all registers in X. Return 0 only if none
1003 of them are modified in INSN. Return 1 if X contains a MEM; this routine
1004 does not perform any memory aliasing. */
1007 modified_in_p (x, insn)
1011 enum rtx_code code = GET_CODE (x);
1030 /* If the memory is not constant, assume it is modified. If it is
1031 constant, we still have to check the address. */
1032 if (! RTX_UNCHANGING_P (x))
1037 return reg_set_p (x, insn);
1043 fmt = GET_RTX_FORMAT (code);
1044 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
1046 if (fmt[i] == 'e' && modified_in_p (XEXP (x, i), insn))
1049 else if (fmt[i] == 'E')
1050 for (j = XVECLEN (x, i) - 1; j >= 0; j--)
1051 if (modified_in_p (XVECEXP (x, i, j), insn))
1058 /* Return true if anything in insn X is (anti,output,true) dependent on
1059 anything in insn Y. */
1062 insn_dependent_p (x, y)
1067 if (! INSN_P (x) || ! INSN_P (y))
1071 note_stores (PATTERN (x), insn_dependent_p_1, &tmp);
1072 if (tmp == NULL_RTX)
1076 note_stores (PATTERN (y), insn_dependent_p_1, &tmp);
1077 if (tmp == NULL_RTX)
1083 /* A helper routine for insn_dependent_p called through note_stores. */
1086 insn_dependent_p_1 (x, pat, data)
1088 rtx pat ATTRIBUTE_UNUSED;
1091 rtx * pinsn = (rtx *) data;
1093 if (*pinsn && reg_mentioned_p (x, *pinsn))
1097 /* Helper function for set_of. */
1105 set_of_1 (x, pat, data1)
1110 struct set_of_data *data = (struct set_of_data *) (data1);
1111 if (rtx_equal_p (x, data->pat)
1112 || (GET_CODE (x) != MEM && reg_overlap_mentioned_p (data->pat, x)))
1116 /* Give an INSN, return a SET or CLOBBER expression that does modify PAT
1117 (either directly or via STRICT_LOW_PART and similar modifiers). */
1122 struct set_of_data data;
1123 data.found = NULL_RTX;
1125 note_stores (INSN_P (insn) ? PATTERN (insn) : insn, set_of_1, &data);
1129 /* Given an INSN, return a SET expression if this insn has only a single SET.
1130 It may also have CLOBBERs, USEs, or SET whose output
1131 will not be used, which we ignore. */
1134 single_set_2 (insn, pat)
1138 int set_verified = 1;
1141 if (GET_CODE (pat) == PARALLEL)
1143 for (i = 0; i < XVECLEN (pat, 0); i++)
1145 rtx sub = XVECEXP (pat, 0, i);
1146 switch (GET_CODE (sub))
1153 /* We can consider insns having multiple sets, where all
1154 but one are dead as single set insns. In common case
1155 only single set is present in the pattern so we want
1156 to avoid checking for REG_UNUSED notes unless necessary.
1158 When we reach set first time, we just expect this is
1159 the single set we are looking for and only when more
1160 sets are found in the insn, we check them. */
1163 if (find_reg_note (insn, REG_UNUSED, SET_DEST (set))
1164 && !side_effects_p (set))
1170 set = sub, set_verified = 0;
1171 else if (!find_reg_note (insn, REG_UNUSED, SET_DEST (sub))
1172 || side_effects_p (sub))
1184 /* Given an INSN, return nonzero if it has more than one SET, else return
1188 multiple_sets (insn)
1194 /* INSN must be an insn. */
1195 if (! INSN_P (insn))
1198 /* Only a PARALLEL can have multiple SETs. */
1199 if (GET_CODE (PATTERN (insn)) == PARALLEL)
1201 for (i = 0, found = 0; i < XVECLEN (PATTERN (insn), 0); i++)
1202 if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == SET)
1204 /* If we have already found a SET, then return now. */
1212 /* Either zero or one SET. */
1216 /* Return nonzero if the destination of SET equals the source
1217 and there are no side effects. */
1223 rtx src = SET_SRC (set);
1224 rtx dst = SET_DEST (set);
1226 if (side_effects_p (src) || side_effects_p (dst))
1229 if (GET_CODE (dst) == MEM && GET_CODE (src) == MEM)
1230 return rtx_equal_p (dst, src);
1232 if (dst == pc_rtx && src == pc_rtx)
1235 if (GET_CODE (dst) == SIGN_EXTRACT
1236 || GET_CODE (dst) == ZERO_EXTRACT)
1237 return rtx_equal_p (XEXP (dst, 0), src)
1238 && ! BYTES_BIG_ENDIAN && XEXP (dst, 2) == const0_rtx;
1240 if (GET_CODE (dst) == STRICT_LOW_PART)
1241 dst = XEXP (dst, 0);
1243 if (GET_CODE (src) == SUBREG && GET_CODE (dst) == SUBREG)
1245 if (SUBREG_BYTE (src) != SUBREG_BYTE (dst))
1247 src = SUBREG_REG (src);
1248 dst = SUBREG_REG (dst);
1251 return (GET_CODE (src) == REG && GET_CODE (dst) == REG
1252 && REGNO (src) == REGNO (dst));
1255 /* Return nonzero if an insn consists only of SETs, each of which only sets a
1262 rtx pat = PATTERN (insn);
1264 if (INSN_CODE (insn) == NOOP_MOVE_INSN_CODE)
1267 /* Insns carrying these notes are useful later on. */
1268 if (find_reg_note (insn, REG_EQUAL, NULL_RTX))
1271 /* For now treat an insn with a REG_RETVAL note as a
1272 a special insn which should not be considered a no-op. */
1273 if (find_reg_note (insn, REG_RETVAL, NULL_RTX))
1276 if (GET_CODE (pat) == SET && set_noop_p (pat))
1279 if (GET_CODE (pat) == PARALLEL)
1282 /* If nothing but SETs of registers to themselves,
1283 this insn can also be deleted. */
1284 for (i = 0; i < XVECLEN (pat, 0); i++)
1286 rtx tem = XVECEXP (pat, 0, i);
1288 if (GET_CODE (tem) == USE
1289 || GET_CODE (tem) == CLOBBER)
1292 if (GET_CODE (tem) != SET || ! set_noop_p (tem))
1302 /* Return the last thing that X was assigned from before *PINSN. If VALID_TO
1303 is not NULL_RTX then verify that the object is not modified up to VALID_TO.
1304 If the object was modified, if we hit a partial assignment to X, or hit a
1305 CODE_LABEL first, return X. If we found an assignment, update *PINSN to
1306 point to it. ALLOW_HWREG is set to 1 if hardware registers are allowed to
1310 find_last_value (x, pinsn, valid_to, allow_hwreg)
1318 for (p = PREV_INSN (*pinsn); p && GET_CODE (p) != CODE_LABEL;
1322 rtx set = single_set (p);
1323 rtx note = find_reg_note (p, REG_EQUAL, NULL_RTX);
1325 if (set && rtx_equal_p (x, SET_DEST (set)))
1327 rtx src = SET_SRC (set);
1329 if (note && GET_CODE (XEXP (note, 0)) != EXPR_LIST)
1330 src = XEXP (note, 0);
1332 if ((valid_to == NULL_RTX
1333 || ! modified_between_p (src, PREV_INSN (p), valid_to))
1334 /* Reject hard registers because we don't usually want
1335 to use them; we'd rather use a pseudo. */
1336 && (! (GET_CODE (src) == REG
1337 && REGNO (src) < FIRST_PSEUDO_REGISTER) || allow_hwreg))
1344 /* If set in non-simple way, we don't have a value. */
1345 if (reg_set_p (x, p))
1352 /* Return nonzero if register in range [REGNO, ENDREGNO)
1353 appears either explicitly or implicitly in X
1354 other than being stored into.
1356 References contained within the substructure at LOC do not count.
1357 LOC may be zero, meaning don't ignore anything. */
1360 refers_to_regno_p (regno, endregno, x, loc)
1361 unsigned int regno, endregno;
1366 unsigned int x_regno;
1371 /* The contents of a REG_NONNEG note is always zero, so we must come here
1372 upon repeat in case the last REG_NOTE is a REG_NONNEG note. */
1376 code = GET_CODE (x);
1381 x_regno = REGNO (x);
1383 /* If we modifying the stack, frame, or argument pointer, it will
1384 clobber a virtual register. In fact, we could be more precise,
1385 but it isn't worth it. */
1386 if ((x_regno == STACK_POINTER_REGNUM
1387 #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
1388 || x_regno == ARG_POINTER_REGNUM
1390 || x_regno == FRAME_POINTER_REGNUM)
1391 && regno >= FIRST_VIRTUAL_REGISTER && regno <= LAST_VIRTUAL_REGISTER)
1394 return (endregno > x_regno
1395 && regno < x_regno + (x_regno < FIRST_PSEUDO_REGISTER
1396 ? HARD_REGNO_NREGS (x_regno, GET_MODE (x))
1400 /* If this is a SUBREG of a hard reg, we can see exactly which
1401 registers are being modified. Otherwise, handle normally. */
1402 if (GET_CODE (SUBREG_REG (x)) == REG
1403 && REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER)
1405 unsigned int inner_regno = subreg_regno (x);
1406 unsigned int inner_endregno
1407 = inner_regno + (inner_regno < FIRST_PSEUDO_REGISTER
1408 ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1);
1410 return endregno > inner_regno && regno < inner_endregno;
1416 if (&SET_DEST (x) != loc
1417 /* Note setting a SUBREG counts as referring to the REG it is in for
1418 a pseudo but not for hard registers since we can
1419 treat each word individually. */
1420 && ((GET_CODE (SET_DEST (x)) == SUBREG
1421 && loc != &SUBREG_REG (SET_DEST (x))
1422 && GET_CODE (SUBREG_REG (SET_DEST (x))) == REG
1423 && REGNO (SUBREG_REG (SET_DEST (x))) >= FIRST_PSEUDO_REGISTER
1424 && refers_to_regno_p (regno, endregno,
1425 SUBREG_REG (SET_DEST (x)), loc))
1426 || (GET_CODE (SET_DEST (x)) != REG
1427 && refers_to_regno_p (regno, endregno, SET_DEST (x), loc))))
1430 if (code == CLOBBER || loc == &SET_SRC (x))
1439 /* X does not match, so try its subexpressions. */
1441 fmt = GET_RTX_FORMAT (code);
1442 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
1444 if (fmt[i] == 'e' && loc != &XEXP (x, i))
1452 if (refers_to_regno_p (regno, endregno, XEXP (x, i), loc))
1455 else if (fmt[i] == 'E')
1458 for (j = XVECLEN (x, i) - 1; j >=0; j--)
1459 if (loc != &XVECEXP (x, i, j)
1460 && refers_to_regno_p (regno, endregno, XVECEXP (x, i, j), loc))
1467 /* Nonzero if modifying X will affect IN. If X is a register or a SUBREG,
1468 we check if any register number in X conflicts with the relevant register
1469 numbers. If X is a constant, return 0. If X is a MEM, return 1 iff IN
1470 contains a MEM (we don't bother checking for memory addresses that can't
1471 conflict because we expect this to be a rare case. */
1474 reg_overlap_mentioned_p (x, in)
1477 unsigned int regno, endregno;
1479 /* Overly conservative. */
1480 if (GET_CODE (x) == STRICT_LOW_PART)
1483 /* If either argument is a constant, then modifying X can not affect IN. */
1484 if (CONSTANT_P (x) || CONSTANT_P (in))
1487 switch (GET_CODE (x))
1490 regno = REGNO (SUBREG_REG (x));
1491 if (regno < FIRST_PSEUDO_REGISTER)
1492 regno = subreg_regno (x);
1498 endregno = regno + (regno < FIRST_PSEUDO_REGISTER
1499 ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1);
1500 return refers_to_regno_p (regno, endregno, in, (rtx*) 0);
1507 if (GET_CODE (in) == MEM)
1510 fmt = GET_RTX_FORMAT (GET_CODE (in));
1511 for (i = GET_RTX_LENGTH (GET_CODE (in)) - 1; i >= 0; i--)
1512 if (fmt[i] == 'e' && reg_overlap_mentioned_p (x, XEXP (in, i)))
1521 return reg_mentioned_p (x, in);
1527 /* If any register in here refers to it we return true. */
1528 for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
1529 if (XEXP (XVECEXP (x, 0, i), 0) != 0
1530 && reg_overlap_mentioned_p (XEXP (XVECEXP (x, 0, i), 0), in))
1542 /* Return the last value to which REG was set prior to INSN. If we can't
1543 find it easily, return 0.
1545 We only return a REG, SUBREG, or constant because it is too hard to
1546 check if a MEM remains unchanged. */
1549 reg_set_last (x, insn)
1553 rtx orig_insn = insn;
1555 /* Scan backwards until reg_set_last_1 changed one of the above flags.
1556 Stop when we reach a label or X is a hard reg and we reach a
1557 CALL_INSN (if reg_set_last_last_regno is a hard reg).
1559 If we find a set of X, ensure that its SET_SRC remains unchanged. */
1561 /* We compare with <= here, because reg_set_last_last_regno
1562 is actually the number of the first reg *not* in X. */
1564 insn && GET_CODE (insn) != CODE_LABEL
1565 && ! (GET_CODE (insn) == CALL_INSN
1566 && REGNO (x) <= FIRST_PSEUDO_REGISTER);
1567 insn = PREV_INSN (insn))
1570 rtx set = set_of (x, insn);
1571 /* OK, this function modify our register. See if we understand it. */
1575 if (GET_CODE (set) != SET || SET_DEST (set) != x)
1577 last_value = SET_SRC (x);
1578 if (CONSTANT_P (last_value)
1579 || ((GET_CODE (last_value) == REG
1580 || GET_CODE (last_value) == SUBREG)
1581 && ! reg_set_between_p (last_value,
1592 /* Call FUN on each register or MEM that is stored into or clobbered by X.
1593 (X would be the pattern of an insn).
1594 FUN receives two arguments:
1595 the REG, MEM, CC0 or PC being stored in or clobbered,
1596 the SET or CLOBBER rtx that does the store.
1598 If the item being stored in or clobbered is a SUBREG of a hard register,
1599 the SUBREG will be passed. */
1602 note_stores (x, fun, data)
1604 void (*fun) PARAMS ((rtx, rtx, void *));
1609 if (GET_CODE (x) == COND_EXEC)
1610 x = COND_EXEC_CODE (x);
1612 if (GET_CODE (x) == SET || GET_CODE (x) == CLOBBER)
1614 rtx dest = SET_DEST (x);
1616 while ((GET_CODE (dest) == SUBREG
1617 && (GET_CODE (SUBREG_REG (dest)) != REG
1618 || REGNO (SUBREG_REG (dest)) >= FIRST_PSEUDO_REGISTER))
1619 || GET_CODE (dest) == ZERO_EXTRACT
1620 || GET_CODE (dest) == SIGN_EXTRACT
1621 || GET_CODE (dest) == STRICT_LOW_PART)
1622 dest = XEXP (dest, 0);
1624 /* If we have a PARALLEL, SET_DEST is a list of EXPR_LIST expressions,
1625 each of whose first operand is a register. We can't know what
1626 precisely is being set in these cases, so make up a CLOBBER to pass
1628 if (GET_CODE (dest) == PARALLEL)
1630 for (i = XVECLEN (dest, 0) - 1; i >= 0; i--)
1631 if (XEXP (XVECEXP (dest, 0, i), 0) != 0)
1632 (*fun) (XEXP (XVECEXP (dest, 0, i), 0),
1633 gen_rtx_CLOBBER (VOIDmode,
1634 XEXP (XVECEXP (dest, 0, i), 0)),
1638 (*fun) (dest, x, data);
1641 else if (GET_CODE (x) == PARALLEL)
1642 for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
1643 note_stores (XVECEXP (x, 0, i), fun, data);
1646 /* Like notes_stores, but call FUN for each expression that is being
1647 referenced in PBODY, a pointer to the PATTERN of an insn. We only call
1648 FUN for each expression, not any interior subexpressions. FUN receives a
1649 pointer to the expression and the DATA passed to this function.
1651 Note that this is not quite the same test as that done in reg_referenced_p
1652 since that considers something as being referenced if it is being
1653 partially set, while we do not. */
1656 note_uses (pbody, fun, data)
1658 void (*fun) PARAMS ((rtx *, void *));
1664 switch (GET_CODE (body))
1667 (*fun) (&COND_EXEC_TEST (body), data);
1668 note_uses (&COND_EXEC_CODE (body), fun, data);
1672 for (i = XVECLEN (body, 0) - 1; i >= 0; i--)
1673 note_uses (&XVECEXP (body, 0, i), fun, data);
1677 (*fun) (&XEXP (body, 0), data);
1681 for (i = ASM_OPERANDS_INPUT_LENGTH (body) - 1; i >= 0; i--)
1682 (*fun) (&ASM_OPERANDS_INPUT (body, i), data);
1686 (*fun) (&TRAP_CONDITION (body), data);
1690 (*fun) (&XEXP (body, 0), data);
1694 case UNSPEC_VOLATILE:
1695 for (i = XVECLEN (body, 0) - 1; i >= 0; i--)
1696 (*fun) (&XVECEXP (body, 0, i), data);
1700 if (GET_CODE (XEXP (body, 0)) == MEM)
1701 (*fun) (&XEXP (XEXP (body, 0), 0), data);
1706 rtx dest = SET_DEST (body);
1708 /* For sets we replace everything in source plus registers in memory
1709 expression in store and operands of a ZERO_EXTRACT. */
1710 (*fun) (&SET_SRC (body), data);
1712 if (GET_CODE (dest) == ZERO_EXTRACT)
1714 (*fun) (&XEXP (dest, 1), data);
1715 (*fun) (&XEXP (dest, 2), data);
1718 while (GET_CODE (dest) == SUBREG || GET_CODE (dest) == STRICT_LOW_PART)
1719 dest = XEXP (dest, 0);
1721 if (GET_CODE (dest) == MEM)
1722 (*fun) (&XEXP (dest, 0), data);
1727 /* All the other possibilities never store. */
1728 (*fun) (pbody, data);
1733 /* Return nonzero if X's old contents don't survive after INSN.
1734 This will be true if X is (cc0) or if X is a register and
1735 X dies in INSN or because INSN entirely sets X.
1737 "Entirely set" means set directly and not through a SUBREG,
1738 ZERO_EXTRACT or SIGN_EXTRACT, so no trace of the old contents remains.
1739 Likewise, REG_INC does not count.
1741 REG may be a hard or pseudo reg. Renumbering is not taken into account,
1742 but for this use that makes no difference, since regs don't overlap
1743 during their lifetimes. Therefore, this function may be used
1744 at any time after deaths have been computed (in flow.c).
1746 If REG is a hard reg that occupies multiple machine registers, this
1747 function will only return 1 if each of those registers will be replaced
1751 dead_or_set_p (insn, x)
1755 unsigned int regno, last_regno;
1758 /* Can't use cc0_rtx below since this file is used by genattrtab.c. */
1759 if (GET_CODE (x) == CC0)
1762 if (GET_CODE (x) != REG)
1766 last_regno = (regno >= FIRST_PSEUDO_REGISTER ? regno
1767 : regno + HARD_REGNO_NREGS (regno, GET_MODE (x)) - 1);
1769 for (i = regno; i <= last_regno; i++)
1770 if (! dead_or_set_regno_p (insn, i))
1776 /* Utility function for dead_or_set_p to check an individual register. Also
1777 called from flow.c. */
1780 dead_or_set_regno_p (insn, test_regno)
1782 unsigned int test_regno;
1784 unsigned int regno, endregno;
1787 /* See if there is a death note for something that includes TEST_REGNO. */
1788 if (find_regno_note (insn, REG_DEAD, test_regno))
1791 if (GET_CODE (insn) == CALL_INSN
1792 && find_regno_fusage (insn, CLOBBER, test_regno))
1795 pattern = PATTERN (insn);
1797 if (GET_CODE (pattern) == COND_EXEC)
1798 pattern = COND_EXEC_CODE (pattern);
1800 if (GET_CODE (pattern) == SET)
1802 rtx dest = SET_DEST (PATTERN (insn));
1804 /* A value is totally replaced if it is the destination or the
1805 destination is a SUBREG of REGNO that does not change the number of
1807 if (GET_CODE (dest) == SUBREG
1808 && (((GET_MODE_SIZE (GET_MODE (dest))
1809 + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
1810 == ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest)))
1811 + UNITS_PER_WORD - 1) / UNITS_PER_WORD)))
1812 dest = SUBREG_REG (dest);
1814 if (GET_CODE (dest) != REG)
1817 regno = REGNO (dest);
1818 endregno = (regno >= FIRST_PSEUDO_REGISTER ? regno + 1
1819 : regno + HARD_REGNO_NREGS (regno, GET_MODE (dest)));
1821 return (test_regno >= regno && test_regno < endregno);
1823 else if (GET_CODE (pattern) == PARALLEL)
1827 for (i = XVECLEN (pattern, 0) - 1; i >= 0; i--)
1829 rtx body = XVECEXP (pattern, 0, i);
1831 if (GET_CODE (body) == COND_EXEC)
1832 body = COND_EXEC_CODE (body);
1834 if (GET_CODE (body) == SET || GET_CODE (body) == CLOBBER)
1836 rtx dest = SET_DEST (body);
1838 if (GET_CODE (dest) == SUBREG
1839 && (((GET_MODE_SIZE (GET_MODE (dest))
1840 + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
1841 == ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest)))
1842 + UNITS_PER_WORD - 1) / UNITS_PER_WORD)))
1843 dest = SUBREG_REG (dest);
1845 if (GET_CODE (dest) != REG)
1848 regno = REGNO (dest);
1849 endregno = (regno >= FIRST_PSEUDO_REGISTER ? regno + 1
1850 : regno + HARD_REGNO_NREGS (regno, GET_MODE (dest)));
1852 if (test_regno >= regno && test_regno < endregno)
1861 /* Return the reg-note of kind KIND in insn INSN, if there is one.
1862 If DATUM is nonzero, look for one whose datum is DATUM. */
1865 find_reg_note (insn, kind, datum)
1872 /* Ignore anything that is not an INSN, JUMP_INSN or CALL_INSN. */
1873 if (! INSN_P (insn))
1876 for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
1877 if (REG_NOTE_KIND (link) == kind
1878 && (datum == 0 || datum == XEXP (link, 0)))
1883 /* Return the reg-note of kind KIND in insn INSN which applies to register
1884 number REGNO, if any. Return 0 if there is no such reg-note. Note that
1885 the REGNO of this NOTE need not be REGNO if REGNO is a hard register;
1886 it might be the case that the note overlaps REGNO. */
1889 find_regno_note (insn, kind, regno)
1896 /* Ignore anything that is not an INSN, JUMP_INSN or CALL_INSN. */
1897 if (! INSN_P (insn))
1900 for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
1901 if (REG_NOTE_KIND (link) == kind
1902 /* Verify that it is a register, so that scratch and MEM won't cause a
1904 && GET_CODE (XEXP (link, 0)) == REG
1905 && REGNO (XEXP (link, 0)) <= regno
1906 && ((REGNO (XEXP (link, 0))
1907 + (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1
1908 : HARD_REGNO_NREGS (REGNO (XEXP (link, 0)),
1909 GET_MODE (XEXP (link, 0)))))
1915 /* Return a REG_EQUIV or REG_EQUAL note if insn has only a single set and
1919 find_reg_equal_equiv_note (insn)
1924 if (single_set (insn) == 0)
1926 else if ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != 0)
1929 return find_reg_note (insn, REG_EQUAL, NULL_RTX);
1932 /* Return true if DATUM, or any overlap of DATUM, of kind CODE is found
1933 in the CALL_INSN_FUNCTION_USAGE information of INSN. */
1936 find_reg_fusage (insn, code, datum)
1941 /* If it's not a CALL_INSN, it can't possibly have a
1942 CALL_INSN_FUNCTION_USAGE field, so don't bother checking. */
1943 if (GET_CODE (insn) != CALL_INSN)
1949 if (GET_CODE (datum) != REG)
1953 for (link = CALL_INSN_FUNCTION_USAGE (insn);
1955 link = XEXP (link, 1))
1956 if (GET_CODE (XEXP (link, 0)) == code
1957 && rtx_equal_p (datum, XEXP (XEXP (link, 0), 0)))
1962 unsigned int regno = REGNO (datum);
1964 /* CALL_INSN_FUNCTION_USAGE information cannot contain references
1965 to pseudo registers, so don't bother checking. */
1967 if (regno < FIRST_PSEUDO_REGISTER)
1969 unsigned int end_regno
1970 = regno + HARD_REGNO_NREGS (regno, GET_MODE (datum));
1973 for (i = regno; i < end_regno; i++)
1974 if (find_regno_fusage (insn, code, i))
1982 /* Return true if REGNO, or any overlap of REGNO, of kind CODE is found
1983 in the CALL_INSN_FUNCTION_USAGE information of INSN. */
1986 find_regno_fusage (insn, code, regno)
1993 /* CALL_INSN_FUNCTION_USAGE information cannot contain references
1994 to pseudo registers, so don't bother checking. */
1996 if (regno >= FIRST_PSEUDO_REGISTER
1997 || GET_CODE (insn) != CALL_INSN )
2000 for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))
2002 unsigned int regnote;
2005 if (GET_CODE (op = XEXP (link, 0)) == code
2006 && GET_CODE (reg = XEXP (op, 0)) == REG
2007 && (regnote = REGNO (reg)) <= regno
2008 && regnote + HARD_REGNO_NREGS (regnote, GET_MODE (reg)) > regno)
2015 /* Return true if INSN is a call to a pure function. */
2023 if (GET_CODE (insn) != CALL_INSN || ! CONST_OR_PURE_CALL_P (insn))
2026 /* Look for the note that differentiates const and pure functions. */
2027 for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))
2031 if (GET_CODE (u = XEXP (link, 0)) == USE
2032 && GET_CODE (m = XEXP (u, 0)) == MEM && GET_MODE (m) == BLKmode
2033 && GET_CODE (XEXP (m, 0)) == SCRATCH)
2040 /* Remove register note NOTE from the REG_NOTES of INSN. */
2043 remove_note (insn, note)
2049 if (note == NULL_RTX)
2052 if (REG_NOTES (insn) == note)
2054 REG_NOTES (insn) = XEXP (note, 1);
2058 for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
2059 if (XEXP (link, 1) == note)
2061 XEXP (link, 1) = XEXP (note, 1);
2068 /* Search LISTP (an EXPR_LIST) for an entry whose first operand is NODE and
2069 return 1 if it is found. A simple equality test is used to determine if
2073 in_expr_list_p (listp, node)
2079 for (x = listp; x; x = XEXP (x, 1))
2080 if (node == XEXP (x, 0))
2086 /* Search LISTP (an EXPR_LIST) for an entry whose first operand is NODE and
2087 remove that entry from the list if it is found.
2089 A simple equality test is used to determine if NODE matches. */
2092 remove_node_from_expr_list (node, listp)
2097 rtx prev = NULL_RTX;
2101 if (node == XEXP (temp, 0))
2103 /* Splice the node out of the list. */
2105 XEXP (prev, 1) = XEXP (temp, 1);
2107 *listp = XEXP (temp, 1);
2113 temp = XEXP (temp, 1);
2117 /* Nonzero if X contains any volatile instructions. These are instructions
2118 which may cause unpredictable machine state instructions, and thus no
2119 instructions should be moved or combined across them. This includes
2120 only volatile asms and UNSPEC_VOLATILE instructions. */
2128 code = GET_CODE (x);
2149 case UNSPEC_VOLATILE:
2150 /* case TRAP_IF: This isn't clear yet. */
2154 if (MEM_VOLATILE_P (x))
2161 /* Recursively scan the operands of this expression. */
2164 const char *fmt = GET_RTX_FORMAT (code);
2167 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
2171 if (volatile_insn_p (XEXP (x, i)))
2174 else if (fmt[i] == 'E')
2177 for (j = 0; j < XVECLEN (x, i); j++)
2178 if (volatile_insn_p (XVECEXP (x, i, j)))
2186 /* Nonzero if X contains any volatile memory references
2187 UNSPEC_VOLATILE operations or volatile ASM_OPERANDS expressions. */
2195 code = GET_CODE (x);
2215 case UNSPEC_VOLATILE:
2216 /* case TRAP_IF: This isn't clear yet. */
2221 if (MEM_VOLATILE_P (x))
2228 /* Recursively scan the operands of this expression. */
2231 const char *fmt = GET_RTX_FORMAT (code);
2234 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
2238 if (volatile_refs_p (XEXP (x, i)))
2241 else if (fmt[i] == 'E')
2244 for (j = 0; j < XVECLEN (x, i); j++)
2245 if (volatile_refs_p (XVECEXP (x, i, j)))
2253 /* Similar to above, except that it also rejects register pre- and post-
2262 code = GET_CODE (x);
2281 /* Reject CLOBBER with a non-VOID mode. These are made by combine.c
2282 when some combination can't be done. If we see one, don't think
2283 that we can simplify the expression. */
2284 return (GET_MODE (x) != VOIDmode);
2293 case UNSPEC_VOLATILE:
2294 /* case TRAP_IF: This isn't clear yet. */
2299 if (MEM_VOLATILE_P (x))
2306 /* Recursively scan the operands of this expression. */
2309 const char *fmt = GET_RTX_FORMAT (code);
2312 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
2316 if (side_effects_p (XEXP (x, i)))
2319 else if (fmt[i] == 'E')
2322 for (j = 0; j < XVECLEN (x, i); j++)
2323 if (side_effects_p (XVECEXP (x, i, j)))
2331 /* Return nonzero if evaluating rtx X might cause a trap. */
2343 code = GET_CODE (x);
2346 /* Handle these cases quickly. */
2360 case UNSPEC_VOLATILE:
2365 return MEM_VOLATILE_P (x);
2367 /* Memory ref can trap unless it's a static var or a stack slot. */
2369 return rtx_addr_can_trap_p (XEXP (x, 0));
2371 /* Division by a non-constant might trap. */
2376 if (! CONSTANT_P (XEXP (x, 1))
2377 || (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT
2378 && flag_trapping_math))
2380 /* This was const0_rtx, but by not using that,
2381 we can link this file into other programs. */
2382 if (GET_CODE (XEXP (x, 1)) == CONST_INT && INTVAL (XEXP (x, 1)) == 0)
2387 /* An EXPR_LIST is used to represent a function call. This
2388 certainly may trap. */
2396 /* Some floating point comparisons may trap. */
2397 if (!flag_trapping_math)
2399 /* ??? There is no machine independent way to check for tests that trap
2400 when COMPARE is used, though many targets do make this distinction.
2401 For instance, sparc uses CCFPE for compares which generate exceptions
2402 and CCFP for compares which do not generate exceptions. */
2403 if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
2405 /* But often the compare has some CC mode, so check operand
2407 if (GET_MODE_CLASS (GET_MODE (XEXP (x, 0))) == MODE_FLOAT
2408 || GET_MODE_CLASS (GET_MODE (XEXP (x, 1))) == MODE_FLOAT)
2414 /* These operations don't trap even with floating point. */
2418 /* Any floating arithmetic may trap. */
2419 if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT
2420 && flag_trapping_math)
2424 fmt = GET_RTX_FORMAT (code);
2425 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
2429 if (may_trap_p (XEXP (x, i)))
2432 else if (fmt[i] == 'E')
2435 for (j = 0; j < XVECLEN (x, i); j++)
2436 if (may_trap_p (XVECEXP (x, i, j)))
2443 /* Return nonzero if X contains a comparison that is not either EQ or NE,
2444 i.e., an inequality. */
2447 inequality_comparisons_p (x)
2452 enum rtx_code code = GET_CODE (x);
2482 len = GET_RTX_LENGTH (code);
2483 fmt = GET_RTX_FORMAT (code);
2485 for (i = 0; i < len; i++)
2489 if (inequality_comparisons_p (XEXP (x, i)))
2492 else if (fmt[i] == 'E')
2495 for (j = XVECLEN (x, i) - 1; j >= 0; j--)
2496 if (inequality_comparisons_p (XVECEXP (x, i, j)))
2504 /* Replace any occurrence of FROM in X with TO. The function does
2505 not enter into CONST_DOUBLE for the replace.
2507 Note that copying is not done so X must not be shared unless all copies
2508 are to be modified. */
2511 replace_rtx (x, from, to)
2517 /* The following prevents loops occurrence when we change MEM in
2518 CONST_DOUBLE onto the same CONST_DOUBLE. */
2519 if (x != 0 && GET_CODE (x) == CONST_DOUBLE)
2525 /* Allow this function to make replacements in EXPR_LISTs. */
2529 if (GET_CODE (x) == SUBREG)
2531 rtx new = replace_rtx (SUBREG_REG (x), from, to);
2533 if (GET_CODE (new) == CONST_INT)
2535 x = simplify_subreg (GET_MODE (x), new,
2536 GET_MODE (SUBREG_REG (x)),
2542 SUBREG_REG (x) = new;
2546 else if (GET_CODE (x) == ZERO_EXTEND)
2548 rtx new = replace_rtx (XEXP (x, 0), from, to);
2550 if (GET_CODE (new) == CONST_INT)
2552 x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x),
2553 new, GET_MODE (XEXP (x, 0)));
2563 fmt = GET_RTX_FORMAT (GET_CODE (x));
2564 for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
2567 XEXP (x, i) = replace_rtx (XEXP (x, i), from, to);
2568 else if (fmt[i] == 'E')
2569 for (j = XVECLEN (x, i) - 1; j >= 0; j--)
2570 XVECEXP (x, i, j) = replace_rtx (XVECEXP (x, i, j), from, to);
2576 /* Throughout the rtx X, replace many registers according to REG_MAP.
2577 Return the replacement for X (which may be X with altered contents).
2578 REG_MAP[R] is the replacement for register R, or 0 for don't replace.
2579 NREGS is the length of REG_MAP; regs >= NREGS are not mapped.
2581 We only support REG_MAP entries of REG or SUBREG. Also, hard registers
2582 should not be mapped to pseudos or vice versa since validate_change
2585 If REPLACE_DEST is 1, replacements are also done in destinations;
2586 otherwise, only sources are replaced. */
2589 replace_regs (x, reg_map, nregs, replace_dest)
2602 code = GET_CODE (x);
2617 /* Verify that the register has an entry before trying to access it. */
2618 if (REGNO (x) < nregs && reg_map[REGNO (x)] != 0)
2620 /* SUBREGs can't be shared. Always return a copy to ensure that if
2621 this replacement occurs more than once then each instance will
2622 get distinct rtx. */
2623 if (GET_CODE (reg_map[REGNO (x)]) == SUBREG)
2624 return copy_rtx (reg_map[REGNO (x)]);
2625 return reg_map[REGNO (x)];
2630 /* Prevent making nested SUBREGs. */
2631 if (GET_CODE (SUBREG_REG (x)) == REG && REGNO (SUBREG_REG (x)) < nregs
2632 && reg_map[REGNO (SUBREG_REG (x))] != 0
2633 && GET_CODE (reg_map[REGNO (SUBREG_REG (x))]) == SUBREG)
2635 rtx map_val = reg_map[REGNO (SUBREG_REG (x))];
2636 return simplify_gen_subreg (GET_MODE (x), map_val,
2637 GET_MODE (SUBREG_REG (x)),
2644 SET_DEST (x) = replace_regs (SET_DEST (x), reg_map, nregs, 0);
2646 else if (GET_CODE (SET_DEST (x)) == MEM
2647 || GET_CODE (SET_DEST (x)) == STRICT_LOW_PART)
2648 /* Even if we are not to replace destinations, replace register if it
2649 is CONTAINED in destination (destination is memory or
2650 STRICT_LOW_PART). */
2651 XEXP (SET_DEST (x), 0) = replace_regs (XEXP (SET_DEST (x), 0),
2653 else if (GET_CODE (SET_DEST (x)) == ZERO_EXTRACT)
2654 /* Similarly, for ZERO_EXTRACT we replace all operands. */
2657 SET_SRC (x) = replace_regs (SET_SRC (x), reg_map, nregs, 0);
2664 fmt = GET_RTX_FORMAT (code);
2665 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
2668 XEXP (x, i) = replace_regs (XEXP (x, i), reg_map, nregs, replace_dest);
2669 else if (fmt[i] == 'E')
2672 for (j = 0; j < XVECLEN (x, i); j++)
2673 XVECEXP (x, i, j) = replace_regs (XVECEXP (x, i, j), reg_map,
2674 nregs, replace_dest);
2680 /* A subroutine of computed_jump_p, return 1 if X contains a REG or MEM or
2681 constant that is not in the constant pool and not in the condition
2682 of an IF_THEN_ELSE. */
2685 computed_jump_p_1 (x)
2688 enum rtx_code code = GET_CODE (x);
2707 return ! (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
2708 && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)));
2711 return (computed_jump_p_1 (XEXP (x, 1))
2712 || computed_jump_p_1 (XEXP (x, 2)));
2718 fmt = GET_RTX_FORMAT (code);
2719 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
2722 && computed_jump_p_1 (XEXP (x, i)))
2725 else if (fmt[i] == 'E')
2726 for (j = 0; j < XVECLEN (x, i); j++)
2727 if (computed_jump_p_1 (XVECEXP (x, i, j)))
2734 /* Return nonzero if INSN is an indirect jump (aka computed jump).
2736 Tablejumps and casesi insns are not considered indirect jumps;
2737 we can recognize them by a (use (label_ref)). */
2740 computed_jump_p (insn)
2744 if (GET_CODE (insn) == JUMP_INSN)
2746 rtx pat = PATTERN (insn);
2748 if (find_reg_note (insn, REG_LABEL, NULL_RTX))
2750 else if (GET_CODE (pat) == PARALLEL)
2752 int len = XVECLEN (pat, 0);
2753 int has_use_labelref = 0;
2755 for (i = len - 1; i >= 0; i--)
2756 if (GET_CODE (XVECEXP (pat, 0, i)) == USE
2757 && (GET_CODE (XEXP (XVECEXP (pat, 0, i), 0))
2759 has_use_labelref = 1;
2761 if (! has_use_labelref)
2762 for (i = len - 1; i >= 0; i--)
2763 if (GET_CODE (XVECEXP (pat, 0, i)) == SET
2764 && SET_DEST (XVECEXP (pat, 0, i)) == pc_rtx
2765 && computed_jump_p_1 (SET_SRC (XVECEXP (pat, 0, i))))
2768 else if (GET_CODE (pat) == SET
2769 && SET_DEST (pat) == pc_rtx
2770 && computed_jump_p_1 (SET_SRC (pat)))
2776 /* Traverse X via depth-first search, calling F for each
2777 sub-expression (including X itself). F is also passed the DATA.
2778 If F returns -1, do not traverse sub-expressions, but continue
2779 traversing the rest of the tree. If F ever returns any other
2780 non-zero value, stop the traversal, and return the value returned
2781 by F. Otherwise, return 0. This function does not traverse inside
2782 tree structure that contains RTX_EXPRs, or into sub-expressions
2783 whose format code is `0' since it is not known whether or not those
2784 codes are actually RTL.
2786 This routine is very general, and could (should?) be used to
2787 implement many of the other routines in this file. */
2790 for_each_rtx (x, f, data)
2801 result = (*f) (x, data);
2803 /* Do not traverse sub-expressions. */
2805 else if (result != 0)
2806 /* Stop the traversal. */
2810 /* There are no sub-expressions. */
2813 length = GET_RTX_LENGTH (GET_CODE (*x));
2814 format = GET_RTX_FORMAT (GET_CODE (*x));
2816 for (i = 0; i < length; ++i)
2821 result = for_each_rtx (&XEXP (*x, i), f, data);
2828 if (XVEC (*x, i) != 0)
2831 for (j = 0; j < XVECLEN (*x, i); ++j)
2833 result = for_each_rtx (&XVECEXP (*x, i, j), f, data);
2841 /* Nothing to do. */
2850 /* Searches X for any reference to REGNO, returning the rtx of the
2851 reference found if any. Otherwise, returns NULL_RTX. */
2854 regno_use_in (regno, x)
2862 if (GET_CODE (x) == REG && REGNO (x) == regno)
2865 fmt = GET_RTX_FORMAT (GET_CODE (x));
2866 for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
2870 if ((tem = regno_use_in (regno, XEXP (x, i))))
2873 else if (fmt[i] == 'E')
2874 for (j = XVECLEN (x, i) - 1; j >= 0; j--)
2875 if ((tem = regno_use_in (regno , XVECEXP (x, i, j))))
2882 /* Return a value indicating whether OP, an operand of a commutative
2883 operation, is preferred as the first or second operand. The higher
2884 the value, the stronger the preference for being the first operand.
2885 We use negative values to indicate a preference for the first operand
2886 and positive values for the second operand. */
2889 commutative_operand_precedence (op)
2892 /* Constants always come the second operand. Prefer "nice" constants. */
2893 if (GET_CODE (op) == CONST_INT)
2895 if (GET_CODE (op) == CONST_DOUBLE)
2897 if (CONSTANT_P (op))
2900 /* SUBREGs of objects should come second. */
2901 if (GET_CODE (op) == SUBREG
2902 && GET_RTX_CLASS (GET_CODE (SUBREG_REG (op))) == 'o')
2905 /* If only one operand is a `neg', `not',
2906 `mult', `plus', or `minus' expression, it will be the first
2908 if (GET_CODE (op) == NEG || GET_CODE (op) == NOT
2909 || GET_CODE (op) == MULT || GET_CODE (op) == PLUS
2910 || GET_CODE (op) == MINUS)
2913 /* Complex expressions should be the first, so decrease priority
2915 if (GET_RTX_CLASS (GET_CODE (op)) == 'o')
2920 /* Return 1 iff it is necessary to swap operands of commutative operation
2921 in order to canonicalize expression. */
2924 swap_commutative_operands_p (x, y)
2927 return (commutative_operand_precedence (x)
2928 < commutative_operand_precedence (y));
2931 /* Return 1 if X is an autoincrement side effect and the register is
2932 not the stack pointer. */
2937 switch (GET_CODE (x))
2945 /* There are no REG_INC notes for SP. */
2946 if (XEXP (x, 0) != stack_pointer_rtx)
2954 /* Return 1 if the sequence of instructions beginning with FROM and up
2955 to and including TO is safe to move. If NEW_TO is non-NULL, and
2956 the sequence is not already safe to move, but can be easily
2957 extended to a sequence which is safe, then NEW_TO will point to the
2958 end of the extended sequence.
2960 For now, this function only checks that the region contains whole
2961 exception regions, but it could be extended to check additional
2962 conditions as well. */
2965 insns_safe_to_move_p (from, to, new_to)
2970 int eh_region_count = 0;
2974 /* By default, assume the end of the region will be what was
2981 if (GET_CODE (r) == NOTE)
2983 switch (NOTE_LINE_NUMBER (r))
2985 case NOTE_INSN_EH_REGION_BEG:
2989 case NOTE_INSN_EH_REGION_END:
2990 if (eh_region_count == 0)
2991 /* This sequence of instructions contains the end of
2992 an exception region, but not he beginning. Moving
2993 it will cause chaos. */
3004 /* If we've passed TO, and we see a non-note instruction, we
3005 can't extend the sequence to a movable sequence. */
3011 /* It's OK to move the sequence if there were matched sets of
3012 exception region notes. */
3013 return eh_region_count == 0;
3018 /* It's OK to move the sequence if there were matched sets of
3019 exception region notes. */
3020 if (past_to_p && eh_region_count == 0)
3026 /* Go to the next instruction. */
3033 /* Return non-zero if IN contains a piece of rtl that has the address LOC */
3035 loc_mentioned_in_p (loc, in)
3038 enum rtx_code code = GET_CODE (in);
3039 const char *fmt = GET_RTX_FORMAT (code);
3042 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
3044 if (loc == &in->fld[i].rtx)
3048 if (loc_mentioned_in_p (loc, XEXP (in, i)))
3051 else if (fmt[i] == 'E')
3052 for (j = XVECLEN (in, i) - 1; j >= 0; j--)
3053 if (loc_mentioned_in_p (loc, XVECEXP (in, i, j)))
3059 /* Given a subreg X, return the bit offset where the subreg begins
3060 (counting from the least significant bit of the reg). */
3066 enum machine_mode inner_mode = GET_MODE (SUBREG_REG (x));
3067 enum machine_mode mode = GET_MODE (x);
3068 unsigned int bitpos;
3072 /* A paradoxical subreg begins at bit position 0. */
3073 if (GET_MODE_BITSIZE (mode) > GET_MODE_BITSIZE (inner_mode))
3076 if (WORDS_BIG_ENDIAN != BYTES_BIG_ENDIAN)
3077 /* If the subreg crosses a word boundary ensure that
3078 it also begins and ends on a word boundary. */
3079 if ((SUBREG_BYTE (x) % UNITS_PER_WORD
3080 + GET_MODE_SIZE (mode)) > UNITS_PER_WORD
3081 && (SUBREG_BYTE (x) % UNITS_PER_WORD
3082 || GET_MODE_SIZE (mode) % UNITS_PER_WORD))
3085 if (WORDS_BIG_ENDIAN)
3086 word = (GET_MODE_SIZE (inner_mode)
3087 - (SUBREG_BYTE (x) + GET_MODE_SIZE (mode))) / UNITS_PER_WORD;
3089 word = SUBREG_BYTE (x) / UNITS_PER_WORD;
3090 bitpos = word * BITS_PER_WORD;
3092 if (BYTES_BIG_ENDIAN)
3093 byte = (GET_MODE_SIZE (inner_mode)
3094 - (SUBREG_BYTE (x) + GET_MODE_SIZE (mode))) % UNITS_PER_WORD;
3096 byte = SUBREG_BYTE (x) % UNITS_PER_WORD;
3097 bitpos += byte * BITS_PER_UNIT;
3102 /* This function returns the regno offset of a subreg expression.
3103 xregno - A regno of an inner hard subreg_reg (or what will become one).
3104 xmode - The mode of xregno.
3105 offset - The byte offset.
3106 ymode - The mode of a top level SUBREG (or what may become one).
3107 RETURN - The regno offset which would be used. */
3109 subreg_regno_offset (xregno, xmode, offset, ymode)
3110 unsigned int xregno;
3111 enum machine_mode xmode;
3112 unsigned int offset;
3113 enum machine_mode ymode;
3115 int nregs_xmode, nregs_ymode;
3116 int mode_multiple, nregs_multiple;
3119 if (xregno >= FIRST_PSEUDO_REGISTER)
3122 nregs_xmode = HARD_REGNO_NREGS (xregno, xmode);
3123 nregs_ymode = HARD_REGNO_NREGS (xregno, ymode);
3124 if (offset == 0 || nregs_xmode == nregs_ymode)
3127 /* size of ymode must not be greater than the size of xmode. */
3128 mode_multiple = GET_MODE_SIZE (xmode) / GET_MODE_SIZE (ymode);
3129 if (mode_multiple == 0)
3132 y_offset = offset / GET_MODE_SIZE (ymode);
3133 nregs_multiple = nregs_xmode / nregs_ymode;
3134 return (y_offset / (mode_multiple / nregs_multiple)) * nregs_ymode;
3137 /* Return the final regno that a subreg expression refers to. */
3143 rtx subreg = SUBREG_REG (x);
3144 int regno = REGNO (subreg);
3146 ret = regno + subreg_regno_offset (regno,
3153 struct parms_set_data
3159 /* Helper function for noticing stores to parameter registers. */
3161 parms_set (x, pat, data)
3162 rtx x, pat ATTRIBUTE_UNUSED;
3165 struct parms_set_data *d = data;
3166 if (REG_P (x) && REGNO (x) < FIRST_PSEUDO_REGISTER
3167 && TEST_HARD_REG_BIT (d->regs, REGNO (x)))
3169 CLEAR_HARD_REG_BIT (d->regs, REGNO (x));
3174 /* Look backward for first parameter to be loaded.
3175 Do not skip BOUNDARY. */
3177 find_first_parameter_load (call_insn, boundary)
3178 rtx call_insn, boundary;
3180 struct parms_set_data parm;
3183 /* Since different machines initialize their parameter registers
3184 in different orders, assume nothing. Collect the set of all
3185 parameter registers. */
3186 CLEAR_HARD_REG_SET (parm.regs);
3188 for (p = CALL_INSN_FUNCTION_USAGE (call_insn); p; p = XEXP (p, 1))
3189 if (GET_CODE (XEXP (p, 0)) == USE
3190 && GET_CODE (XEXP (XEXP (p, 0), 0)) == REG)
3192 if (REGNO (XEXP (XEXP (p, 0), 0)) >= FIRST_PSEUDO_REGISTER)
3195 /* We only care about registers which can hold function
3197 if (!FUNCTION_ARG_REGNO_P (REGNO (XEXP (XEXP (p, 0), 0))))
3200 SET_HARD_REG_BIT (parm.regs, REGNO (XEXP (XEXP (p, 0), 0)));
3205 /* Search backward for the first set of a register in this set. */
3206 while (parm.nregs && before != boundary)
3208 before = PREV_INSN (before);
3210 /* It is possible that some loads got CSEed from one call to
3211 another. Stop in that case. */
3212 if (GET_CODE (before) == CALL_INSN)
3215 /* Our caller needs either ensure that we will find all sets
3216 (in case code has not been optimized yet), or take care
3217 for possible labels in a way by setting boundary to preceding
3219 if (GET_CODE (before) == CODE_LABEL)
3221 if (before != boundary)
3226 if (INSN_P (before))
3227 note_stores (PATTERN (before), parms_set, &parm);
3232 /* Return true if we should avoid inserting code between INSN and preceeding
3233 call instruction. */
3236 keep_with_call_p (insn)
3241 if (INSN_P (insn) && (set = single_set (insn)) != NULL)
3243 if (GET_CODE (SET_DEST (set)) == REG
3244 && fixed_regs[REGNO (SET_DEST (set))]
3245 && general_operand (SET_SRC (set), VOIDmode))
3247 if (GET_CODE (SET_SRC (set)) == REG
3248 && FUNCTION_VALUE_REGNO_P (REGNO (SET_SRC (set)))
3249 && GET_CODE (SET_DEST (set)) == REG
3250 && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER)
3252 /* There may be a stack pop just after the call and before the store
3253 of the return register. Search for the actual store when deciding
3254 if we can break or not. */
3255 if (SET_DEST (set) == stack_pointer_rtx)
3257 rtx i2 = next_nonnote_insn (insn);
3258 if (i2 && keep_with_call_p (i2))