aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>2000-05-31 15:29:38 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-05-31 15:29:38 -0700
commiteb7e5da2fc504a81d64e9aeab2408cecbdde0c29 (patch)
tree02f2ad55c05de20a9e17213ef04d6c96d56f0fc6 /gcc
parent1febe16ba4611263eafa03b89edf8deae69dcdae (diff)
downloadgcc-eb7e5da2fc504a81d64e9aeab2408cecbdde0c29.zip
gcc-eb7e5da2fc504a81d64e9aeab2408cecbdde0c29.tar.gz
gcc-eb7e5da2fc504a81d64e9aeab2408cecbdde0c29.tar.bz2
flow.c (propagate_block): Move initialization of mem_set_list ...
* flow.c (propagate_block): Move initialization of mem_set_list ... (init_propagate_block_info): ... here. Also track blocks with no successors; don't scan insns if ! PROP_SCAN_DEAD_CODE. From-SVN: r34310
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/flow.c48
2 files changed, 33 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 59870df..aea8ddb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2000-05-31 Richard Henderson <rth@cygnus.com>
+ * flow.c (propagate_block): Move initialization of mem_set_list ...
+ (init_propagate_block_info): ... here. Also track blocks with
+ no successors; don't scan insns if ! PROP_SCAN_DEAD_CODE.
+
+2000-05-31 Richard Henderson <rth@cygnus.com>
+
* jump.c (jump_optimize_1): Revert 05-18 change.
2000-05-31 Mark Mitchell <mark@codesourcery.com>
diff --git a/gcc/flow.c b/gcc/flow.c
index 5526c9f..dcdf9692 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -3639,7 +3639,8 @@ init_propagate_block_info (bb, live, local_set, flags)
/* If this block ends in a conditional branch, for each register live
from one side of the branch and not the other, record the register
as conditionally dead. */
- if (GET_CODE (bb->end) == JUMP_INSN
+ if ((flags & (PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE))
+ && GET_CODE (bb->end) == JUMP_INSN
&& any_condjump_p (bb->end))
{
regset_head diff_head;
@@ -3717,6 +3718,31 @@ init_propagate_block_info (bb, live, local_set, flags)
}
#endif
+ /* If this block has no successors, any stores to the frame that aren't
+ used later in the block are dead. So make a pass over the block
+ recording any such that are made and show them dead at the end. We do
+ a very conservative and simple job here. */
+ if ((flags & PROP_SCAN_DEAD_CODE)
+ && (bb->succ == NULL
+ || (bb->succ->succ_next == NULL
+ && bb->succ->dest == EXIT_BLOCK_PTR)))
+ {
+ rtx insn;
+ for (insn = bb->end; insn != bb->head; insn = PREV_INSN (insn))
+ if (GET_CODE (insn) == INSN
+ && GET_CODE (PATTERN (insn)) == SET
+ && GET_CODE (SET_DEST (PATTERN (insn))) == MEM)
+ {
+ rtx mem = SET_DEST (PATTERN (insn));
+
+ if (XEXP (mem, 0) == frame_pointer_rtx
+ || (GET_CODE (XEXP (mem, 0)) == PLUS
+ && XEXP (XEXP (mem, 0), 0) == frame_pointer_rtx
+ && GET_CODE (XEXP (XEXP (mem, 0), 1)) == CONST_INT))
+ pbi->mem_set_list = alloc_EXPR_LIST (0, mem, pbi->mem_set_list);
+ }
+ }
+
return pbi;
}
@@ -3772,26 +3798,6 @@ propagate_block (bb, live, local_set, flags)
{ REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL; });
}
- /* If this block has no successors, any stores to the frame that aren't
- used later in the block are dead. So make a pass over the block
- recording any such that are made and show them dead at the end. We do
- a very conservative and simple job here. */
- if (bb->succ != 0 && bb->succ->succ_next == 0
- && bb->succ->dest == EXIT_BLOCK_PTR)
- for (insn = bb->end; insn != bb->head; insn = PREV_INSN (insn))
- if (GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == SET
- && GET_CODE (SET_DEST (PATTERN (insn))) == MEM)
- {
- rtx mem = SET_DEST (PATTERN (insn));
-
- if ((GET_CODE (XEXP (mem, 0)) == REG
- && REGNO (XEXP (mem, 0)) == FRAME_POINTER_REGNUM)
- || (GET_CODE (XEXP (mem, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (mem, 0), 0)) == REG
- && REGNO (XEXP (XEXP (mem, 0), 0)) == FRAME_POINTER_REGNUM))
- pbi->mem_set_list = alloc_EXPR_LIST (0, mem, pbi->mem_set_list);
- }
-
/* Scan the block an insn at a time from end to beginning. */
for (insn = bb->end; ; insn = prev)