From 3b413743e0719ecca26e5f5426b6baa837e0a13b Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 11 Jan 1999 14:37:20 -0800 Subject: [PATCH] basic-block.h (basic_block_head): Rename to x_basic_block_head. * basic-block.h (basic_block_head): Rename to x_basic_block_head. (basic_block_end): Rename to x_basic_block_end. (BLOCK_HEAD, BLOCK_END): Update. * caller-save.c: Change basic_block_head/end references to BLOCK_HEAD/END. * combine.c, flow.c, function.c, gcse.c, global.c: Likewise. * graph.c, haifa-sched.c, local-alloc.c, regclass.c: Likewise. * regmove.c, reload1.c, reorg.c, sched.c: Likewise. From-SVN: r24622 --- gcc/ChangeLog | 12 +++++++ gcc/basic-block.h | 8 ++--- gcc/caller-save.c | 8 ++--- gcc/combine.c | 16 ++++----- gcc/flow.c | 80 ++++++++++++++++++++--------------------- gcc/function.c | 24 ++++++------- gcc/gcse.c | 16 ++++----- gcc/global.c | 8 ++--- gcc/graph.c | 8 ++--- gcc/haifa-sched.c | 91 +++++++++++++++++++++++------------------------ gcc/local-alloc.c | 14 ++++---- gcc/regclass.c | 4 +-- gcc/regmove.c | 10 +++--- gcc/reload1.c | 18 +++++----- gcc/reorg.c | 6 ++-- gcc/sched.c | 50 +++++++++++++------------- 16 files changed, 192 insertions(+), 181 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4559680bd40a..f6c2f9cc54e2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +Mon Jan 11 22:36:01 1999 Richard Henderson + + * basic-block.h (basic_block_head): Rename to x_basic_block_head. + (basic_block_end): Rename to x_basic_block_end. + (BLOCK_HEAD, BLOCK_END): Update. + + * caller-save.c: Change basic_block_head/end references to + BLOCK_HEAD/END. + * combine.c, flow.c, function.c, gcse.c, global.c: Likewise. + * graph.c, haifa-sched.c, local-alloc.c, regclass.c: Likewise. + * regmove.c, reload1.c, reorg.c, sched.c: Likewise. + Sat Jan 9 23:54:09 1999 Kaveh R. Ghazi * gcc.c (xstrerror): Renamed from my_strerror. All callers diff --git a/gcc/basic-block.h b/gcc/basic-block.h index a946405ee5e7..465587e9ac5e 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -102,11 +102,11 @@ extern int n_basic_blocks; /* Index by basic block number, get first insn in the block. */ -extern rtx *basic_block_head; +extern rtx *x_basic_block_head; /* Index by basic block number, get last insn in the block. */ -extern rtx *basic_block_end; +extern rtx *x_basic_block_end; /* Index by basic block number, determine whether the block can be reached through a computed jump. */ @@ -176,8 +176,8 @@ extern void free_int_list PROTO ((int_list_block **)); /* Stuff for recording basic block info. */ -#define BLOCK_HEAD(B) basic_block_head[(B)] -#define BLOCK_END(B) basic_block_end[(B)] +#define BLOCK_HEAD(B) x_basic_block_head[(B)] +#define BLOCK_END(B) x_basic_block_end[(B)] /* Special block numbers [markers] for entry and exit. */ #define ENTRY_BLOCK (-1) diff --git a/gcc/caller-save.c b/gcc/caller-save.c index 5fffe344642e..e68403f7dbb3 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -732,8 +732,8 @@ insert_one_insn (chain, before_p, code, pat) registers from the live sets. */ COPY_REG_SET (new->live_before, chain->live_before); COPY_REG_SET (new->live_after, chain->live_before); - if (chain->insn == basic_block_head[chain->block]) - basic_block_head[chain->block] = new->insn; + if (chain->insn == BLOCK_HEAD (chain->block)) + BLOCK_HEAD (chain->block) = new->insn; } else { @@ -747,8 +747,8 @@ insert_one_insn (chain, before_p, code, pat) registers from the live sets, and observe REG_UNUSED notes. */ COPY_REG_SET (new->live_before, chain->live_after); COPY_REG_SET (new->live_after, chain->live_after); - if (chain->insn == basic_block_end[chain->block]) - basic_block_end[chain->block] = new->insn; + if (chain->insn == BLOCK_END (chain->block)) + BLOCK_END (chain->block) = new->insn; } new->block = chain->block; new->is_caller_save_insn = 1; diff --git a/gcc/combine.c b/gcc/combine.c index 8cbbb81cd9fd..8575b8a181e1 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -573,7 +573,7 @@ combine_instructions (f, nregs) /* If INSN starts a new basic block, update our basic block number. */ if (this_basic_block + 1 < n_basic_blocks - && basic_block_head[this_basic_block + 1] == insn) + && BLOCK_HEAD (this_basic_block + 1) == insn) this_basic_block++; if (GET_CODE (insn) == CODE_LABEL) @@ -2124,7 +2124,7 @@ try_combine (i3, i2, i1) for (insn = NEXT_INSN (i3); insn && (this_basic_block == n_basic_blocks - 1 - || insn != basic_block_head[this_basic_block + 1]); + || insn != BLOCK_HEAD (this_basic_block + 1)); insn = NEXT_INSN (insn)) { if (GET_RTX_CLASS (GET_CODE (insn)) == 'i' @@ -2310,7 +2310,7 @@ try_combine (i3, i2, i1) SET_DEST (XVECEXP (PATTERN (i2), 0, i)))) for (temp = NEXT_INSN (i2); temp && (this_basic_block == n_basic_blocks - 1 - || basic_block_head[this_basic_block] != temp); + || BLOCK_HEAD (this_basic_block) != temp); temp = NEXT_INSN (temp)) if (temp != i3 && GET_RTX_CLASS (GET_CODE (temp)) == 'i') for (link = LOG_LINKS (temp); link; link = XEXP (link, 1)) @@ -11035,7 +11035,7 @@ reg_dead_at_p (reg, insn) else { for (block = 0; block < n_basic_blocks; block++) - if (insn == basic_block_head[block]) + if (insn == BLOCK_HEAD (block)) break; if (block == n_basic_blocks) @@ -11726,9 +11726,9 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1) tem); /* If this insn was emitted between blocks, then update - basic_block_head of the current block to include it. */ - if (basic_block_end[this_basic_block - 1] == tem) - basic_block_head[this_basic_block] = place; + BLOCK_HEAD of the current block to include it. */ + if (BLOCK_END (this_basic_block - 1) == tem) + BLOCK_HEAD (this_basic_block) = place; } } @@ -11927,7 +11927,7 @@ distribute_links (links) for (insn = NEXT_INSN (XEXP (link, 0)); (insn && (this_basic_block == n_basic_blocks - 1 - || basic_block_head[this_basic_block + 1] != insn)); + || BLOCK_HEAD (this_basic_block + 1) != insn)); insn = NEXT_INSN (insn)) if (GET_RTX_CLASS (GET_CODE (insn)) == 'i' && reg_overlap_mentioned_p (reg, PATTERN (insn))) diff --git a/gcc/flow.c b/gcc/flow.c index 0a47c0e013a2..8fb2dea444f6 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -195,12 +195,12 @@ int regset_size; /* Element N is first insn in basic block N. This info lasts until we finish compiling the function. */ -rtx *basic_block_head; +rtx *x_basic_block_head; /* Element N is last insn in basic block N. This info lasts until we finish compiling the function. */ -rtx *basic_block_end; +rtx *x_basic_block_end; /* Element N indicates whether basic block N can be reached through a computed jump. */ @@ -344,7 +344,7 @@ find_basic_blocks (f, nregs, file) /* If the previous insn was a call that did not create an abnormal edge, we want to add a nop so that the CALL_INSN - itself is not at basic_block_end. This allows us to easily + itself is not at basic block end. This allows us to easily distinguish between normal calls and those which create abnormal edges in the flow graph. */ @@ -393,8 +393,8 @@ find_basic_blocks (f, nregs, file) /* Allocate some tables that last till end of compiling this function and some needed only in find_basic_blocks and life_analysis. */ - basic_block_head = XNMALLOC (rtx, n_basic_blocks); - basic_block_end = XNMALLOC (rtx, n_basic_blocks); + x_basic_block_head = XNMALLOC (rtx, n_basic_blocks); + x_basic_block_end = XNMALLOC (rtx, n_basic_blocks); basic_block_succ = XNMALLOC (int_list_ptr, n_basic_blocks); basic_block_pred = XNMALLOC (int_list_ptr, n_basic_blocks); bzero ((char *)basic_block_succ, n_basic_blocks * sizeof (int_list_ptr)); @@ -497,8 +497,8 @@ find_basic_blocks_1 (f, nonlocal_labels) || (prev_code == CALL_INSN && call_had_abnormal_edge) || prev_code == BARRIER))) { - basic_block_head[++i] = insn; - basic_block_end[i] = insn; + BLOCK_HEAD (++i) = insn; + BLOCK_END (i) = insn; basic_block_loop_depth[i] = depth; if (code == CODE_LABEL) @@ -513,7 +513,7 @@ find_basic_blocks_1 (f, nonlocal_labels) else if (GET_RTX_CLASS (code) == 'i') { - basic_block_end[i] = insn; + BLOCK_END (i) = insn; basic_block_loop_depth[i] = depth; } @@ -720,7 +720,7 @@ make_edges (i) /* See if control drops into the next block. */ if (i + 1 < n_basic_blocks) { - for (insn = PREV_INSN (basic_block_head[i + 1]); + for (insn = PREV_INSN (BLOCK_HEAD (i + 1)); insn && GET_CODE (insn) == NOTE; insn = PREV_INSN (insn)) ; @@ -728,7 +728,7 @@ make_edges (i) add_edge (i, i + 1); } - insn = basic_block_end[i]; + insn = BLOCK_END (i); if (GET_CODE (insn) == JUMP_INSN) mark_label_ref (i, PATTERN (insn)); @@ -741,8 +741,8 @@ make_edges (i) /* Now scan the insns for this block, we may need to make edges for some of them to various non-obvious locations (exception handlers, nonlocal labels, etc). */ - for (insn = basic_block_head[i]; - insn != NEXT_INSN (basic_block_end[i]); + for (insn = BLOCK_HEAD (i); + insn != NEXT_INSN (BLOCK_END (i)); insn = NEXT_INSN (insn)) { if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') @@ -934,16 +934,16 @@ delete_unreachable_blocks () if (i != j) { - rtx tmp = basic_block_head[i]; + rtx tmp = BLOCK_HEAD (i); for (;;) { BLOCK_NUM (tmp) = j; - if (tmp == basic_block_end[i]) + if (tmp == BLOCK_END (i)) break; tmp = NEXT_INSN (tmp); } - basic_block_head[j] = basic_block_head[i]; - basic_block_end[j] = basic_block_end[i]; + BLOCK_HEAD (j) = BLOCK_HEAD (i); + BLOCK_END (j) = BLOCK_END (i); basic_block_pred[j] = basic_block_pred[i]; basic_block_succ[j] = basic_block_succ[i]; basic_block_loop_depth[j] = basic_block_loop_depth[i]; @@ -977,7 +977,7 @@ delete_unreachable_blocks () } /* Delete the insns in a (non-live) block. We physically delete every - non-note insn except the start and end (so basic_block_head/end needn't + non-note insn except the start and end (so BLOCK_HEAD/END needn't be updated), we turn the latter into NOTE_INSN_DELETED notes. We use to "delete" the insns by turning them into notes, but we may be @@ -1003,7 +1003,7 @@ delete_block (i) We need to remove the label from the exception_handler_label list and remove the associated NOTE_EH_REGION_BEG and NOTE_EH_REGION_END notes. */ - insn = basic_block_head[i]; + insn = BLOCK_HEAD (i); if (GET_CODE (insn) == CODE_LABEL) { rtx x, *prev = &exception_handler_labels; @@ -1029,7 +1029,7 @@ delete_block (i) /* Walk the insns of the block, building a chain of NOTEs that need to be kept. */ - insn = basic_block_head[i]; + insn = BLOCK_HEAD (i); for (;;) { if (GET_CODE (insn) == BARRIER) @@ -1045,7 +1045,7 @@ delete_block (i) kept_tail = insn; } } - if (insn == basic_block_end[i]) + if (insn == BLOCK_END (i)) break; insn = NEXT_INSN (insn); } @@ -1063,19 +1063,19 @@ delete_block (i) place. */ if (kept_head == 0) { - NEXT_INSN (PREV_INSN (basic_block_head[i])) = insn; + NEXT_INSN (PREV_INSN (BLOCK_HEAD (i))) = insn; if (insn != 0) - PREV_INSN (insn) = PREV_INSN (basic_block_head[i]); + PREV_INSN (insn) = PREV_INSN (BLOCK_HEAD (i)); else - set_last_insn (PREV_INSN (basic_block_head[i])); + set_last_insn (PREV_INSN (BLOCK_HEAD(i))); } else { - NEXT_INSN (PREV_INSN (basic_block_head[i])) = kept_head; + NEXT_INSN (PREV_INSN (BLOCK_HEAD (i))) = kept_head; if (insn != 0) PREV_INSN (insn) = kept_tail; - PREV_INSN (kept_head) = PREV_INSN (basic_block_head[i]); + PREV_INSN (kept_head) = PREV_INSN (BLOCK_HEAD (i)); NEXT_INSN (kept_tail) = insn; /* This must happen after NEXT_INSN (kept_tail) has been reinitialized @@ -1096,7 +1096,7 @@ delete_block (i) if (block_live_static[j]) { rtx label; - insn = basic_block_end[i - 1]; + insn = BLOCK_END (i - 1); if (GET_CODE (insn) == JUMP_INSN /* An unconditional jump is the only possibility we must check for, since a conditional one @@ -1156,7 +1156,7 @@ life_analysis (f, nregs, file) /* Free the variables allocated by find_basic_blocks. - KEEP_HEAD_END_P is non-zero if basic_block_head and basic_block_end + KEEP_HEAD_END_P is non-zero if BLOCK_HEAD and BLOCK_END are not to be freed. */ void @@ -1179,12 +1179,12 @@ free_basic_block_vars (keep_head_end_p) uid_volatile = 0; } - if (! keep_head_end_p && basic_block_head) + if (! keep_head_end_p && x_basic_block_head) { - free (basic_block_head); - basic_block_head = 0; - free (basic_block_end); - basic_block_end = 0; + free (x_basic_block_head); + x_basic_block_head = 0; + free (x_basic_block_end); + x_basic_block_end = 0; } } @@ -1524,7 +1524,7 @@ life_analysis_1 (f, nregs) COPY_REG_SET (basic_block_live_at_start[i], basic_block_live_at_end[i]); propagate_block (basic_block_live_at_start[i], - basic_block_head[i], basic_block_end[i], 0, + BLOCK_HEAD (i), BLOCK_END (i), 0, first_pass ? basic_block_significant[i] : (regset) 0, i); @@ -1574,7 +1574,7 @@ life_analysis_1 (f, nregs) for (i = 0; i < n_basic_blocks; i++) { propagate_block (basic_block_live_at_end[i], - basic_block_head[i], basic_block_end[i], 1, + BLOCK_HEAD (i), BLOCK_END (i), 1, (regset) 0, i); #ifdef USE_C_ALLOCA alloca (0); @@ -2574,8 +2574,8 @@ find_auto_inc (needed, x, insn) new insn(s) and do the updates. */ emit_insns_before (insns, insn); - if (basic_block_head[BLOCK_NUM (insn)] == insn) - basic_block_head[BLOCK_NUM (insn)] = insns; + if (BLOCK_HEAD (BLOCK_NUM (insn)) == insn) + BLOCK_HEAD (BLOCK_NUM (insn)) = insns; /* INCR will become a NOTE and INSN won't contain a use of ADDR. If a use of ADDR was just placed in @@ -3276,14 +3276,14 @@ print_rtl_with_bb (outf, rtx_first) for (i = n_basic_blocks-1; i >= 0; i--) { rtx x; - start[INSN_UID (basic_block_head[i])] = i; - end[INSN_UID (basic_block_end[i])] = i; - for (x = basic_block_head[i]; x != NULL_RTX; x = NEXT_INSN (x)) + start[INSN_UID (BLOCK_HEAD (i))] = i; + end[INSN_UID (BLOCK_END (i))] = i; + for (x = BLOCK_HEAD (i); x != NULL_RTX; x = NEXT_INSN (x)) { in_bb_p[ INSN_UID(x)] = (in_bb_p[ INSN_UID(x)] == NOT_IN_BB) ? IN_ONE_BB : IN_MULTIPLE_BB; - if (x == basic_block_end[i]) + if (x == BLOCK_END (i)) break; } } diff --git a/gcc/function.c b/gcc/function.c index d9575cc0ca3c..865e6791f060 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -6267,9 +6267,9 @@ thread_prologue_and_epilogue_insns (f) /* Include the new prologue insns in the first block. Ignore them if they form a basic block unto themselves. */ - if (basic_block_head && n_basic_blocks - && GET_CODE (basic_block_head[0]) != CODE_LABEL) - basic_block_head[0] = NEXT_INSN (f); + if (x_basic_block_head && n_basic_blocks + && GET_CODE (BLOCK_HEAD (0)) != CODE_LABEL) + BLOCK_HEAD (0) = NEXT_INSN (f); /* Retain a map of the prologue insns. */ prologue = record_insns (GET_CODE (seq) == SEQUENCE ? seq : head); @@ -6335,9 +6335,9 @@ thread_prologue_and_epilogue_insns (f) /* Include the new epilogue insns in the last block. Ignore them if they form a basic block unto themselves. */ - if (basic_block_end && n_basic_blocks - && GET_CODE (basic_block_end[n_basic_blocks - 1]) != JUMP_INSN) - basic_block_end[n_basic_blocks - 1] = tail; + if (x_basic_block_end && n_basic_blocks + && GET_CODE (BLOCK_END (n_basic_blocks - 1)) != JUMP_INSN) + BLOCK_END (n_basic_blocks - 1) = tail; /* Retain a map of the epilogue insns. */ epilogue = record_insns (GET_CODE (seq) == SEQUENCE ? seq : tail); @@ -6397,10 +6397,10 @@ reposition_prologue_and_epilogue_notes (f) if (next) PREV_INSN (next) = prev; - /* Whether or not we can depend on basic_block_head, + /* Whether or not we can depend on BLOCK_HEAD, attempt to keep it up-to-date. */ - if (basic_block_head[0] == note) - basic_block_head[0] = next; + if (BLOCK_HEAD (0) == note) + BLOCK_HEAD (0) = next; add_insn_after (note, insn); } @@ -6441,11 +6441,11 @@ reposition_prologue_and_epilogue_notes (f) if (next) PREV_INSN (next) = prev; - /* Whether or not we can depend on basic_block_head, + /* Whether or not we can depend on BLOCK_HEAD, attempt to keep it up-to-date. */ if (n_basic_blocks - && basic_block_head[n_basic_blocks-1] == insn) - basic_block_head[n_basic_blocks-1] = note; + && BLOCK_HEAD (n_basic_blocks-1) == insn) + BLOCK_HEAD (n_basic_blocks-1) = note; add_insn_before (note, insn); } diff --git a/gcc/gcse.c b/gcc/gcse.c index 350433937980..95516d0cfe9f 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -2054,8 +2054,8 @@ compute_hash_table (f, set_p) mem_first_set = NEVER_SET; mem_last_set = NEVER_SET; - for (insn = basic_block_head[bb]; - insn && insn != NEXT_INSN (basic_block_end[bb]); + for (insn = BLOCK_HEAD (bb); + insn && insn != NEXT_INSN (BLOCK_END (bb)); insn = NEXT_INSN (insn)) { #ifdef NON_SAVING_SETJMP @@ -2099,8 +2099,8 @@ compute_hash_table (f, set_p) /* The next pass builds the hash table. */ - for (insn = basic_block_head[bb], in_libcall_block = 0; - insn && insn != NEXT_INSN (basic_block_end[bb]); + for (insn = BLOCK_HEAD (bb), in_libcall_block = 0; + insn && insn != NEXT_INSN (BLOCK_END (bb)); insn = NEXT_INSN (insn)) { if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') @@ -3243,8 +3243,8 @@ classic_gcse () start of the block]. */ reset_opr_set_tables (); - for (insn = basic_block_head[bb]; - insn != NULL && insn != NEXT_INSN (basic_block_end[bb]); + for (insn = BLOCK_HEAD (bb); + insn != NULL && insn != NEXT_INSN (BLOCK_END (bb)); insn = NEXT_INSN (insn)) { /* Is insn of form (set (pseudo-reg) ...)? */ @@ -3829,8 +3829,8 @@ cprop () start of the block]. */ reset_opr_set_tables (); - for (insn = basic_block_head[bb]; - insn != NULL && insn != NEXT_INSN (basic_block_end[bb]); + for (insn = BLOCK_HEAD (bb); + insn != NULL && insn != NEXT_INSN (BLOCK_END (bb)); insn = NEXT_INSN (insn)) { if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') diff --git a/gcc/global.c b/gcc/global.c index 063de9a9e004..a3c043b95eea 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -680,7 +680,7 @@ global_conflicts () #endif } - insn = basic_block_head[b]; + insn = BLOCK_HEAD (b); /* Scan the code of this basic block, noting which allocnos and hard regs are born or die. When one is born, @@ -777,7 +777,7 @@ global_conflicts () mark_reg_death (regs_set[n_regs_set]); } - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; insn = NEXT_INSN (insn); } @@ -1667,7 +1667,7 @@ build_insn_chain (first) { struct insn_chain *c; - if (first == basic_block_head[b]) + if (first == BLOCK_HEAD (b)) { int i; CLEAR_REG_SET (live_relevant_regs); @@ -1727,7 +1727,7 @@ build_insn_chain (first) } } - if (first == basic_block_end[b]) + if (first == BLOCK_END (b)) b++; /* Stop after we pass the end of the last basic block. Verify that diff --git a/gcc/graph.c b/gcc/graph.c index a60cd42db430..4de3829809e6 100644 --- a/gcc/graph.c +++ b/gcc/graph.c @@ -292,14 +292,14 @@ print_rtl_graph_with_bb (base, suffix, rtx_first) for (i = n_basic_blocks - 1; i >= 0; --i) { rtx x; - start[INSN_UID (basic_block_head[i])] = i; - end[INSN_UID (basic_block_end[i])] = i; - for (x = basic_block_head[i]; x != NULL_RTX; x = NEXT_INSN (x)) + start[INSN_UID (BLOCK_HEAD (i))] = i; + end[INSN_UID (BLOCK_END (i))] = i; + for (x = BLOCK_HEAD (i); x != NULL_RTX; x = NEXT_INSN (x)) { in_bb_p[INSN_UID (x)] = (in_bb_p[INSN_UID (x)] == NOT_IN_BB) ? IN_ONE_BB : IN_MULTIPLE_BB; - if (x == basic_block_end[i]) + if (x == BLOCK_END (i)) break; } } diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index ea0439072623..bf1d3cb090a0 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -136,8 +136,8 @@ This pass must update information that subsequent passes expect to be correct. Namely: reg_n_refs, reg_n_sets, reg_n_deaths, - reg_n_calls_crossed, and reg_live_length. Also, basic_block_head, - basic_block_end. + reg_n_calls_crossed, and reg_live_length. Also, BLOCK_HEAD, + BLOCK_END. The information in the line number notes is carefully retained by this pass. Notes that refer to the starting and ending of @@ -1101,7 +1101,7 @@ is_cfg_nonregular () the cfg not well structured. */ /* check for labels referred to other thn by jumps */ for (b = 0; b < n_basic_blocks; b++) - for (insn = basic_block_head[b];; insn = NEXT_INSN (insn)) + for (insn = BLOCK_HEAD (b);; insn = NEXT_INSN (insn)) { code = GET_CODE (insn); if (GET_RTX_CLASS (code) == 'i') @@ -1113,7 +1113,7 @@ is_cfg_nonregular () return 1; } - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; } @@ -1406,8 +1406,8 @@ too_large (block, num_bbs, num_insns) int block, *num_bbs, *num_insns; { (*num_bbs)++; - (*num_insns) += (INSN_LUID (basic_block_end[block]) - - INSN_LUID (basic_block_head[block])); + (*num_insns) += (INSN_LUID (BLOCK_END (block)) - + INSN_LUID (BLOCK_HEAD (block))); if ((*num_bbs > MAX_RGN_BLOCKS) || (*num_insns > MAX_RGN_INSNS)) return 1; else @@ -1683,8 +1683,8 @@ find_rgns (s_preds, s_succs, num_preds, num_succs, dom) /* Estimate # insns, and count # blocks in the region. */ num_bbs = 1; - num_insns = (INSN_LUID (basic_block_end[i]) - - INSN_LUID (basic_block_head[i])); + num_insns = (INSN_LUID (BLOCK_END (i)) + - INSN_LUID (BLOCK_HEAD (i))); /* Find all loop latches (blocks which back edges to the loop @@ -4840,8 +4840,8 @@ get_block_head_tail (bb, headp, tailp) b = BB_TO_BLOCK (bb); /* HEAD and TAIL delimit the basic block being scheduled. */ - head = basic_block_head[b]; - tail = basic_block_end[b]; + head = BLOCK_HEAD (b); + tail = BLOCK_END (b); /* Don't include any notes or labels at the beginning of the basic block, or notes at the ends of basic blocks. */ @@ -4922,7 +4922,7 @@ save_line_notes (bb) get_block_head_tail (bb, &head, &tail); next_tail = NEXT_INSN (tail); - for (insn = basic_block_head[BB_TO_BLOCK (bb)]; + for (insn = BLOCK_HEAD (BB_TO_BLOCK (bb)); insn != next_tail; insn = NEXT_INSN (insn)) if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0) @@ -4945,8 +4945,8 @@ restore_line_notes (bb) b = BB_TO_BLOCK (bb); - head = basic_block_head[b]; - next_tail = NEXT_INSN (basic_block_end[b]); + head = BLOCK_HEAD (b); + next_tail = NEXT_INSN (BLOCK_END (b)); /* Determine the current line-number. We want to know the current line number of the first insn of the block here, in case it is @@ -6683,8 +6683,7 @@ schedule_block (bb, rgn_n_insns) fprintf (dump, ";; ======================================================\n"); fprintf (dump, ";; -- basic block %d from %d to %d -- %s reload\n", - b, INSN_UID (basic_block_head[b]), - INSN_UID (basic_block_end[b]), + b, INSN_UID (BLOCK_HEAD (b)), INSN_UID (BLOCK_END (b)), (reload_completed ? "after" : "before")); fprintf (dump, ";; ======================================================\n"); fprintf (dump, "\n"); @@ -6821,9 +6820,9 @@ schedule_block (bb, rgn_n_insns) last = prev_head; /* Initialize INSN_QUEUE, LIST and NEW_NEEDS. */ - new_needs = (NEXT_INSN (prev_head) == basic_block_head[b] + new_needs = (NEXT_INSN (prev_head) == BLOCK_HEAD (b) ? NEED_HEAD : NEED_NOTHING); - if (PREV_INSN (next_tail) == basic_block_end[b]) + if (PREV_INSN (next_tail) == BLOCK_END (b)) new_needs |= NEED_TAIL; /* loop until all the insns in BB are scheduled. */ @@ -6907,29 +6906,29 @@ schedule_block (bb, rgn_n_insns) /* Update source block boundaries. */ b1 = INSN_BLOCK (temp); - if (temp == basic_block_head[b1] - && insn == basic_block_end[b1]) + if (temp == BLOCK_HEAD (b1) + && insn == BLOCK_END (b1)) { /* We moved all the insns in the basic block. Emit a note after the last insn and update the begin/end boundaries to point to the note. */ emit_note_after (NOTE_INSN_DELETED, insn); - basic_block_end[b1] = NEXT_INSN (insn); - basic_block_head[b1] = NEXT_INSN (insn); + BLOCK_END (b1) = NEXT_INSN (insn); + BLOCK_HEAD (b1) = NEXT_INSN (insn); } - else if (insn == basic_block_end[b1]) + else if (insn == BLOCK_END (b1)) { /* We took insns from the end of the basic block, so update the end of block boundary so that it points to the first insn we did not move. */ - basic_block_end[b1] = PREV_INSN (temp); + BLOCK_END (b1) = PREV_INSN (temp); } - else if (temp == basic_block_head[b1]) + else if (temp == BLOCK_HEAD (b1)) { /* We took insns from the start of the basic block, so update the start of block boundary so that it points to the first insn we did not move. */ - basic_block_head[b1] = NEXT_INSN (insn); + BLOCK_HEAD (b1) = NEXT_INSN (insn); } } else @@ -7005,18 +7004,18 @@ schedule_block (bb, rgn_n_insns) /* update target block boundaries. */ if (new_needs & NEED_HEAD) - basic_block_head[b] = head; + BLOCK_HEAD (b) = head; if (new_needs & NEED_TAIL) - basic_block_end[b] = tail; + BLOCK_END (b) = tail; /* debugging */ if (sched_verbose) { fprintf (dump, ";; total time = %d\n;; new basic block head = %d\n", - clock_var, INSN_UID (basic_block_head[b])); + clock_var, INSN_UID (BLOCK_HEAD (b))); fprintf (dump, ";; new basic block end = %d\n\n", - INSN_UID (basic_block_end[b])); + INSN_UID (BLOCK_END (b))); } return (sched_n_insns); @@ -8418,7 +8417,7 @@ split_block_insns (b) { rtx insn, next; - for (insn = basic_block_head[b];; insn = next) + for (insn = BLOCK_HEAD (b);; insn = next) { rtx set, last, first, notes; @@ -8427,7 +8426,7 @@ split_block_insns (b) next = NEXT_INSN (insn); if (GET_CODE (insn) != INSN) { - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; continue; @@ -8439,7 +8438,7 @@ split_block_insns (b) set = single_set (insn); if (set && rtx_equal_p (SET_SRC (set), SET_DEST (set))) { - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; /* Nops get in the way while scheduling, so delete them now if @@ -8469,16 +8468,16 @@ split_block_insns (b) PUT_CODE (insn, NOTE); NOTE_SOURCE_FILE (insn) = 0; NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; - if (insn == basic_block_head[b]) - basic_block_head[b] = first; - if (insn == basic_block_end[b]) + if (insn == BLOCK_HEAD (b)) + BLOCK_HEAD (b) = first; + if (insn == BLOCK_END (b)) { - basic_block_end[b] = last; + BLOCK_END (b) = last; break; } } - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; } } @@ -8554,12 +8553,12 @@ schedule_insns (dump_file) luid = 0; for (b = 0; b < n_basic_blocks; b++) - for (insn = basic_block_head[b];; insn = NEXT_INSN (insn)) + for (insn = BLOCK_HEAD (b);; insn = NEXT_INSN (insn)) { INSN_BLOCK (insn) = b; INSN_LUID (insn) = luid++; - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; } @@ -8570,7 +8569,7 @@ schedule_insns (dump_file) rtx insn; for (b = 0; b < n_basic_blocks; b++) - for (insn = basic_block_head[b];; insn = NEXT_INSN (insn)) + for (insn = BLOCK_HEAD (b);; insn = NEXT_INSN (insn)) { rtx link, prev; @@ -8592,7 +8591,7 @@ schedule_insns (dump_file) } } - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; } } @@ -8725,7 +8724,7 @@ schedule_insns (dump_file) determine the correct line number for the first insn of the block. */ for (b = 0; b < n_basic_blocks; b++) - for (line = basic_block_head[b]; line; line = PREV_INSN (line)) + for (line = BLOCK_HEAD (b); line; line = PREV_INSN (line)) if (GET_CODE (line) == NOTE && NOTE_LINE_NUMBER (line) > 0) { line_note_head[b] = line; @@ -8752,15 +8751,15 @@ schedule_insns (dump_file) /* ??? Add a NOTE after the last insn of the last basic block. It is not known why this is done. */ - insn = basic_block_end[n_basic_blocks - 1]; + insn = BLOCK_END (n_basic_blocks - 1); if (NEXT_INSN (insn) == 0 || (GET_CODE (insn) != NOTE && GET_CODE (insn) != CODE_LABEL - /* Don't emit a NOTE if it would end up between an unconditional - jump and a BARRIER. */ + /* Don't emit a NOTE if it would end up between an unconditional + jump and a BARRIER. */ && !(GET_CODE (insn) == JUMP_INSN && GET_CODE (NEXT_INSN (insn)) == BARRIER))) - emit_note_after (NOTE_INSN_DELETED, basic_block_end[n_basic_blocks - 1]); + emit_note_after (NOTE_INSN_DELETED, BLOCK_END (n_basic_blocks - 1)); /* Schedule every region in the subroutine */ for (rgn = 0; rgn < nr_regions; rgn++) diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 0c7e2480eddc..660efce62c6f 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -888,7 +888,7 @@ update_equiv_regs () /* Keep track of which basic block we are in. */ if (block + 1 < n_basic_blocks - && basic_block_head[block + 1] == insn) + && BLOCK_HEAD (block + 1) == insn) ++block; if (GET_RTX_CLASS (GET_CODE (insn)) != 'i') @@ -962,8 +962,8 @@ update_equiv_regs () REG_N_CALLS_CROSSED (regno) = 0; REG_LIVE_LENGTH (regno) = 2; - if (block >= 0 && insn == basic_block_head[block]) - basic_block_head[block] = PREV_INSN (insn); + if (block >= 0 && insn == BLOCK_HEAD (block)) + BLOCK_HEAD (block) = PREV_INSN (insn); for (l = 0; l < n_basic_blocks; l++) CLEAR_REGNO_REG_SET (basic_block_live_at_start[l], regno); @@ -1020,13 +1020,13 @@ block_alloc (b) /* Count the instructions in the basic block. */ - insn = basic_block_end[b]; + insn = BLOCK_END (b); while (1) { if (GET_CODE (insn) != NOTE) if (++insn_count > max_uid) abort (); - if (insn == basic_block_head[b]) + if (insn == BLOCK_HEAD (b)) break; insn = PREV_INSN (insn); } @@ -1045,7 +1045,7 @@ block_alloc (b) and assigns quantities to registers. It computes which registers to tie. */ - insn = basic_block_head[b]; + insn = BLOCK_HEAD (b); while (1) { register rtx body = PATTERN (insn); @@ -1283,7 +1283,7 @@ block_alloc (b) IOR_HARD_REG_SET (regs_live_at[2 * insn_number], regs_live); IOR_HARD_REG_SET (regs_live_at[2 * insn_number + 1], regs_live); - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; insn = NEXT_INSN (insn); diff --git a/gcc/regclass.c b/gcc/regclass.c index 489f8240407d..623dd98784d0 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -868,8 +868,8 @@ scan_one_insn (insn, pass) { int b; for (b = 0; b < n_basic_blocks; b++) - if (insn == basic_block_head[b]) - basic_block_head[b] = newinsn; + if (insn == BLOCK_HEAD (b)) + BLOCK_HEAD (b) = newinsn; } /* This makes one more setting of new insns's dest. */ diff --git a/gcc/regmove.c b/gcc/regmove.c index 11709d606a42..843f10e605f4 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -673,7 +673,7 @@ copy_src_to_dest (insn, src, dest, loop_depth) bb = regmove_bb_head[insn_uid]; if (bb >= 0) { - basic_block_head[bb] = move_insn; + BLOCK_HEAD (bb) = move_insn; regmove_bb_head[insn_uid] = -1; } @@ -936,7 +936,7 @@ regmove_optimize (f, nregs, regmove_dump_file) regmove_bb_head = (int *)alloca (sizeof (int) * (old_max_uid + 1)); for (i = old_max_uid; i >= 0; i--) regmove_bb_head[i] = -1; for (i = 0; i < n_basic_blocks; i++) - regmove_bb_head[INSN_UID (basic_block_head[i])] = i; + regmove_bb_head[INSN_UID (BLOCK_HEAD (i))] = i; /* A forward/backward pass. Replace output operands with input operands. */ @@ -1390,13 +1390,13 @@ regmove_optimize (f, nregs, regmove_dump_file) ends. Fix that here. */ for (i = 0; i < n_basic_blocks; i++) { - rtx end = basic_block_end[i]; + rtx end = BLOCK_END (i); rtx new = end; rtx next = NEXT_INSN (new); while (next != 0 && INSN_UID (next) >= old_max_uid - && (i == n_basic_blocks - 1 || basic_block_head[i + 1] != next)) + && (i == n_basic_blocks - 1 || BLOCK_HEAD (i + 1) != next)) new = next, next = NEXT_INSN (new); - basic_block_end[i] = new; + BLOCK_END (i) = new; } } diff --git a/gcc/reload1.c b/gcc/reload1.c index 3e5f898d5a7f..fbb506cb4e4c 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -2039,10 +2039,10 @@ delete_caller_save_insns () struct insn_chain *next = c->next; rtx insn = c->insn; - if (insn == basic_block_head[c->block]) - basic_block_head[c->block] = NEXT_INSN (insn); - if (insn == basic_block_end[c->block]) - basic_block_end[c->block] = PREV_INSN (insn); + if (insn == BLOCK_HEAD (c->block)) + BLOCK_HEAD (c->block) = NEXT_INSN (insn); + if (insn == BLOCK_END (c->block)) + BLOCK_END (c->block) = PREV_INSN (insn); if (c == reload_insn_chain) reload_insn_chain = next; @@ -7308,10 +7308,10 @@ emit_reload_insns (chain) /* Keep basic block info up to date. */ if (n_basic_blocks) { - if (basic_block_head[chain->block] == insn) - basic_block_head[chain->block] = NEXT_INSN (before_insn); - if (basic_block_end[chain->block] == insn) - basic_block_end[chain->block] = PREV_INSN (following_insn); + if (BLOCK_HEAD (chain->block) == insn) + BLOCK_HEAD (chain->block) = NEXT_INSN (before_insn); + if (BLOCK_END (chain->block) == insn) + BLOCK_END (chain->block) = PREV_INSN (following_insn); } /* For all the spill regs newly reloaded in this instruction, @@ -9464,7 +9464,7 @@ reload_combine () CLEAR_HARD_REG_SET (ever_live_at_start); for (i = n_basic_blocks - 1; i >= 0; i--) { - insn = basic_block_head[i]; + insn = BLOCK_HEAD (i); if (GET_CODE (insn) == CODE_LABEL) { HARD_REG_SET live; diff --git a/gcc/reorg.c b/gcc/reorg.c index 375d4f872135..d0abf37f2c9e 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -2349,7 +2349,7 @@ find_basic_block (insn) insn = next_nonnote_insn (insn)) { for (i = 0; i < n_basic_blocks; i++) - if (insn == basic_block_head[i]) + if (insn == BLOCK_HEAD (i)) return i; } @@ -2818,7 +2818,7 @@ mark_target_live_regs (target, res) we can get it from there unless the insn at the start of the basic block has been deleted. */ if (tinfo && tinfo->block != -1 - && ! INSN_DELETED_P (basic_block_head[tinfo->block])) + && ! INSN_DELETED_P (BLOCK_HEAD (tinfo->block))) b = tinfo->block; if (b == -1) @@ -2876,7 +2876,7 @@ mark_target_live_regs (target, res) /* Get starting and ending insn, handling the case where each might be a SEQUENCE. */ - start_insn = (b == 0 ? get_insns () : basic_block_head[b]); + start_insn = (b == 0 ? get_insns () : BLOCK_HEAD (b)); stop_insn = target; if (GET_CODE (start_insn) == INSN diff --git a/gcc/sched.c b/gcc/sched.c index e27f70e28eaa..50684b0cf13a 100644 --- a/gcc/sched.c +++ b/gcc/sched.c @@ -108,8 +108,8 @@ Boston, MA 02111-1307, USA. */ This pass must update information that subsequent passes expect to be correct. Namely: reg_n_refs, reg_n_sets, reg_n_deaths, - reg_n_calls_crossed, and reg_live_length. Also, basic_block_head, - basic_block_end. + reg_n_calls_crossed, and reg_live_length. Also, BLOCK_HEAD, + BLOCK_END. The information in the line number notes is carefully retained by this pass. Notes that refer to the starting and ending of @@ -2616,8 +2616,8 @@ schedule_block (b, file) int new_needs; /* HEAD and TAIL delimit the region being scheduled. */ - rtx head = basic_block_head[b]; - rtx tail = basic_block_end[b]; + rtx head = BLOCK_HEAD (b); + rtx tail = BLOCK_END (b); /* PREV_HEAD and NEXT_TAIL are the boundaries of the insns being scheduled. When the insns have been ordered, these insns delimit where the new insns are to be @@ -2631,7 +2631,7 @@ schedule_block (b, file) if (file) fprintf (file, ";;\t -- basic block number %d from %d to %d --\n", - b, INSN_UID (basic_block_head[b]), INSN_UID (basic_block_end[b])); + b, INSN_UID (BLOCK_HEAD (b)), INSN_UID (BLOCK_END (b))); i = max_reg_num (); reg_last_uses = (rtx *) alloca (i * sizeof (rtx)); @@ -2893,7 +2893,7 @@ schedule_block (b, file) /* We don't want to remove any REG_DEAD notes as the code below does. */ - for (insn = basic_block_head[b]; insn != head; + for (insn = BLOCK_HEAD (b); insn != head; insn = NEXT_INSN (insn)) if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') { @@ -2977,7 +2977,7 @@ schedule_block (b, file) block may have changed the current line number. */ rtx line = line_note_head[b]; - for (insn = basic_block_head[b]; + for (insn = BLOCK_HEAD (b); insn != next_tail; insn = NEXT_INSN (insn)) if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0) @@ -3141,9 +3141,9 @@ schedule_block (b, file) /* Where we start inserting insns is after TAIL. */ last = next_tail; - new_needs = (NEXT_INSN (prev_head) == basic_block_head[b] + new_needs = (NEXT_INSN (prev_head) == BLOCK_HEAD (b) ? NEED_HEAD : NEED_NOTHING); - if (PREV_INSN (next_tail) == basic_block_end[b]) + if (PREV_INSN (next_tail) == BLOCK_END (b)) new_needs |= NEED_TAIL; new_ready = n_ready; @@ -3450,12 +3450,12 @@ schedule_block (b, file) #endif if (new_needs & NEED_HEAD) - basic_block_head[b] = head; + BLOCK_HEAD (b) = head; PREV_INSN (head) = prev_head; NEXT_INSN (prev_head) = head; if (new_needs & NEED_TAIL) - basic_block_end[b] = tail; + BLOCK_END (b) = tail; NEXT_INSN (tail) = next_tail; PREV_INSN (next_tail) = tail; @@ -3465,8 +3465,8 @@ schedule_block (b, file) rtx line, note, prev, new; int notes = 0; - head = basic_block_head[b]; - next_tail = NEXT_INSN (basic_block_end[b]); + head = BLOCK_HEAD (b); + next_tail = NEXT_INSN (BLOCK_END (b)); /* Determine the current line-number. We want to know the current line number of the first insn of the block here, in case it is @@ -3520,7 +3520,7 @@ schedule_block (b, file) if (file) { fprintf (file, ";; total time = %d\n;; new basic block head = %d\n;; new basic block end = %d\n\n", - clock, INSN_UID (basic_block_head[b]), INSN_UID (basic_block_end[b])); + clock, INSN_UID (BLOCK_HEAD (b)), INSN_UID (BLOCK_END (b))); } /* Yow! We're done! */ @@ -4327,7 +4327,7 @@ schedule_insns (dump_file) determine the correct line number for the first insn of the block. */ for (b = 0; b < n_basic_blocks; b++) - for (line = basic_block_head[b]; line; line = PREV_INSN (line)) + for (line = BLOCK_HEAD (b); line; line = PREV_INSN (line)) if (GET_CODE (line) == NOTE && NOTE_LINE_NUMBER (line) > 0) { line_note_head[b] = line; @@ -4350,7 +4350,7 @@ schedule_insns (dump_file) /* ??? Perhaps it's done to ensure NEXT_TAIL in schedule_block is a valid insn. */ - insn = basic_block_end[n_basic_blocks-1]; + insn = BLOCK_END (n_basic_blocks-1); if (NEXT_INSN (insn) == 0 || (GET_CODE (insn) != NOTE && GET_CODE (insn) != CODE_LABEL @@ -4358,7 +4358,7 @@ schedule_insns (dump_file) jump and a BARRIER. */ && ! (GET_CODE (insn) == JUMP_INSN && GET_CODE (NEXT_INSN (insn)) == BARRIER))) - emit_note_after (NOTE_INSN_DELETED, basic_block_end[n_basic_blocks-1]); + emit_note_after (NOTE_INSN_DELETED, BLOCK_END (n_basic_blocks-1)); for (b = 0; b < n_basic_blocks; b++) { @@ -4366,7 +4366,7 @@ schedule_insns (dump_file) note_list = 0; - for (insn = basic_block_head[b]; ; insn = next) + for (insn = BLOCK_HEAD (b); ; insn = next) { rtx prev; rtx set; @@ -4376,7 +4376,7 @@ schedule_insns (dump_file) next = NEXT_INSN (insn); if (GET_CODE (insn) != INSN) { - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; continue; @@ -4388,7 +4388,7 @@ schedule_insns (dump_file) set = single_set (insn); if (set && rtx_equal_p (SET_SRC (set), SET_DEST (set))) { - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; /* Nops get in the way while scheduling, so delete them now if @@ -4425,17 +4425,17 @@ schedule_insns (dump_file) PUT_CODE (insn, NOTE); NOTE_SOURCE_FILE (insn) = 0; NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; - if (insn == basic_block_head[b]) - basic_block_head[b] = first; - if (insn == basic_block_end[b]) + if (insn == BLOCK_HEAD (b)) + BLOCK_HEAD (b) = first; + if (insn == BLOCK_END (b)) { - basic_block_end[b] = last; + BLOCK_END (b) = last; break; } } } - if (insn == basic_block_end[b]) + if (insn == BLOCK_END (b)) break; } -- 2.43.5