aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-iv.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/loop-iv.c')
-rw-r--r--gcc/loop-iv.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 83c3eef..6a59954 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -1384,24 +1384,23 @@ simple_rhs_p (rtx rhs)
static rtx
find_single_def_src (unsigned int regno)
{
- df_ref adef;
- rtx set, src;
+ rtx src = NULL_RTX;
- for (;;)
+ /* Don't look through unbounded number of single definition REG copies,
+ there might be loops for sources with uninitialized variables. */
+ for (int cnt = 0; cnt < 128; cnt++)
{
- rtx note;
- adef = DF_REG_DEF_CHAIN (regno);
+ df_ref adef = DF_REG_DEF_CHAIN (regno);
if (adef == NULL || DF_REF_NEXT_REG (adef) != NULL
|| DF_REF_IS_ARTIFICIAL (adef))
return NULL_RTX;
- set = single_set (DF_REF_INSN (adef));
+ rtx set = single_set (DF_REF_INSN (adef));
if (set == NULL || !REG_P (SET_DEST (set))
|| REGNO (SET_DEST (set)) != regno)
return NULL_RTX;
- note = find_reg_equal_equiv_note (DF_REF_INSN (adef));
-
+ rtx note = find_reg_equal_equiv_note (DF_REF_INSN (adef));
if (note && function_invariant_p (XEXP (note, 0)))
{
src = XEXP (note, 0);