This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: More dead code and clean-up in bbro
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH: More dead code and clean-up in bbro
- From: Jason Eckhardt <jle at cygnus dot com>
- Date: Wed, 3 May 2000 19:43:01 -0700 (PDT)
This removes the final bits of code that became dead with previous checkins.
Also some small cleanups were done.
full bootstrap clean on i686-linux.
Wed May 3 21:01:46 2000 Jason Eckhardt <jle@cygnus.com>
* bb-reorder.c (struct reorder_block_def): Member succ removed.
(REORDER_BLOCK_SUCC): Removed.
(enum reorder_skip_type): Removed.
(skip_insns_between_block): Renamed to skip_insns_after_block.
Removed second argument. Removed dead code and cleaned up.
(make_reorder_chain): Removed use of REORDER_BLOCK_SUCC.
(reorder_basic_blocks): Remove use of REORDER_SKIP_AFTER. Removed
second parameter to skip_insns_after_block.
Index: bb-reorder.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/bb-reorder.c,v
retrieving revision 1.10
diff -c -3 -p -r1.10 bb-reorder.c
*** bb-reorder.c 2000/05/03 04:41:04 1.10
--- bb-reorder.c 2000/05/04 01:49:14
*************** typedef struct reorder_block_def {
*** 103,109 ****
int flags;
int index;
basic_block add_jump;
- edge succ;
rtx eff_head;
rtx eff_end;
scope scope;
--- 103,108 ----
*************** static struct reorder_block_def rbd_init
*** 114,120 ****
0, /* flags */
0, /* index */
NULL, /* add_jump */
- NULL, /* succ */
NULL_RTX, /* eff_head */
NULL_RTX, /* eff_end */
NULL /* scope */
--- 113,118 ----
*************** static struct reorder_block_def rbd_init
*** 133,141 ****
#define REORDER_BLOCK_ADD_JUMP(bb) \
((reorder_block_def) (bb)->aux)->add_jump
- #define REORDER_BLOCK_SUCC(bb) \
- ((reorder_block_def) (bb)->aux)->succ
-
#define REORDER_BLOCK_EFF_HEAD(bb) \
((reorder_block_def) (bb)->aux)->eff_head
--- 131,136 ----
*************** static struct reorder_block_def rbd_init
*** 149,161 ****
static int reorder_index;
static basic_block reorder_last_visited;
- enum reorder_skip_type {REORDER_SKIP_BEFORE, REORDER_SKIP_AFTER,
- REORDER_SKIP_BLOCK_END};
-
/* Local function prototypes. */
! static rtx skip_insns_between_block PARAMS ((basic_block,
! enum reorder_skip_type));
static basic_block get_common_dest PARAMS ((basic_block, basic_block));
static basic_block chain_reorder_blocks PARAMS ((edge, basic_block));
static void make_reorder_chain PARAMS ((basic_block));
--- 144,152 ----
static int reorder_index;
static basic_block reorder_last_visited;
/* Local function prototypes. */
! static rtx skip_insns_after_block PARAMS ((basic_block));
static basic_block get_common_dest PARAMS ((basic_block, basic_block));
static basic_block chain_reorder_blocks PARAMS ((edge, basic_block));
static void make_reorder_chain PARAMS ((basic_block));
*************** static void free_scope_forest PARAMS ((
*** 176,288 ****
void dump_scope_forest PARAMS ((scope_forest_info *));
static void dump_scope_forest_1 PARAMS ((scope, int));
! /* Skip over insns BEFORE or AFTER BB which are typically associated with
! basic block BB. */
static rtx
! skip_insns_between_block (bb, skip_type)
basic_block bb;
- enum reorder_skip_type skip_type;
{
rtx insn, last_insn;
-
- if (skip_type == REORDER_SKIP_BEFORE)
- {
- if (bb == ENTRY_BLOCK_PTR)
- return 0;
-
- last_insn = bb->head;
- for (insn = PREV_INSN (bb->head);
- insn && insn != BASIC_BLOCK (bb->index - 1)->end;
- last_insn = insn, insn = PREV_INSN (insn))
- {
- if (NEXT_INSN (insn) != last_insn)
- break;
-
- if (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_END
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BLOCK_END)
- continue;
-
- break;
- }
- }
- else
- {
- last_insn = bb->end;
-
- if (bb == EXIT_BLOCK_PTR)
- return 0;
-
- for (insn = NEXT_INSN (bb->end);
- insn;
- last_insn = insn, insn = NEXT_INSN (insn))
- {
- if (bb->index + 1 != n_basic_blocks
- && insn == BASIC_BLOCK (bb->index + 1)->head)
- break;
-
- if (GET_CODE (insn) == BARRIER
- || GET_CODE (insn) == JUMP_INSN
- || (GET_CODE (insn) == NOTE
- && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)))
- continue;
-
- if (GET_CODE (insn) == CODE_LABEL
- && GET_CODE (NEXT_INSN (insn)) == JUMP_INSN
- && (GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_VEC
- || GET_CODE (PATTERN
- (NEXT_INSN (insn))) == ADDR_DIFF_VEC))
- {
- insn = NEXT_INSN (insn);
- continue;
- }
! /* Skip to next non-deleted insn. */
! if (GET_CODE (insn) == NOTE
! && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED
! || NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))
! continue;
! break;
! }
!
! if (skip_type == REORDER_SKIP_BLOCK_END)
! {
! int found_block_end = 0;
!
! for (; insn; last_insn = insn, insn = NEXT_INSN (insn))
! {
! if (bb->index + 1 != n_basic_blocks
! && insn == BASIC_BLOCK (bb->index + 1)->head)
! break;
! if (GET_CODE (insn) == NOTE
! && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)
! {
! found_block_end = 1;
! continue;
! }
! if (GET_CODE (insn) == NOTE
! && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)
! continue;
!
! if (GET_CODE (insn) == NOTE
! && NOTE_LINE_NUMBER (insn) >= 0
! && NEXT_INSN (insn)
! && GET_CODE (NEXT_INSN (insn)) == NOTE
! && (NOTE_LINE_NUMBER (NEXT_INSN (insn))
! == NOTE_INSN_BLOCK_END))
! continue;
! break;
! }
! if (! found_block_end)
! last_insn = 0;
! }
}
return last_insn;
--- 167,218 ----
void dump_scope_forest PARAMS ((scope_forest_info *));
static void dump_scope_forest_1 PARAMS ((scope, int));
! /* Skip over inter-block insns occurring after BB which are typically
! associated with BB (e.g., barriers). If there are any such insns,
! we return the last one. Otherwise, we return the end of BB. */
static rtx
! skip_insns_after_block (bb)
basic_block bb;
{
rtx insn, last_insn;
! last_insn = bb->end;
! if (bb == EXIT_BLOCK_PTR)
! return 0;
! for (insn = NEXT_INSN (bb->end);
! insn;
! last_insn = insn, insn = NEXT_INSN (insn))
! {
! if (bb->index + 1 != n_basic_blocks
! && insn == BASIC_BLOCK (bb->index + 1)->head)
! break;
!
! if (GET_CODE (insn) == BARRIER
! || GET_CODE (insn) == JUMP_INSN
! || (GET_CODE (insn) == NOTE
! && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
! || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)))
! continue;
! if (GET_CODE (insn) == CODE_LABEL
! && GET_CODE (NEXT_INSN (insn)) == JUMP_INSN
! && (GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_VEC
! || GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_DIFF_VEC))
! {
! insn = NEXT_INSN (insn);
! continue;
! }
!
! /* Skip to next non-deleted insn. */
! if (GET_CODE (insn) == NOTE
! && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED
! || NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))
! continue;
! break;
}
return last_insn;
*************** make_reorder_chain (bb)
*** 566,573 ****
if (REORDER_BLOCK_FLAGS (e->dest) & REORDER_BLOCK_VISITED)
REORDER_BLOCK_FLAGS (e->dest) &= ~REORDER_BLOCK_HEAD;
- REORDER_BLOCK_SUCC (bb) = e;
-
visited_edge = e->dest;
reorder_last_visited = chain_reorder_blocks (e, bb);
--- 496,501 ----
*************** reorder_basic_blocks ()
*** 1410,1417 ****
for (i = 0; i < n_basic_blocks; i++)
{
basic_block bbi = BASIC_BLOCK (i);
! REORDER_BLOCK_EFF_END (bbi)
! = skip_insns_between_block (bbi, REORDER_SKIP_AFTER);
if (i == 0)
REORDER_BLOCK_EFF_HEAD (bbi) = get_insns ();
else
--- 1338,1344 ----
for (i = 0; i < n_basic_blocks; i++)
{
basic_block bbi = BASIC_BLOCK (i);
! REORDER_BLOCK_EFF_END (bbi) = skip_insns_after_block (bbi);
if (i == 0)
REORDER_BLOCK_EFF_HEAD (bbi) = get_insns ();
else