+2010-05-19 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * 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.
+
2010-05-19 Anatoly Sokolov <aesok@post.ru>
* double-int.h (double_int_ior): New function.
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;
p.after = move;
#endif
+ first_p = true;
next = NEXT_INSN (insn);
while (next != last)
{
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);
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)
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);