aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-02-25 00:54:30 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-02-25 00:54:30 +0000
commit2e802a6f2f5301c0245060cb49616e048a60b46f (patch)
treefa096890523a25cd2e0753dd6b63f6254baae475
parentc30316fb641074bcf5d567863fd5e9f3c70b0587 (diff)
downloadgcc-2e802a6f2f5301c0245060cb49616e048a60b46f.zip
gcc-2e802a6f2f5301c0245060cb49616e048a60b46f.tar.gz
gcc-2e802a6f2f5301c0245060cb49616e048a60b46f.tar.bz2
cse.c (cse_change_cc_mode_insns): Stop at any instruction which modifies NEWREG.
* cse.c (cse_change_cc_mode_insns): Stop at any instruction which modifies NEWREG. (cse_condition_code_reg): Update the mode of CC_REG in CC_SRC_INSN on our own. From-SVN: r78413
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/cse.c22
2 files changed, 25 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6b9ac6e..bff9fd8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2004-02-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cse.c (cse_change_cc_mode_insns): Stop at any instruction
+ which modifies NEWREG.
+ (cse_condition_code_reg): Update the mode of CC_REG in
+ CC_SRC_INSN on our own.
+
2004-02-24 Michael Matz <matz@suse.de>
* config/i386/i386.c (ix86_comp_type_attributes): Check for
diff --git a/gcc/cse.c b/gcc/cse.c
index 2d560e0..20a4b69 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -7704,7 +7704,7 @@ cse_change_cc_mode (rtx *loc, void *data)
/* Change the mode of any reference to the register REGNO (NEWREG) to
GET_MODE (NEWREG), starting at START. Stop before END. Stop at
- any instruction after START which modifies NEWREG. */
+ any instruction which modifies NEWREG. */
static void
cse_change_cc_mode_insns (rtx start, rtx end, rtx newreg)
@@ -7716,7 +7716,7 @@ cse_change_cc_mode_insns (rtx start, rtx end, rtx newreg)
if (! INSN_P (insn))
continue;
- if (insn != start && reg_set_p (newreg, insn))
+ if (reg_set_p (newreg, insn))
return;
for_each_rtx (&PATTERN (insn), cse_change_cc_mode, newreg);
@@ -8008,8 +8008,22 @@ cse_condition_code_reg (void)
if (mode != GET_MODE (cc_src))
abort ();
if (mode != orig_mode)
- cse_change_cc_mode_insns (cc_src_insn, NEXT_INSN (last_insn),
- gen_rtx_REG (mode, REGNO (cc_reg)));
+ {
+ rtx newreg = gen_rtx_REG (mode, REGNO (cc_reg));
+
+ /* Change the mode of CC_REG in CC_SRC_INSN to
+ GET_MODE (NEWREG). */
+ for_each_rtx (&PATTERN (cc_src_insn), cse_change_cc_mode,
+ newreg);
+ for_each_rtx (&REG_NOTES (cc_src_insn), cse_change_cc_mode,
+ newreg);
+
+ /* Do the same in the following insns that use the
+ current value of CC_REG within BB. */
+ cse_change_cc_mode_insns (NEXT_INSN (cc_src_insn),
+ NEXT_INSN (last_insn),
+ newreg);
+ }
}
}
}