diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1997-04-13 14:51:22 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1997-04-13 14:51:22 -0400 |
commit | 5887325513b0bafa41a4c77a094d7995cc09817c (patch) | |
tree | f0d4fa042a12ccd0d4e48bce387e3354cda7f052 /gcc | |
parent | cfb3ee16db4fc9138f2df3524c32c580bb505460 (diff) | |
download | gcc-5887325513b0bafa41a4c77a094d7995cc09817c.zip gcc-5887325513b0bafa41a4c77a094d7995cc09817c.tar.gz gcc-5887325513b0bafa41a4c77a094d7995cc09817c.tar.bz2 |
(canon_reg, cse_insn): Don't examine insn_n_dups if recog_memoized
fails to find a match.
From-SVN: r13888
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cse.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -2595,6 +2595,7 @@ canon_reg (x, insn) if (fmt[i] == 'e') { rtx new = canon_reg (XEXP (x, i), insn); + int insn_code; /* If replacing pseudo with hard reg or vice versa, ensure the insn remains valid. Likewise if the insn has MATCH_DUPs. */ @@ -2602,7 +2603,8 @@ canon_reg (x, insn) && GET_CODE (new) == REG && GET_CODE (XEXP (x, i)) == REG && (((REGNO (new) < FIRST_PSEUDO_REGISTER) != (REGNO (XEXP (x, i)) < FIRST_PSEUDO_REGISTER)) - || insn_n_dups[recog_memoized (insn)] > 0)) + || (insn_code = recog_memoized (insn)) < 0 + || insn_n_dups[insn_code] > 0)) validate_change (insn, &XEXP (x, i), new, 1); else XEXP (x, i) = new; @@ -6328,11 +6330,13 @@ cse_insn (insn, in_libcall_block) rtx dest = SET_DEST (sets[i].rtl); rtx src = SET_SRC (sets[i].rtl); rtx new = canon_reg (src, insn); + int insn_code; if ((GET_CODE (new) == REG && GET_CODE (src) == REG && ((REGNO (new) < FIRST_PSEUDO_REGISTER) != (REGNO (src) < FIRST_PSEUDO_REGISTER))) - || insn_n_dups[recog_memoized (insn)] > 0) + || (insn_code = recog_memoized (insn)) < 0 + || insn_n_dups[insn_code] > 0) validate_change (insn, &SET_SRC (sets[i].rtl), new, 1); else SET_SRC (sets[i].rtl) = new; |