aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2004-01-25 12:11:47 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2004-01-25 11:11:47 +0000
commite6d8312885dab0589b31eb3c0a88d2c1414222f1 (patch)
treeb01c8fd68b496cb3736540e3ea53fa67656c2cd9
parent9c519c934cf55602191f45f06eed1ec7c46e3487 (diff)
downloadgcc-e6d8312885dab0589b31eb3c0a88d2c1414222f1.zip
gcc-e6d8312885dab0589b31eb3c0a88d2c1414222f1.tar.gz
gcc-e6d8312885dab0589b31eb3c0a88d2c1414222f1.tar.bz2
* combine.c (recog_for_combine): Avoid allocating unnecesary RTX.
From-SVN: r76553
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/combine.c19
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d6138b2..b5c11b3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2004-01-25 Jan Hubicka <jh@suse.cz>
+
+ * combine.c (recog_for_combine): Avoid allocating unnecesary RTX.
+
2004-01-25 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips-protos.h (mips_reg_mode_ok_for_base_p): Delete.
diff --git a/gcc/combine.c b/gcc/combine.c
index f84c277..9137076 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -9869,7 +9869,7 @@ recog_for_combine (rtx *pnewpat, rtx insn, rtx *pnotes)
int num_clobbers_to_add = 0;
int i;
rtx notes = 0;
- rtx dummy_insn;
+ rtx old_notes, old_pat;
/* If PAT is a PARALLEL, check to see if it contains the CLOBBER
we use to indicate that something didn't match. If we find such a
@@ -9880,13 +9880,12 @@ recog_for_combine (rtx *pnewpat, rtx insn, rtx *pnotes)
&& XEXP (XVECEXP (pat, 0, i), 0) == const0_rtx)
return -1;
- /* *pnewpat does not have to be actual PATTERN (insn), so make a dummy
- instruction for pattern recognition. */
- dummy_insn = shallow_copy_rtx (insn);
- PATTERN (dummy_insn) = pat;
- REG_NOTES (dummy_insn) = 0;
+ old_pat = PATTERN (insn);
+ old_notes = REG_NOTES (insn);
+ PATTERN (insn) = pat;
+ REG_NOTES (insn) = 0;
- insn_code_number = recog (pat, dummy_insn, &num_clobbers_to_add);
+ insn_code_number = recog (pat, insn, &num_clobbers_to_add);
/* If it isn't, there is the possibility that we previously had an insn
that clobbered some register as a side effect, but the combined
@@ -9911,9 +9910,11 @@ recog_for_combine (rtx *pnewpat, rtx insn, rtx *pnotes)
if (pos == 1)
pat = XVECEXP (pat, 0, 0);
- PATTERN (dummy_insn) = pat;
- insn_code_number = recog (pat, dummy_insn, &num_clobbers_to_add);
+ PATTERN (insn) = pat;
+ insn_code_number = recog (pat, insn, &num_clobbers_to_add);
}
+ PATTERN (insn) = old_pat;
+ REG_NOTES (insn) = old_notes;
/* Recognize all noop sets, these will be killed by followup pass. */
if (insn_code_number < 0 && GET_CODE (pat) == SET && set_noop_p (pat))