From 3af4ba41cc98aa2c50c2a5c3ebcb7197b736994a Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 20 Oct 2009 19:50:38 +0000 Subject: rtl.h (simplify_replace_fn_rtx): Declare. gcc/ * rtl.h (simplify_replace_fn_rtx): Declare. (wrap_constant, unwrap_constant): Delete. * cfgexpand.c (unwrap_constant, wrap_constant): Delete. (expand_debug_expr): Don't call wrap_constant. * combine.c (rtx_subst_pair): Only define for AUTO_INC_DEC. (auto_adjust_pair): Fold into... (propagate_for_debug_subst): ...here. Only define for AUTO_INC_DEC. Just return a new value. (propagate_for_debug): Use simplify_replace_fn_rtx for AUTO_INC_DEC, otherwise use simplify_replace_rtx. * cselib.c (wrap_constant): Reinstate old definition. (cselib_expand_value_rtx_1): Don't wrap constants. * gcse.c (try_replace_reg): Don't use copy_rtx in the call to simplify_replace_rtx. (bypass_block): Fix formatting in calls to simplify_replace_rtx. * reload1.c (reload): Skip all uses for an insn before adjusting it. Use simplify_replace_rtx. * simplify-rtx.c (simplify_replace_fn_rtx): New function, adapted from... (simplify_replace_rtx): ...here. Turn into a wrapper for simplify_replace_fn_rtx. (simplify_unary_operation): Don't unwrap CONSTs. * var-tracking.c (check_wrap_constant): Delete. (vt_expand_loc_callback): Don't call it. (vt_expand_loc): Likewise. From-SVN: r153037 --- gcc/reload1.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'gcc/reload1.c') diff --git a/gcc/reload1.c b/gcc/reload1.c index 5581cd6..e9a0aba 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -1257,36 +1257,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); } } } -- cgit v1.1