cfgbuild.c: Fix formatting.

* cfgbuild.c: Fix formatting.
	* cfg.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgrtl.c: Likewise.

From-SVN: r53717
This commit is contained in:
Kazu Hirata 2002-05-22 01:27:34 +00:00 committed by Kazu Hirata
parent ec221d715c
commit f87c27b4ab
7 changed files with 141 additions and 132 deletions

View file

@ -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> 2002-05-21 Richard Henderson <rth@redhat.com>
* c-common.h (enum rid): Add RID_THREAD. * c-common.h (enum rid): Add RID_THREAD.

View file

@ -234,7 +234,7 @@ link_block (b, after)
after->next_bb = b; after->next_bb = b;
b->next_bb->prev_bb = b; b->next_bb->prev_bb = b;
} }
/* Unlink block B from chain. */ /* Unlink block B from chain. */
void void
unlink_block (b) unlink_block (b)
@ -243,7 +243,7 @@ unlink_block (b)
b->next_bb->prev_bb = b->prev_bb; b->next_bb->prev_bb = b->prev_bb;
b->prev_bb->next_bb = b->next_bb; b->prev_bb->next_bb = b->next_bb;
} }
/* Remove block B from the basic block array and compact behind it. */ /* Remove block B from the basic block array and compact behind it. */

View file

@ -104,35 +104,35 @@ control_flow_insn_p (insn)
switch (GET_CODE (insn)) switch (GET_CODE (insn))
{ {
case NOTE: case NOTE:
case CODE_LABEL: case CODE_LABEL:
return false; return false;
case JUMP_INSN: case JUMP_INSN:
/* Jump insn always causes control transfer except for tablejumps. */ /* Jump insn always causes control transfer except for tablejumps. */
return (GET_CODE (PATTERN (insn)) != ADDR_VEC return (GET_CODE (PATTERN (insn)) != ADDR_VEC
&& GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC); && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC);
case CALL_INSN: case CALL_INSN:
/* Call insn may return to the nonlocal goto handler. */ /* Call insn may return to the nonlocal goto handler. */
return ((nonlocal_goto_handler_labels return ((nonlocal_goto_handler_labels
&& (0 == (note = find_reg_note (insn, REG_EH_REGION, && (0 == (note = find_reg_note (insn, REG_EH_REGION,
NULL_RTX)) NULL_RTX))
|| INTVAL (XEXP (note, 0)) >= 0)) || INTVAL (XEXP (note, 0)) >= 0))
/* Or may trap. */ /* Or may trap. */
|| can_throw_internal (insn)); || can_throw_internal (insn));
case INSN: case INSN:
return (flag_non_call_exceptions && can_throw_internal (insn)); return (flag_non_call_exceptions && can_throw_internal (insn));
case BARRIER: case BARRIER:
/* It is nonsence to reach barrier when looking for the /* It is nonsence to reach barrier when looking for the
end of basic block, but before dead code is eliminated end of basic block, but before dead code is eliminated
this may happen. */ this may happen. */
return false; return false;
default: default:
abort (); abort ();
} }
} }
@ -207,9 +207,9 @@ find_label_refs (f, lvl)
rtx lab = XEXP (note, 0), next; rtx lab = XEXP (note, 0), next;
if ((next = next_nonnote_insn (lab)) != NULL if ((next = next_nonnote_insn (lab)) != NULL
&& GET_CODE (next) == JUMP_INSN && GET_CODE (next) == JUMP_INSN
&& (GET_CODE (PATTERN (next)) == ADDR_VEC && (GET_CODE (PATTERN (next)) == ADDR_VEC
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC)) || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
; ;
else if (GET_CODE (lab) == NOTE) 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) for (e = BASIC_BLOCK (i)->succ; e ; e = e->succ_next)
if (e->dest != EXIT_BLOCK_PTR) 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 void
find_sub_basic_blocks (bb) find_sub_basic_blocks (bb)
basic_block bb; basic_block bb;
{ {
int i; int i;
int min, max; int min, max;

View file

@ -190,8 +190,8 @@ try_simplify_condjump (cbranch_block)
static bool static bool
mark_effect (exp, nonequal) mark_effect (exp, nonequal)
rtx exp; rtx exp;
regset nonequal; regset nonequal;
{ {
int regno; int regno;
rtx dest; 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 /* 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. */ value is dead so it don't have to match. */
case CLOBBER: case CLOBBER:
if (REG_P (XEXP (exp, 0))) if (REG_P (XEXP (exp, 0)))
{ {
dest = XEXP (exp, 0); dest = XEXP (exp, 0);
regno = REGNO (dest); regno = REGNO (dest);
CLEAR_REGNO_REG_SET (nonequal, regno); CLEAR_REGNO_REG_SET (nonequal, regno);
if (regno < FIRST_PSEUDO_REGISTER) if (regno < FIRST_PSEUDO_REGISTER)
{ {
int n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); int n = HARD_REGNO_NREGS (regno, GET_MODE (dest));
while (--n > 0) while (--n > 0)
CLEAR_REGNO_REG_SET (nonequal, regno + n); CLEAR_REGNO_REG_SET (nonequal, regno + n);
} }
} }
return false; return false;
case SET: case SET:
if (rtx_equal_for_cselib_p (SET_DEST (exp), SET_SRC (exp))) 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);
}
return false; 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);
}
return false;
default: default:
return false; return false;
} }
} }
@ -295,7 +295,7 @@ thread_jump (mode, e, b)
/* Second branch must end with onlyjump, as we will eliminate the jump. */ /* Second branch must end with onlyjump, as we will eliminate the jump. */
if (!any_condjump_p (e->src->end)) if (!any_condjump_p (e->src->end))
return NULL; return NULL;
if (!any_condjump_p (b->end) || !onlyjump_p (b->end)) if (!any_condjump_p (b->end) || !onlyjump_p (b->end))
{ {
BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK); 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; for (insn = NEXT_INSN (b->head); insn != NEXT_INSN (b->end) && !failed;
insn = NEXT_INSN (insn)) insn = NEXT_INSN (insn))
{ {
if (INSN_P (insn)) if (INSN_P (insn))
{ {
rtx pat = PATTERN (insn); rtx pat = PATTERN (insn);
if (GET_CODE (pat) == PARALLEL) if (GET_CODE (pat) == PARALLEL)
{ {
for (i = 0; i < XVECLEN (pat, 0); i++) for (i = 0; i < XVECLEN (pat, 0); i++)
failed |= mark_effect (XVECEXP (pat, 0, i), nonequal); failed |= mark_effect (XVECEXP (pat, 0, i), nonequal);
} }
else else
failed |= mark_effect (pat, nonequal); 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 /* Later we should clear nonequal of dead registers. So far we don't
have life information in cfg_cleanup. */ have life information in cfg_cleanup. */
@ -504,7 +504,7 @@ try_forward_edges (mode, b)
if (mode & CLEANUP_PRE_LOOP) if (mode & CLEANUP_PRE_LOOP)
{ {
rtx insn = (target->succ->flags & EDGE_FALLTHRU 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) if (GET_CODE (insn) != NOTE)
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
@ -522,7 +522,7 @@ try_forward_edges (mode, b)
counter++; counter++;
target = new_target; target = new_target;
threaded |= new_target_threaded; threaded |= new_target_threaded;
} }
if (counter >= n_basic_blocks) if (counter >= n_basic_blocks)
{ {
@ -545,7 +545,7 @@ try_forward_edges (mode, b)
{ {
notice_new_block (redirect_edge_and_branch_force (e, target)); notice_new_block (redirect_edge_and_branch_force (e, target));
if (rtl_dump_file) 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)) else if (!redirect_edge_and_branch (e, target))
{ {
@ -614,7 +614,7 @@ try_forward_edges (mode, b)
&& first == threaded_edges [n]->src) && first == threaded_edges [n]->src)
n++; n++;
t = first->succ; t = first->succ;
} }
t->count -= edge_count; t->count -= edge_count;
if (t->count < 0) if (t->count < 0)
@ -812,7 +812,7 @@ merge_blocks (e, b, c, mode)
if (rtl_dump_file) if (rtl_dump_file)
fprintf (rtl_dump_file, "Merged %d and %d without moving.\n", fprintf (rtl_dump_file, "Merged %d and %d without moving.\n",
b_index, c_index); b_index, c_index);
return true; return true;
} }
@ -886,8 +886,8 @@ merge_blocks (e, b, c, mode)
static bool static bool
insns_match_p (mode, i1, i2) insns_match_p (mode, i1, i2)
int mode ATTRIBUTE_UNUSED; int mode ATTRIBUTE_UNUSED;
rtx i1, i2; rtx i1, i2;
{ {
rtx p1, p2; rtx p1, p2;
@ -1057,10 +1057,10 @@ flow_find_cross_jump (mode, bb1, bb2, f1, f2)
remove_note (i1, equiv1); remove_note (i1, equiv1);
remove_note (i2, equiv2); remove_note (i2, equiv2);
} }
afterlast1 = last1, afterlast2 = last2; afterlast1 = last1, afterlast2 = last2;
last1 = i1, last2 = i2; last1 = i1, last2 = i2;
ninsns++; ninsns++;
} }
i1 = PREV_INSN (i1); i1 = PREV_INSN (i1);
@ -1135,7 +1135,7 @@ outgoing_edges_match (mode, bb1, bb2)
enum rtx_code code1, code2; enum rtx_code code1, code2;
if (!bb2->succ if (!bb2->succ
|| !bb2->succ->succ_next || !bb2->succ->succ_next
|| bb2->succ->succ_next->succ_next || bb2->succ->succ_next->succ_next
|| !any_condjump_p (bb2->end) || !any_condjump_p (bb2->end)
|| !onlyjump_p (bb2->end)) || !onlyjump_p (bb2->end))
@ -1284,9 +1284,9 @@ outgoing_edges_match (mode, bb1, bb2)
if (fallthru1) if (fallthru1)
{ {
basic_block d1 = (forwarder_block_p (fallthru1->dest) 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) basic_block d2 = (forwarder_block_p (fallthru2->dest)
? fallthru2->dest->succ->dest: fallthru2->dest); ? fallthru2->dest->succ->dest: fallthru2->dest);
if (d1 != d2) if (d1 != d2)
return false; return false;
@ -1759,7 +1759,7 @@ delete_unreachable_blocks ()
find_unreachable_blocks (); find_unreachable_blocks ();
/* Delete all unreachable basic blocks. Do compaction concurrently, /* 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. */ have oodles of dead code. */
for (i = j = 0; i < n_basic_blocks; ++i) for (i = j = 0; i < n_basic_blocks; ++i)

View file

@ -127,7 +127,7 @@ skip_insns_after_block (bb)
last_insn = insn; last_insn = insn;
continue; continue;
} }
break; break;
default: default:
break; break;
@ -137,7 +137,7 @@ skip_insns_after_block (bb)
} }
/* It is possible to hit contradictory sequence. For instance: /* It is possible to hit contradictory sequence. For instance:
jump_insn jump_insn
NOTE_INSN_LOOP_BEG NOTE_INSN_LOOP_BEG
barrier barrier
@ -152,14 +152,14 @@ skip_insns_after_block (bb)
if (GET_CODE (insn) == NOTE) if (GET_CODE (insn) == NOTE)
switch (NOTE_LINE_NUMBER (insn)) switch (NOTE_LINE_NUMBER (insn))
{ {
case NOTE_INSN_LOOP_END: case NOTE_INSN_LOOP_END:
case NOTE_INSN_BLOCK_END: case NOTE_INSN_BLOCK_END:
case NOTE_INSN_DELETED: case NOTE_INSN_DELETED:
case NOTE_INSN_DELETED_LABEL: case NOTE_INSN_DELETED_LABEL:
continue; continue;
default: default:
reorder_insns (insn, insn, last_insn); reorder_insns (insn, insn, last_insn);
} }
} }
return last_insn; return last_insn;
@ -192,7 +192,7 @@ record_effective_endpoints ()
{ {
rtx next_insn = get_insns (); rtx next_insn = get_insns ();
int i; int i;
for (i = 0; i < n_basic_blocks; i++) for (i = 0; i < n_basic_blocks; i++)
{ {
basic_block bb = BASIC_BLOCK (i); basic_block bb = BASIC_BLOCK (i);
@ -203,7 +203,7 @@ record_effective_endpoints ()
PREV_INSN (bb->head)); PREV_INSN (bb->head));
end = skip_insns_after_block (bb); end = skip_insns_after_block (bb);
if (NEXT_INSN (bb->end) && bb->end != end) 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); 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. */ basically never fail, however, keep up the pretense. */
else if (invert_jump (bb_end_insn, else if (invert_jump (bb_end_insn,
label_for_bb (e_fall->dest), 0)) 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); insn = duplicate_insn_chain (bb->head, bb->end);
new_bb = create_basic_block (insn, new_bb = create_basic_block (insn,
insn ? get_last_insn () : NULL, insn ? get_last_insn () : NULL,
EXIT_BLOCK_PTR->prev_bb); EXIT_BLOCK_PTR->prev_bb);
alloc_aux_for_block (new_bb, sizeof (struct reorder_block_def)); 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; bb->count -= new_count;
if (e) if (e)
{ {
new_bb->frequency = EDGE_FREQUENCY (e); new_bb->frequency = EDGE_FREQUENCY (e);
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) if (bb->count < 0)
bb->count = 0; bb->count = 0;

View file

@ -110,9 +110,9 @@ flow_loop_dump (loop, file, loop_dump_aux, verbose)
if (loop->first->head && loop->last->end) if (loop->first->head && loop->last->end)
fprintf (file, ";;\n;; Loop %d (%d to %d):%s%s\n", fprintf (file, ";;\n;; Loop %d (%d to %d):%s%s\n",
loop->num, INSN_UID (loop->first->head), loop->num, INSN_UID (loop->first->head),
INSN_UID (loop->last->end), INSN_UID (loop->last->end),
loop->shared ? " shared" : "", loop->invalid ? " invalid" : ""); loop->shared ? " shared" : "", loop->invalid ? " invalid" : "");
else else
fprintf (file, ";;\n;; Loop %d:%s%s\n", loop->num, fprintf (file, ";;\n;; Loop %d:%s%s\n", loop->num,
loop->shared ? " shared" : "", loop->invalid ? " invalid" : ""); loop->shared ? " shared" : "", loop->invalid ? " invalid" : "");

View file

@ -90,7 +90,7 @@ can_delete_note_p (note)
{ {
return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED
|| NOTE_LINE_NUMBER (note) == NOTE_INSN_BASIC_BLOCK || 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. */ /* True if a given label can be deleted. */
@ -119,7 +119,7 @@ delete_insn (insn)
if (GET_CODE (insn) == CODE_LABEL) if (GET_CODE (insn) == CODE_LABEL)
{ {
/* Some labels can't be directly removed from the INSN chain, as they /* 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. */ Convert them to the special NOTE_INSN_DELETED_LABEL note. */
if (! can_delete_label_p (insn)) if (! can_delete_label_p (insn))
{ {
@ -381,13 +381,13 @@ flow_delete_block_noexpunge (b)
NOTE_INSN_EH_REGION_END notes. */ NOTE_INSN_EH_REGION_END notes. */
/* Get rid of all NOTE_INSN_PREDICTIONs hanging before the block. */ /* Get rid of all NOTE_INSN_PREDICTIONs hanging before the block. */
for (insn = PREV_INSN (b->head); insn; insn = PREV_INSN (insn)) for (insn = PREV_INSN (b->head); insn; insn = PREV_INSN (insn))
{ {
if (GET_CODE (insn) != NOTE) if (GET_CODE (insn) != NOTE)
break; break;
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_PREDICTION) 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; insn = b->head;
@ -434,7 +434,7 @@ flow_delete_block (b)
basic_block b; basic_block b;
{ {
int deleted_handler = flow_delete_block_noexpunge (b); int deleted_handler = flow_delete_block_noexpunge (b);
/* Remove the basic block from the array, and compact behind it. */ /* Remove the basic block from the array, and compact behind it. */
expunge_block (b); 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. */ /* The first insn after the call may be a stack pop, skip it. */
while (next while (next
&& keep_with_call_p (next)) && keep_with_call_p (next))
{ {
after = next; after = next;
next = next_nonnote_insn (next); next = next_nonnote_insn (next);
} }
bb = e->dest; bb = e->dest;
@ -1833,17 +1833,17 @@ verify_flow_info ()
} }
} }
if (bb->count < 0) 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); bb->index, (int)bb->count);
err = 1; err = 1;
} }
if (bb->frequency < 0) 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); bb->index, bb->frequency);
err = 1; err = 1;
} }
for (e = bb->succ; e; e = e->succ_next) for (e = bb->succ; e; e = e->succ_next)
{ {
if (last_visited [e->dest->index + 2] == bb) 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); error ("Abnormal edges for no purpose in bb %i", bb->index);
err = 1; err = 1;
} }
if (!n_fallthru) if (!n_fallthru)
{ {
rtx insn; rtx insn;
@ -2223,7 +2223,7 @@ purge_dead_edges (bb)
/* Avoid abnormal flags to leak from computed jumps turned /* Avoid abnormal flags to leak from computed jumps turned
into simplejumps. */ into simplejumps. */
e->flags &= ~EDGE_ABNORMAL; e->flags &= ~EDGE_ABNORMAL;
/* See if this edge is one we should keep. */ /* 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->probability = REG_BR_PROB_BASE;
bb->succ->count = bb->count; bb->succ->count = bb->count;
} }
else else
{ {
note = find_reg_note (insn, REG_BR_PROB, NULL); note = find_reg_note (insn, REG_BR_PROB, NULL);