Commit 205eb6e7 by Richard Sandiford Committed by Richard Sandiford

re PR rtl-optimization/27073 (invalid gcse manipulation of REG_EQUIV notes)

	PR rtl-optimization/27073
	* gcse.c (try_replace_reg): Revert last change.  Continue to search
	for both REG_EQUAL and REG_EQUIV notes, but only perform replacements
	on the former.

From-SVN: r112861
parent ef6843ed
2006-04-11 Richard Sandiford <richard@codesourcery.com>
PR rtl-optimization/27073
* gcse.c (try_replace_reg): Revert last change. Continue to search
for both REG_EQUAL and REG_EQUIV notes, but only perform replacements
on the former.
2006-04-11 Eric Botcazou <ebotcazou@libertysurf.fr> 2006-04-11 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.c (function_arg_slotno) <BLKmode>: Handle * config/sparc/sparc.c (function_arg_slotno) <BLKmode>: Handle
......
...@@ -2642,7 +2642,7 @@ find_used_regs (rtx *xptr, void *data ATTRIBUTE_UNUSED) ...@@ -2642,7 +2642,7 @@ find_used_regs (rtx *xptr, void *data ATTRIBUTE_UNUSED)
static int static int
try_replace_reg (rtx from, rtx to, rtx insn) try_replace_reg (rtx from, rtx to, rtx insn)
{ {
rtx note = find_reg_note (insn, REG_EQUAL, NULL); rtx note = find_reg_equal_equiv_note (insn);
rtx src = 0; rtx src = 0;
int success = 0; int success = 0;
rtx set = single_set (insn); rtx set = single_set (insn);
...@@ -2660,9 +2660,9 @@ try_replace_reg (rtx from, rtx to, rtx insn) ...@@ -2660,9 +2660,9 @@ try_replace_reg (rtx from, rtx to, rtx insn)
validate_change (insn, &SET_SRC (set), src, 0); validate_change (insn, &SET_SRC (set), src, 0);
} }
/* If there is already a NOTE, update the expression in it with our /* If there is already a REG_EQUAL note, update the expression in it
replacement. */ with our replacement. */
if (note != 0) if (note != 0 && REG_NOTE_KIND (note) == REG_EQUAL)
XEXP (note, 0) = simplify_replace_rtx (XEXP (note, 0), from, to); XEXP (note, 0) = simplify_replace_rtx (XEXP (note, 0), from, to);
if (!success && set && reg_mentioned_p (from, SET_SRC (set))) if (!success && set && reg_mentioned_p (from, SET_SRC (set)))
...@@ -2689,7 +2689,7 @@ try_replace_reg (rtx from, rtx to, rtx insn) ...@@ -2689,7 +2689,7 @@ try_replace_reg (rtx from, rtx to, rtx insn)
We don't allow that. Remove that note. This code ought We don't allow that. Remove that note. This code ought
not to happen, because previous code ought to synthesize not to happen, because previous code ought to synthesize
reg-reg move, but be on the safe side. */ reg-reg move, but be on the safe side. */
if (note && REG_P (XEXP (note, 0))) if (note && REG_NOTE_KIND (note) == REG_EQUAL && REG_P (XEXP (note, 0)))
remove_note (insn, note); remove_note (insn, note);
return success; return success;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment