diff options
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cfg.c | 4 | ||||
-rw-r--r-- | gcc/cfgbuild.c | 68 | ||||
-rw-r--r-- | gcc/cfgcleanup.c | 126 | ||||
-rw-r--r-- | gcc/cfglayout.c | 34 | ||||
-rw-r--r-- | gcc/cfgloop.c | 6 | ||||
-rw-r--r-- | gcc/cfgrtl.c | 38 |
7 files changed, 147 insertions, 138 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f6fc7d9..dbdb2f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-05-21 Kazu Hirata <kazu@cs.umass.edu> + + * cfgbuild.c: Fix formatting. + * cfg.c: Likewise. + * cfgcleanup.c: Likewise. + * cfglayout.c: Likewise. + * cfgloop.c: Likewise. + * cfgrtl.c: Likewise. + 2002-05-21 Richard Henderson <rth@redhat.com> * c-common.h (enum rid): Add RID_THREAD. @@ -234,7 +234,7 @@ link_block (b, after) after->next_bb = b; b->next_bb->prev_bb = b; } - + /* Unlink block B from chain. */ void unlink_block (b) @@ -243,7 +243,7 @@ unlink_block (b) b->next_bb->prev_bb = b->prev_bb; b->prev_bb->next_bb = b->next_bb; } - + /* Remove block B from the basic block array and compact behind it. */ diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c index ce7c307..0451a34 100644 --- a/gcc/cfgbuild.c +++ b/gcc/cfgbuild.c @@ -104,35 +104,35 @@ control_flow_insn_p (insn) switch (GET_CODE (insn)) { - case NOTE: - case CODE_LABEL: - return false; - - case JUMP_INSN: - /* Jump insn always causes control transfer except for tablejumps. */ - return (GET_CODE (PATTERN (insn)) != ADDR_VEC - && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC); - - case CALL_INSN: - /* Call insn may return to the nonlocal goto handler. */ - return ((nonlocal_goto_handler_labels - && (0 == (note = find_reg_note (insn, REG_EH_REGION, - NULL_RTX)) - || INTVAL (XEXP (note, 0)) >= 0)) - /* Or may trap. */ - || can_throw_internal (insn)); - - case INSN: - return (flag_non_call_exceptions && can_throw_internal (insn)); - - case BARRIER: - /* It is nonsence to reach barrier when looking for the - end of basic block, but before dead code is eliminated - this may happen. */ - return false; - - default: - abort (); + case NOTE: + case CODE_LABEL: + return false; + + case JUMP_INSN: + /* Jump insn always causes control transfer except for tablejumps. */ + return (GET_CODE (PATTERN (insn)) != ADDR_VEC + && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC); + + case CALL_INSN: + /* Call insn may return to the nonlocal goto handler. */ + return ((nonlocal_goto_handler_labels + && (0 == (note = find_reg_note (insn, REG_EH_REGION, + NULL_RTX)) + || INTVAL (XEXP (note, 0)) >= 0)) + /* Or may trap. */ + || can_throw_internal (insn)); + + case INSN: + return (flag_non_call_exceptions && can_throw_internal (insn)); + + case BARRIER: + /* It is nonsence to reach barrier when looking for the + end of basic block, but before dead code is eliminated + this may happen. */ + return false; + + default: + abort (); } } @@ -207,9 +207,9 @@ find_label_refs (f, lvl) rtx lab = XEXP (note, 0), next; if ((next = next_nonnote_insn (lab)) != NULL - && GET_CODE (next) == JUMP_INSN - && (GET_CODE (PATTERN (next)) == ADDR_VEC - || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC)) + && GET_CODE (next) == JUMP_INSN + && (GET_CODE (PATTERN (next)) == ADDR_VEC + || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC)) ; else if (GET_CODE (lab) == NOTE) ; @@ -305,7 +305,7 @@ make_edges (label_value_list, min, max, update_p) for (e = BASIC_BLOCK (i)->succ; e ; e = e->succ_next) if (e->dest != EXIT_BLOCK_PTR) - SET_BIT (edge_cache[i], e->dest->index); + SET_BIT (edge_cache[i], e->dest->index); } } @@ -849,7 +849,7 @@ find_many_sub_basic_blocks (blocks) void find_sub_basic_blocks (bb) - basic_block bb; + basic_block bb; { int i; int min, max; diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 070c1c7..d5f6de1 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -190,8 +190,8 @@ try_simplify_condjump (cbranch_block) static bool mark_effect (exp, nonequal) - rtx exp; - regset nonequal; + rtx exp; + regset nonequal; { int regno; rtx dest; @@ -199,41 +199,41 @@ mark_effect (exp, nonequal) { /* In case we do clobber the register, mark it as equal, as we know the value is dead so it don't have to match. */ - case CLOBBER: - if (REG_P (XEXP (exp, 0))) - { - dest = XEXP (exp, 0); - regno = REGNO (dest); - CLEAR_REGNO_REG_SET (nonequal, regno); - if (regno < FIRST_PSEUDO_REGISTER) - { - int n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); - while (--n > 0) - CLEAR_REGNO_REG_SET (nonequal, regno + n); - } - } - return false; + case CLOBBER: + if (REG_P (XEXP (exp, 0))) + { + dest = XEXP (exp, 0); + regno = REGNO (dest); + CLEAR_REGNO_REG_SET (nonequal, regno); + if (regno < FIRST_PSEUDO_REGISTER) + { + int n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); + while (--n > 0) + CLEAR_REGNO_REG_SET (nonequal, regno + n); + } + } + return false; - case SET: - if (rtx_equal_for_cselib_p (SET_DEST (exp), SET_SRC (exp))) - return false; - dest = SET_DEST (exp); - if (dest == pc_rtx) - return false; - if (!REG_P (dest)) - return true; - regno = REGNO (dest); - SET_REGNO_REG_SET (nonequal, regno); - if (regno < FIRST_PSEUDO_REGISTER) - { - int n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); - while (--n > 0) - SET_REGNO_REG_SET (nonequal, regno + n); - } + case SET: + if (rtx_equal_for_cselib_p (SET_DEST (exp), SET_SRC (exp))) return false; - - default: + dest = SET_DEST (exp); + if (dest == pc_rtx) return false; + if (!REG_P (dest)) + return true; + regno = REGNO (dest); + SET_REGNO_REG_SET (nonequal, regno); + if (regno < FIRST_PSEUDO_REGISTER) + { + int n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); + while (--n > 0) + SET_REGNO_REG_SET (nonequal, regno + n); + } + return false; + + default: + return false; } } @@ -295,7 +295,7 @@ thread_jump (mode, e, b) /* Second branch must end with onlyjump, as we will eliminate the jump. */ if (!any_condjump_p (e->src->end)) return NULL; - + if (!any_condjump_p (b->end) || !onlyjump_p (b->end)) { BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK); @@ -357,22 +357,22 @@ thread_jump (mode, e, b) for (insn = NEXT_INSN (b->head); insn != NEXT_INSN (b->end) && !failed; insn = NEXT_INSN (insn)) - { - if (INSN_P (insn)) - { - rtx pat = PATTERN (insn); - - if (GET_CODE (pat) == PARALLEL) - { - for (i = 0; i < XVECLEN (pat, 0); i++) - failed |= mark_effect (XVECEXP (pat, 0, i), nonequal); - } - else - failed |= mark_effect (pat, nonequal); - } + { + if (INSN_P (insn)) + { + rtx pat = PATTERN (insn); + + if (GET_CODE (pat) == PARALLEL) + { + for (i = 0; i < XVECLEN (pat, 0); i++) + failed |= mark_effect (XVECEXP (pat, 0, i), nonequal); + } + else + failed |= mark_effect (pat, nonequal); + } - cselib_process_insn (insn); - } + cselib_process_insn (insn); + } /* Later we should clear nonequal of dead registers. So far we don't have life information in cfg_cleanup. */ @@ -504,7 +504,7 @@ try_forward_edges (mode, b) if (mode & CLEANUP_PRE_LOOP) { rtx insn = (target->succ->flags & EDGE_FALLTHRU - ? target->head : prev_nonnote_insn (target->end)); + ? target->head : prev_nonnote_insn (target->end)); if (GET_CODE (insn) != NOTE) insn = NEXT_INSN (insn); @@ -522,7 +522,7 @@ try_forward_edges (mode, b) counter++; target = new_target; threaded |= new_target_threaded; - } + } if (counter >= n_basic_blocks) { @@ -545,7 +545,7 @@ try_forward_edges (mode, b) { notice_new_block (redirect_edge_and_branch_force (e, target)); if (rtl_dump_file) - fprintf (rtl_dump_file, "Conditionals threaded.\n"); + fprintf (rtl_dump_file, "Conditionals threaded.\n"); } else if (!redirect_edge_and_branch (e, target)) { @@ -614,7 +614,7 @@ try_forward_edges (mode, b) && first == threaded_edges [n]->src) n++; t = first->succ; - } + } t->count -= edge_count; if (t->count < 0) @@ -812,7 +812,7 @@ merge_blocks (e, b, c, mode) if (rtl_dump_file) fprintf (rtl_dump_file, "Merged %d and %d without moving.\n", - b_index, c_index); + b_index, c_index); return true; } @@ -886,8 +886,8 @@ merge_blocks (e, b, c, mode) static bool insns_match_p (mode, i1, i2) - int mode ATTRIBUTE_UNUSED; - rtx i1, i2; + int mode ATTRIBUTE_UNUSED; + rtx i1, i2; { rtx p1, p2; @@ -1057,10 +1057,10 @@ flow_find_cross_jump (mode, bb1, bb2, f1, f2) remove_note (i1, equiv1); remove_note (i2, equiv2); } - + afterlast1 = last1, afterlast2 = last2; last1 = i1, last2 = i2; - ninsns++; + ninsns++; } i1 = PREV_INSN (i1); @@ -1135,7 +1135,7 @@ outgoing_edges_match (mode, bb1, bb2) enum rtx_code code1, code2; if (!bb2->succ - || !bb2->succ->succ_next + || !bb2->succ->succ_next || bb2->succ->succ_next->succ_next || !any_condjump_p (bb2->end) || !onlyjump_p (bb2->end)) @@ -1284,9 +1284,9 @@ outgoing_edges_match (mode, bb1, bb2) if (fallthru1) { basic_block d1 = (forwarder_block_p (fallthru1->dest) - ? fallthru1->dest->succ->dest: fallthru1->dest); + ? fallthru1->dest->succ->dest: fallthru1->dest); basic_block d2 = (forwarder_block_p (fallthru2->dest) - ? fallthru2->dest->succ->dest: fallthru2->dest); + ? fallthru2->dest->succ->dest: fallthru2->dest); if (d1 != d2) return false; @@ -1759,7 +1759,7 @@ delete_unreachable_blocks () find_unreachable_blocks (); /* Delete all unreachable basic blocks. Do compaction concurrently, - as otherwise we can wind up with O(N^2) behaviour here when we + as otherwise we can wind up with O(N^2) behaviour here when we have oodles of dead code. */ for (i = j = 0; i < n_basic_blocks; ++i) diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index 05eb97e..6f62442 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -127,7 +127,7 @@ skip_insns_after_block (bb) last_insn = insn; continue; } - break; + break; default: break; @@ -137,7 +137,7 @@ skip_insns_after_block (bb) } /* It is possible to hit contradictory sequence. For instance: - + jump_insn NOTE_INSN_LOOP_BEG barrier @@ -152,14 +152,14 @@ skip_insns_after_block (bb) if (GET_CODE (insn) == NOTE) switch (NOTE_LINE_NUMBER (insn)) { - case NOTE_INSN_LOOP_END: - case NOTE_INSN_BLOCK_END: - case NOTE_INSN_DELETED: - case NOTE_INSN_DELETED_LABEL: + case NOTE_INSN_LOOP_END: + case NOTE_INSN_BLOCK_END: + case NOTE_INSN_DELETED: + case NOTE_INSN_DELETED_LABEL: continue; - default: + default: reorder_insns (insn, insn, last_insn); - } + } } return last_insn; @@ -192,7 +192,7 @@ record_effective_endpoints () { rtx next_insn = get_insns (); int i; - + for (i = 0; i < n_basic_blocks; i++) { basic_block bb = BASIC_BLOCK (i); @@ -203,7 +203,7 @@ record_effective_endpoints () PREV_INSN (bb->head)); end = skip_insns_after_block (bb); if (NEXT_INSN (bb->end) && bb->end != end) - RBI (bb)->footer = unlink_insn_chain (NEXT_INSN (bb->end), end); + RBI (bb)->footer = unlink_insn_chain (NEXT_INSN (bb->end), end); next_insn = NEXT_INSN (bb->end); } @@ -461,7 +461,7 @@ fixup_reorder_chain () } } - /* Otherwise we can try to invert the jump. This will + /* Otherwise we can try to invert the jump. This will basically never fail, however, keep up the pretense. */ else if (invert_jump (bb_end_insn, label_for_bb (e_fall->dest), 0)) @@ -883,7 +883,7 @@ cfg_layout_duplicate_bb (bb, e) insn = duplicate_insn_chain (bb->head, bb->end); new_bb = create_basic_block (insn, - insn ? get_last_insn () : NULL, + insn ? get_last_insn () : NULL, EXIT_BLOCK_PTR->prev_bb); alloc_aux_for_block (new_bb, sizeof (struct reorder_block_def)); @@ -933,12 +933,12 @@ cfg_layout_duplicate_bb (bb, e) bb->count -= new_count; if (e) - { - new_bb->frequency = EDGE_FREQUENCY (e); - bb->frequency -= EDGE_FREQUENCY (e); + { + new_bb->frequency = EDGE_FREQUENCY (e); + bb->frequency -= EDGE_FREQUENCY (e); - cfg_layout_redirect_edge (e, new_bb); - } + cfg_layout_redirect_edge (e, new_bb); + } if (bb->count < 0) bb->count = 0; diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 2bd0d4c..ff89ef2 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -110,9 +110,9 @@ flow_loop_dump (loop, file, loop_dump_aux, verbose) if (loop->first->head && loop->last->end) fprintf (file, ";;\n;; Loop %d (%d to %d):%s%s\n", - loop->num, INSN_UID (loop->first->head), - INSN_UID (loop->last->end), - loop->shared ? " shared" : "", loop->invalid ? " invalid" : ""); + loop->num, INSN_UID (loop->first->head), + INSN_UID (loop->last->end), + loop->shared ? " shared" : "", loop->invalid ? " invalid" : ""); else fprintf (file, ";;\n;; Loop %d:%s%s\n", loop->num, loop->shared ? " shared" : "", loop->invalid ? " invalid" : ""); diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index d2025b8..781b26a 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -90,7 +90,7 @@ can_delete_note_p (note) { return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED || NOTE_LINE_NUMBER (note) == NOTE_INSN_BASIC_BLOCK - || NOTE_LINE_NUMBER (note) == NOTE_INSN_PREDICTION); + || NOTE_LINE_NUMBER (note) == NOTE_INSN_PREDICTION); } /* True if a given label can be deleted. */ @@ -119,7 +119,7 @@ delete_insn (insn) if (GET_CODE (insn) == CODE_LABEL) { /* Some labels can't be directly removed from the INSN chain, as they - might be references via variables, constant pool etc. + might be references via variables, constant pool etc. Convert them to the special NOTE_INSN_DELETED_LABEL note. */ if (! can_delete_label_p (insn)) { @@ -381,13 +381,13 @@ flow_delete_block_noexpunge (b) NOTE_INSN_EH_REGION_END notes. */ /* Get rid of all NOTE_INSN_PREDICTIONs hanging before the block. */ - + for (insn = PREV_INSN (b->head); insn; insn = PREV_INSN (insn)) { if (GET_CODE (insn) != NOTE) - break; + break; if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_PREDICTION) - NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; + NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; } insn = b->head; @@ -434,7 +434,7 @@ flow_delete_block (b) basic_block b; { int deleted_handler = flow_delete_block_noexpunge (b); - + /* Remove the basic block from the array, and compact behind it. */ expunge_block (b); @@ -1371,8 +1371,8 @@ commit_one_edge_insertion (e, watch_calls) /* The first insn after the call may be a stack pop, skip it. */ while (next && keep_with_call_p (next)) - { - after = next; + { + after = next; next = next_nonnote_insn (next); } bb = e->dest; @@ -1833,17 +1833,17 @@ verify_flow_info () } } if (bb->count < 0) - { - error ("verify_flow_info: Wrong count of block %i %i", + { + error ("verify_flow_info: Wrong count of block %i %i", bb->index, (int)bb->count); - err = 1; - } + err = 1; + } if (bb->frequency < 0) - { - error ("verify_flow_info: Wrong frequency of block %i %i", + { + error ("verify_flow_info: Wrong frequency of block %i %i", bb->index, bb->frequency); - err = 1; - } + err = 1; + } for (e = bb->succ; e; e = e->succ_next) { if (last_visited [e->dest->index + 2] == bb) @@ -1971,7 +1971,7 @@ verify_flow_info () error ("Abnormal edges for no purpose in bb %i", bb->index); err = 1; } - + if (!n_fallthru) { rtx insn; @@ -2223,7 +2223,7 @@ purge_dead_edges (bb) /* Avoid abnormal flags to leak from computed jumps turned into simplejumps. */ - + e->flags &= ~EDGE_ABNORMAL; /* See if this edge is one we should keep. */ @@ -2265,7 +2265,7 @@ purge_dead_edges (bb) { bb->succ->probability = REG_BR_PROB_BASE; bb->succ->count = bb->count; - } + } else { note = find_reg_note (insn, REG_BR_PROB, NULL); |