diff options
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r-- | gcc/reload1.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index cc14673be92..5a1839944dc 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -1136,36 +1136,25 @@ reload (rtx first, int global) for (use = DF_REG_USE_CHAIN (i); use; use = next) { - rtx *loc = DF_REF_LOC (use); - rtx x = *loc; - insn = DF_REF_INSN (use); + + /* Make sure the next ref is for a different instruction, + so that we're not affected by the rescan. */ next = DF_REF_NEXT_REG (use); + while (next && DF_REF_INSN (next) == insn) + next = DF_REF_NEXT_REG (next); if (DEBUG_INSN_P (insn)) { - gcc_assert (x == reg - || (GET_CODE (x) == SUBREG - && SUBREG_REG (x) == reg)); - if (!equiv) { INSN_VAR_LOCATION_LOC (insn) = gen_rtx_UNKNOWN_VAR_LOC (); df_insn_rescan_debug_internal (insn); } else - { - if (x == reg) - *loc = copy_rtx (equiv); - else if (GET_CODE (x) == SUBREG - && SUBREG_REG (x) == reg) - *loc = simplify_gen_subreg (GET_MODE (x), equiv, - GET_MODE (reg), - SUBREG_BYTE (x)); - else - gcc_unreachable (); - *loc = wrap_constant (GET_MODE (x), *loc); - } + INSN_VAR_LOCATION_LOC (insn) + = simplify_replace_rtx (INSN_VAR_LOCATION_LOC (insn), + reg, equiv); } } } |