Commit 6af57aae by Andrew MacLeod Committed by Andrew Macleod

rtl.h (REG_EH_REGION): Update comment to indicate a value of -1 indicates no…

rtl.h (REG_EH_REGION): Update comment to indicate a value of -1 indicates no throw and no nonlocal gotos.

Tue Apr 27 19:50:25 EDT 1999  Andrew MacLeod  <amacleod@cygnus.com>
	* rtl.h (REG_EH_REGION): Update comment to indicate a value of -1
	indicates no throw and no nonlocal gotos.
	* optabs.c (emit_libcall_block): Emit REG_EH_REGION with a value
	of -1 instead of 0 to indicate a nonlocal goto won't happen either.
	* flow.c (count_basic_blocks, find_basic_blocks_1): Ignore libcall
	blocks, look for REG_EH_REGION note exclusively.
	(make_edges): Check for REG_EH_REGION > 0 for specified handlers.

From-SVN: r26680
parent ceff9b14
Tue Apr 27 19:50:25 EDT 1999 Andrew MacLeod <amacleod@cygnus.com>
* rtl.h (REG_EH_REGION): Update comment to indicate a value of -1
indicates no throw and no nonlocal gotos.
* optabs.c (emit_libcall_block): Emit REG_EH_REGION with a value
of -1 instead of 0 to indicate a nonlocal goto won't happen either.
* flow.c (count_basic_blocks, find_basic_blocks_1): Ignore libcall
blocks, look for REG_EH_REGION note exclusively.
(make_edges): Check for REG_EH_REGION > 0 for specified handlers.
Tue Apr 27 15:33:42 1999 David Edelsohn <edelsohn@gnu.org> Tue Apr 27 15:33:42 1999 David Edelsohn <edelsohn@gnu.org>
* rs6000.h (read_only_data_section, private_data_section, * rs6000.h (read_only_data_section, private_data_section,
...@@ -124,7 +134,7 @@ Mon Apr 26 15:27:33 1999 Mark Mitchell <mark@codesourcery.com> ...@@ -124,7 +134,7 @@ Mon Apr 26 15:27:33 1999 Mark Mitchell <mark@codesourcery.com>
* fixinc/inclhack.tpl: Remove unnecessary character quote * fixinc/inclhack.tpl: Remove unnecessary character quote
* fixinc/fixincl.sh, fixinc/inclhack.sh: Regenerate * fixinc/fixincl.sh, fixinc/inclhack.sh: Regenerate
Mon Apr 26 10:41:42 EDT 1999 <amacleod@cygnus.com> Mon Apr 26 10:41:42 EDT 1999 Andrew MacLeod <amacleod@cygnus.com>
* alpha.md (builtin_setjmp_receiver): Use a label_ref instead of * alpha.md (builtin_setjmp_receiver): Use a label_ref instead of
a code label. a code label.
......
...@@ -435,7 +435,6 @@ count_basic_blocks (f) ...@@ -435,7 +435,6 @@ count_basic_blocks (f)
register RTX_CODE prev_code; register RTX_CODE prev_code;
register int count = 0; register int count = 0;
int eh_region = 0; int eh_region = 0;
int in_libcall_block = 0;
int call_had_abnormal_edge = 0; int call_had_abnormal_edge = 0;
rtx prev_call = NULL_RTX; rtx prev_call = NULL_RTX;
...@@ -444,11 +443,6 @@ count_basic_blocks (f) ...@@ -444,11 +443,6 @@ count_basic_blocks (f)
{ {
register RTX_CODE code = GET_CODE (insn); register RTX_CODE code = GET_CODE (insn);
/* Track when we are inside in LIBCALL block. */
if (GET_RTX_CLASS (code) == 'i'
&& find_reg_note (insn, REG_LIBCALL, NULL_RTX))
in_libcall_block = 1;
if (code == CODE_LABEL if (code == CODE_LABEL
|| (GET_RTX_CLASS (code) == 'i' || (GET_RTX_CLASS (code) == 'i'
&& (prev_code == JUMP_INSN && (prev_code == JUMP_INSN
...@@ -473,14 +467,20 @@ count_basic_blocks (f) ...@@ -473,14 +467,20 @@ count_basic_blocks (f)
/* Record whether this call created an edge. */ /* Record whether this call created an edge. */
if (code == CALL_INSN) if (code == CALL_INSN)
{ {
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
int region = (note ? XINT (XEXP (note, 0), 0) : 1);
prev_call = insn; prev_call = insn;
call_had_abnormal_edge = 0; call_had_abnormal_edge = 0;
if (nonlocal_goto_handler_labels)
call_had_abnormal_edge = !in_libcall_block; /* If there is a specified EH region, we have an edge. */
else if (eh_region) if (eh_region && region > 0)
call_had_abnormal_edge = 1;
else
{ {
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX); /* If there is a nonlocal goto label and the specified
if (!note || XINT (XEXP (note, 0), 0) != 0) region number isn't -1, we have an edge. (0 means
no throw, but might have a nonlocal goto). */
if (nonlocal_goto_handler_labels && region >= 0)
call_had_abnormal_edge = 1; call_had_abnormal_edge = 1;
} }
} }
...@@ -494,9 +494,6 @@ count_basic_blocks (f) ...@@ -494,9 +494,6 @@ count_basic_blocks (f)
else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END) else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END)
--eh_region; --eh_region;
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
&& find_reg_note (insn, REG_RETVAL, NULL_RTX))
in_libcall_block = 0;
} }
/* The rest of the compiler works a bit smoother when we don't have to /* The rest of the compiler works a bit smoother when we don't have to
...@@ -527,7 +524,6 @@ find_basic_blocks_1 (f, bb_eh_end) ...@@ -527,7 +524,6 @@ find_basic_blocks_1 (f, bb_eh_end)
rtx *bb_eh_end; rtx *bb_eh_end;
{ {
register rtx insn, next; register rtx insn, next;
int in_libcall_block = 0;
int call_has_abnormal_edge = 0; int call_has_abnormal_edge = 0;
int i = 0; int i = 0;
rtx bb_note = NULL_RTX; rtx bb_note = NULL_RTX;
...@@ -548,21 +544,22 @@ find_basic_blocks_1 (f, bb_eh_end) ...@@ -548,21 +544,22 @@ find_basic_blocks_1 (f, bb_eh_end)
next = NEXT_INSN (insn); next = NEXT_INSN (insn);
/* Track when we are inside in LIBCALL block. */
if (GET_RTX_CLASS (code) == 'i'
&& find_reg_note (insn, REG_LIBCALL, NULL_RTX))
in_libcall_block = 1;
if (code == CALL_INSN) if (code == CALL_INSN)
{ {
/* Record whether this call created an edge. */ /* Record whether this call created an edge. */
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
int region = (note ? XINT (XEXP (note, 0), 0) : 1);
call_has_abnormal_edge = 0; call_has_abnormal_edge = 0;
if (nonlocal_goto_handler_labels)
call_has_abnormal_edge = !in_libcall_block; /* If there is an EH region, we have an edge. */
else if (eh_list) if (eh_list && region > 0)
call_has_abnormal_edge = 1;
else
{ {
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX); /* If there is a nonlocal goto label and the specified
if (!note || XINT (XEXP (note, 0), 0) != 0) region number isn't -1, we have an edge. (0 means
no throw, but might have a nonlocal goto). */
if (nonlocal_goto_handler_labels && region >= 0)
call_has_abnormal_edge = 1; call_has_abnormal_edge = 1;
} }
} }
...@@ -722,9 +719,6 @@ find_basic_blocks_1 (f, bb_eh_end) ...@@ -722,9 +719,6 @@ find_basic_blocks_1 (f, bb_eh_end)
= gen_rtx_EXPR_LIST (VOIDmode, XEXP (note, 0), = gen_rtx_EXPR_LIST (VOIDmode, XEXP (note, 0),
label_value_list); label_value_list);
} }
if (find_reg_note (insn, REG_RETVAL, NULL_RTX))
in_libcall_block = 0;
} }
} }
...@@ -996,7 +990,7 @@ make_edges (label_value_list, bb_eh_end) ...@@ -996,7 +990,7 @@ make_edges (label_value_list, bb_eh_end)
x = find_reg_note (insn, REG_EH_REGION, 0); x = find_reg_note (insn, REG_EH_REGION, 0);
if (x) if (x)
{ {
if (XINT (XEXP (x, 0), 0) != 0) if (XINT (XEXP (x, 0), 0) > 0)
{ {
ptr = get_first_handler (XINT (XEXP (x, 0), 0)); ptr = get_first_handler (XINT (XEXP (x, 0), 0));
while (ptr) while (ptr)
......
...@@ -2604,7 +2604,7 @@ emit_libcall_block (insns, target, result, equiv) ...@@ -2604,7 +2604,7 @@ emit_libcall_block (insns, target, result, equiv)
{ {
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 == NULL_RTX)
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, GEN_INT (0), REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, GEN_INT (-1),
REG_NOTES (insn)); REG_NOTES (insn));
} }
} }
......
...@@ -344,7 +344,9 @@ typedef struct rtvec_def{ ...@@ -344,7 +344,9 @@ typedef struct rtvec_def{
rtx is used instead of intuition. */ rtx is used instead of intuition. */
/* REG_EH_REGION is used to indicate what exception region an INSN /* REG_EH_REGION is used to indicate what exception region an INSN
belongs in. This can be used to indicate what region a call may throw belongs in. This can be used to indicate what region a call may throw
to. a REGION of 0 indicates that a call cannot throw at all. to. A REGION of 0 indicates that a call cannot throw at all.
A REGION of -1 indicates that it cannot throw, nor will it execute
a non-local goto.
REG_EH_RETHROW is used to indicate what that a call is actually a REG_EH_RETHROW is used to indicate what that a call is actually a
call to rethrow, and specifies which region the rethrow is targetting. call to rethrow, and specifies which region the rethrow is targetting.
This provides a way to generate the non standard flow edges required This provides a way to generate the non standard flow edges required
......
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