diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2000-05-31 11:58:35 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2000-05-31 07:58:35 -0400 |
commit | 8c410416207d0fd87d574c621eaacfb74588c47e (patch) | |
tree | 27d600ce15ff0bdab4697a43d2848886d96aed6d /gcc | |
parent | efd58783444cdeb32ac41a9a1bc645e9544e8c1f (diff) | |
download | gcc-8c410416207d0fd87d574c621eaacfb74588c47e.zip gcc-8c410416207d0fd87d574c621eaacfb74588c47e.tar.gz gcc-8c410416207d0fd87d574c621eaacfb74588c47e.tar.bz2 |
flow.c (propagate_block): If block has no successors, stores to frame are dead if not used.
* flow.c (propagate_block): If block has no successors, stores to
frame are dead if not used.
From-SVN: r34296
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/flow.c | 20 |
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 47df6aa..8dea693 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Wed May 31 08:07:52 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * flow.c (propagate_block): If block has no successors, stores to + frame are dead if not used. + 2000-05-31 Nathan Sidwell <nathan@codesourcery.com> * stmt (expand_end_case): Reorder conversion sequence for jump @@ -3772,6 +3772,26 @@ 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) |