diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-19 21:08:53 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-19 21:08:53 +0000 |
commit | 42a4b11f2cbed1a2af2157aff1b5ac2be08a78ad (patch) | |
tree | 22fda0e0d8ee766f1dd846c3c8c2bdb01ff9415a /gcc/combine.c | |
parent | ce494fcf6cecbd423d44d552e2094b923fac9a22 (diff) | |
download | gcc-42a4b11f2cbed1a2af2157aff1b5ac2be08a78ad.tar.gz |
gcc/
* combine.c (propagate_for_debug): Call make_compound_operation
on the source value.
(try_combine): When implementing a split chosen by find_split_point,
either copy i2src or set it to null. Assert that i2src is not null
before substituting into CALL_INSN_FUNCTION_USAGE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159600 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 303f180f790..8aa7e94a852 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2310,6 +2310,7 @@ static void propagate_for_debug (rtx insn, rtx last, rtx dest, rtx src, bool move) { rtx next, move_pos = move ? last : NULL_RTX, loc; + bool first_p; #ifdef AUTO_INC_DEC struct rtx_subst_pair p; @@ -2318,6 +2319,7 @@ propagate_for_debug (rtx insn, rtx last, rtx dest, rtx src, bool move) p.after = move; #endif + first_p = true; next = NEXT_INSN (insn); while (next != last) { @@ -2325,6 +2327,11 @@ propagate_for_debug (rtx insn, rtx last, rtx dest, rtx src, bool move) next = NEXT_INSN (insn); if (DEBUG_INSN_P (insn)) { + if (first_p) + { + src = make_compound_operation (src, SET); + first_p = false; + } #ifdef AUTO_INC_DEC loc = simplify_replace_fn_rtx (INSN_VAR_LOCATION_LOC (insn), dest, propagate_for_debug_subst, &p); @@ -3294,6 +3301,14 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) i2scratch = true; + /* *SPLIT may be part of I2SRC, so make sure we have the + original expression around for later debug processing. + We should not need I2SRC any more in other cases. */ + if (MAY_HAVE_DEBUG_INSNS) + i2src = copy_rtx (i2src); + else + i2src = NULL; + /* Get NEWDEST as a register in the proper mode. We have already validated that we can do this. */ if (GET_MODE (i2dest) != split_mode && split_mode != VOIDmode) @@ -3790,7 +3805,13 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) call_usage = copy_rtx (call_usage); if (substed_i2) - replace_rtx (call_usage, i2dest, i2src); + { + /* I2SRC must still be meaningful at this point. Some splitting + operations can invalidate I2SRC, but those operations do not + apply to calls. */ + gcc_assert (i2src); + replace_rtx (call_usage, i2dest, i2src); + } if (substed_i1) replace_rtx (call_usage, i1dest, i1src); |