diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-06 20:36:03 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-06 20:36:03 +0000 |
commit | e4ab123c32e6ee2064f01f5bb477bfaca438c20f (patch) | |
tree | 45c6c5ff8fa819ab554de69d49403a43f8de5ecb /gcc/cse.c | |
parent | 692323c3112b3b579a1634758842ede7c416f94c (diff) | |
download | gcc-e4ab123c32e6ee2064f01f5bb477bfaca438c20f.tar.gz |
2011-03-06 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 170715 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@170721 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cse.c')
-rw-r--r-- | gcc/cse.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/cse.c b/gcc/cse.c index 3ab6b37a8ea..f7b477c60b1 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -6575,8 +6575,9 @@ check_for_label_ref (rtx *rtl, void *data) Don't count a usage of DEST, which is the SET_DEST of a SET which contains X in its SET_SRC. This is because such a SET does not modify the liveness of DEST. - DEST is set to pc_rtx for a trapping insn, which means that we must count - uses of a SET_DEST regardless because the insn can't be deleted here. */ + DEST is set to pc_rtx for a trapping insn, or for an insn with side effects. + We must then count uses of a SET_DEST regardless, because the insn can't be + deleted here. */ static void count_reg_usage (rtx x, int *counts, rtx dest, int incr) @@ -6629,9 +6630,10 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr) case CALL_INSN: case INSN: case JUMP_INSN: - /* We expect dest to be NULL_RTX here. If the insn may trap, mark - this fact by setting DEST to pc_rtx. */ - if (insn_could_throw_p (x)) + /* We expect dest to be NULL_RTX here. If the insn may trap, + or if it cannot be deleted due to side-effects, mark this fact + by setting DEST to pc_rtx. */ + if (insn_could_throw_p (x) || side_effects_p (PATTERN (x))) dest = pc_rtx; if (code == CALL_INSN) count_reg_usage (CALL_INSN_FUNCTION_USAGE (x), counts, dest, incr); @@ -6671,10 +6673,6 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr) return; case ASM_OPERANDS: - /* If the asm is volatile, then this insn cannot be deleted, - and so the inputs *must* be live. */ - if (MEM_VOLATILE_P (x)) - dest = NULL_RTX; /* Iterate over just the inputs, not the constraints as well. */ for (i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; i--) count_reg_usage (ASM_OPERANDS_INPUT (x, i), counts, dest, incr); |