summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-08 11:13:54 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-08 11:13:54 +0000
commit6eca0bfbf4e17711b5f5240bdaa9fc4e5897b80e (patch)
tree7f34b4810050d284a3cd94485d4ebef7a2fa0015
parentcd0fe062c23ebe2f55883f47befcacc3c0dca9ea (diff)
downloadgcc-6eca0bfbf4e17711b5f5240bdaa9fc4e5897b80e.tar.gz
* cse.c (dead_libcall_p): Update counts.
(delete_trivially_dead_insns): Update call of dead_libcall_p. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53287 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cse.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bfeecda612b..686cacebee1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Wed May 8 13:12:11 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * cse.c (dead_libcall_p): Update counts.
+ (delete_trivially_dead_insns): Update call of dead_libcall_p.
+
Wed May 8 11:08:50 CEST 2002 Jan Hubicka <jh@suse.cz>
* cfglayout.c (function_tail_eff_head): Rename to ...
diff --git a/gcc/cse.c b/gcc/cse.c
index c15c63fffb7..c292c520240 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -691,7 +691,7 @@ static int check_dependence PARAMS ((rtx *, void *));
static void flush_hash_table PARAMS ((void));
static bool insn_live_p PARAMS ((rtx, int *));
static bool set_live_p PARAMS ((rtx, rtx, int *));
-static bool dead_libcall_p PARAMS ((rtx));
+static bool dead_libcall_p PARAMS ((rtx, int *));
/* Dump the expressions in the equivalence class indicated by CLASSP.
This function is used only for debugging. */
@@ -7571,8 +7571,9 @@ insn_live_p (insn, counts)
/* Return true if libcall is dead as a whole. */
static bool
-dead_libcall_p (insn)
+dead_libcall_p (insn, counts)
rtx insn;
+ int *counts;
{
rtx note;
/* See if there's a REG_EQUAL note on this insn and try to
@@ -7589,11 +7590,17 @@ dead_libcall_p (insn)
if (!new)
new = XEXP (note, 0);
+ /* While changing insn, we must update the counts accordingly. */
+ count_reg_usage (insn, counts, NULL_RTX, -1);
+
if (set && validate_change (insn, &SET_SRC (set), new, 0))
{
+ count_reg_usage (insn, counts, NULL_RTX, 1);
remove_note (insn, find_reg_note (insn, REG_RETVAL, NULL_RTX));
+ remove_note (insn, note);
return true;
}
+ count_reg_usage (insn, counts, NULL_RTX, 1);
}
return false;
}
@@ -7652,7 +7659,7 @@ delete_trivially_dead_insns (insns, nreg)
{
in_libcall = 1;
live_insn = 1;
- dead_libcall = dead_libcall_p (insn);
+ dead_libcall = dead_libcall_p (insn, counts);
}
else if (in_libcall)
live_insn = ! dead_libcall;