aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2002-05-08 13:13:54 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2002-05-08 11:13:54 +0000
commit1e150f2cd28197429f31095e686b4f566eb11306 (patch)
tree7f34b4810050d284a3cd94485d4ebef7a2fa0015 /gcc/cse.c
parent969d70ca573bbd887b1ccfa21130c70b463ad1f9 (diff)
downloadgcc-1e150f2cd28197429f31095e686b4f566eb11306.zip
gcc-1e150f2cd28197429f31095e686b4f566eb11306.tar.gz
gcc-1e150f2cd28197429f31095e686b4f566eb11306.tar.bz2
cse.c (dead_libcall_p): Update counts.
* cse.c (dead_libcall_p): Update counts. (delete_trivially_dead_insns): Update call of dead_libcall_p. From-SVN: r53287
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index c15c63ff..c292c52 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;