Commit 67e0a632 by Andreas Krebbel Committed by Andreas Krebbel

cse.c (validate_canon_reg, cse_insn): Don't change insns without calling recog.

2006-05-30  Andreas Krebbel  <krebbel1@de.ibm.com>

	* cse.c (validate_canon_reg, cse_insn): Don't change insns without
	calling recog.

From-SVN: r114241
parent 70233f37
2006-05-30 Andreas Krebbel <krebbel1@de.ibm.com>
* cse.c (validate_canon_reg, cse_insn): Don't change insns without
calling recog.
2006-05-30 Roger Sayle <roger@eyesopen.com> 2006-05-30 Roger Sayle <roger@eyesopen.com>
* simplify-rtx.c (simplify_binary_operation): Unfactor the shift * simplify-rtx.c (simplify_binary_operation): Unfactor the shift
......
...@@ -2728,17 +2728,10 @@ static void ...@@ -2728,17 +2728,10 @@ static void
validate_canon_reg (rtx *xloc, rtx insn) validate_canon_reg (rtx *xloc, rtx insn)
{ {
rtx new = canon_reg (*xloc, insn); rtx new = canon_reg (*xloc, insn);
int insn_code;
/* If replacing pseudo with hard reg or vice versa, ensure the /* If replacing pseudo with hard reg or vice versa, ensure the
insn remains valid. Likewise if the insn has MATCH_DUPs. */ insn remains valid. Likewise if the insn has MATCH_DUPs. */
if (insn != 0 && new != 0 if (insn != 0 && new != 0)
&& REG_P (new) && REG_P (*xloc)
&& (((REGNO (new) < FIRST_PSEUDO_REGISTER)
!= (REGNO (*xloc) < FIRST_PSEUDO_REGISTER))
|| GET_MODE (new) != GET_MODE (*xloc)
|| (insn_code = recog_memoized (insn)) < 0
|| insn_data[insn_code].n_dups > 0))
validate_change (insn, xloc, new, 1); validate_change (insn, xloc, new, 1);
else else
*xloc = new; *xloc = new;
...@@ -2748,8 +2741,7 @@ validate_canon_reg (rtx *xloc, rtx insn) ...@@ -2748,8 +2741,7 @@ validate_canon_reg (rtx *xloc, rtx insn)
replace each register reference inside it replace each register reference inside it
with the "oldest" equivalent register. with the "oldest" equivalent register.
If INSN is nonzero and we are replacing a pseudo with a hard register If INSN is nonzero validate_change is used to ensure that INSN remains valid
or vice versa, validate_change is used to ensure that INSN remains valid
after we make our substitution. The calls are made with IN_GROUP nonzero after we make our substitution. The calls are made with IN_GROUP nonzero
so apply_change_group must be called upon the outermost return from this so apply_change_group must be called upon the outermost return from this
function (unless INSN is zero). The result of apply_change_group can function (unless INSN is zero). The result of apply_change_group can
...@@ -4943,17 +4935,9 @@ cse_insn (rtx insn, rtx libcall_insn) ...@@ -4943,17 +4935,9 @@ cse_insn (rtx insn, rtx libcall_insn)
rtx dest = SET_DEST (sets[i].rtl); rtx dest = SET_DEST (sets[i].rtl);
rtx src = SET_SRC (sets[i].rtl); rtx src = SET_SRC (sets[i].rtl);
rtx new = canon_reg (src, insn); rtx new = canon_reg (src, insn);
int insn_code;
sets[i].orig_src = src; sets[i].orig_src = src;
if ((REG_P (new) && REG_P (src) validate_change (insn, &SET_SRC (sets[i].rtl), new, 1);
&& ((REGNO (new) < FIRST_PSEUDO_REGISTER)
!= (REGNO (src) < FIRST_PSEUDO_REGISTER)))
|| (insn_code = recog_memoized (insn)) < 0
|| insn_data[insn_code].n_dups > 0)
validate_change (insn, &SET_SRC (sets[i].rtl), new, 1);
else
SET_SRC (sets[i].rtl) = new;
if (GET_CODE (dest) == ZERO_EXTRACT) if (GET_CODE (dest) == ZERO_EXTRACT)
{ {
......
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