Commit c29ea88a by Richard Kenner Committed by Richard Kenner

flow.c (count_basic_blocks, [...]): Remove last change.

	* flow.c (count_basic_blocks, find_basic_blocks_1): Remove last change.
	* optabs.c (emit_libcall_block): If have REG_EHG_REGION, update
	region number to -1.

From-SVN: r33164
parent a46c7e85
Sat Apr 15 10:59:19 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* flow.c (count_basic_blocks, find_basic_blocks_1): Remove last change.
* optabs.c (emit_libcall_block): If have REG_EHG_REGION, update
region number to -1.
2000-04-15 Richard Earnshaw (rearnsah@arm.com) 2000-04-15 Richard Earnshaw (rearnsah@arm.com)
* emit-rtl.c (unshare_all_rtl_again): Unmark everything, then * emit-rtl.c (unshare_all_rtl_again): Unmark everything, then
......
...@@ -462,7 +462,6 @@ count_basic_blocks (f) ...@@ -462,7 +462,6 @@ count_basic_blocks (f)
register int count = 0; register int count = 0;
int eh_region = 0; int eh_region = 0;
int call_had_abnormal_edge = 0; int call_had_abnormal_edge = 0;
int in_libcall = 0;
prev_code = JUMP_INSN; prev_code = JUMP_INSN;
for (insn = f; insn; insn = NEXT_INSN (insn)) for (insn = f; insn; insn = NEXT_INSN (insn))
...@@ -473,17 +472,9 @@ count_basic_blocks (f) ...@@ -473,17 +472,9 @@ count_basic_blocks (f)
|| (GET_RTX_CLASS (code) == 'i' || (GET_RTX_CLASS (code) == 'i'
&& (prev_code == JUMP_INSN && (prev_code == JUMP_INSN
|| prev_code == BARRIER || prev_code == BARRIER
|| (prev_code == CALL_INSN || (prev_code == CALL_INSN && call_had_abnormal_edge))))
&& call_had_abnormal_edge && in_libcall == 0))))
count++; count++;
/* Track whether or not we are in a LIBCALL block. These must
all be within the same basic block. */
if (find_reg_note (insn, REG_LIBCALL, NULL_RTX) != 0)
in_libcall++;
else if (find_reg_note (insn, REG_RETVAL, NULL_RTX) != 0)
in_libcall--;
/* Record whether this call created an edge. */ /* Record whether this call created an edge. */
if (code == CALL_INSN) if (code == CALL_INSN)
{ {
...@@ -538,7 +529,6 @@ find_basic_blocks_1 (f) ...@@ -538,7 +529,6 @@ find_basic_blocks_1 (f)
rtx label_value_list = NULL_RTX; rtx label_value_list = NULL_RTX;
rtx head = NULL_RTX; rtx head = NULL_RTX;
rtx end = NULL_RTX; rtx end = NULL_RTX;
int in_libcall = 0;
/* We process the instructions in a slightly different way than we did /* We process the instructions in a slightly different way than we did
previously. This is so that we see a NOTE_BASIC_BLOCK after we have previously. This is so that we see a NOTE_BASIC_BLOCK after we have
...@@ -671,9 +661,8 @@ find_basic_blocks_1 (f) ...@@ -671,9 +661,8 @@ find_basic_blocks_1 (f)
call_has_abnormal_edge = 1; call_has_abnormal_edge = 1;
/* A basic block ends at a call that can either throw or /* A basic block ends at a call that can either throw or
do a non-local goto. LIBCALLs must reside totally in one do a non-local goto. */
basic block, so don't end a block after them. */ if (call_has_abnormal_edge)
if (call_has_abnormal_edge && in_libcall == 0)
{ {
new_bb_inclusive: new_bb_inclusive:
if (head == NULL_RTX) if (head == NULL_RTX)
...@@ -713,27 +702,21 @@ find_basic_blocks_1 (f) ...@@ -713,27 +702,21 @@ find_basic_blocks_1 (f)
we know isn't part of any otherwise visible control flow. */ we know isn't part of any otherwise visible control flow. */
for (note = REG_NOTES (insn); note; note = XEXP (note, 1)) for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
{ if (REG_NOTE_KIND (note) == REG_LABEL)
if (REG_NOTE_KIND (note) == REG_LABEL) {
{ rtx lab = XEXP (note, 0), next;
rtx lab = XEXP (note, 0), next;
if (lab == eh_return_stub_label) if (lab == eh_return_stub_label)
;
else 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))
; ;
else else if ((next = next_nonnote_insn (lab)) != NULL
label_value_list && GET_CODE (next) == JUMP_INSN
= alloc_EXPR_LIST (0, XEXP (note, 0), label_value_list); && (GET_CODE (PATTERN (next)) == ADDR_VEC
} || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
else if (REG_NOTE_KIND (note) == REG_LIBCALL) ;
in_libcall++; else
else if (REG_NOTE_KIND (note) == REG_RETVAL) label_value_list
in_libcall--; = alloc_EXPR_LIST (0, XEXP (note, 0), label_value_list);
} }
} }
} }
......
...@@ -2758,19 +2758,21 @@ emit_libcall_block (insns, target, result, equiv) ...@@ -2758,19 +2758,21 @@ emit_libcall_block (insns, target, result, equiv)
rtx prev, next, first, last, insn; rtx prev, next, first, last, insn;
/* look for any CALL_INSNs in this sequence, and attach a REG_EH_REGION /* look for any CALL_INSNs in this sequence, and attach a REG_EH_REGION
reg note to indicate that this call cannot throw. (Unless there is reg note to indicate that this call cannot throw or execute a nonlocal
already a REG_EH_REGION note.) */ goto. (Unless there is already a REG_EH_REGION note, in which case
we update it.) */
for (insn = insns; insn; insn = NEXT_INSN (insn)) for (insn = insns; insn; insn = NEXT_INSN (insn))
{ if (GET_CODE (insn) == CALL_INSN)
if (GET_CODE (insn) == CALL_INSN) {
{ rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
if (note == NULL_RTX) if (note != 0)
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, GEN_INT (-1), XEXP (note, 0) = GEN_INT (-1);
REG_NOTES (insn)); else
} REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, GEN_INT (-1),
} REG_NOTES (insn));
}
/* First emit all insns that set pseudos. Remove them from the list as /* First emit all insns that set pseudos. Remove them from the list as
we go. Avoid insns that set pseudos which were referenced in previous we go. Avoid insns that set pseudos which were referenced in previous
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment