+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>
* rs6000.h (read_only_data_section, private_data_section,
* fixinc/inclhack.tpl: Remove unnecessary character quote
* 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
a code label.
register RTX_CODE prev_code;
register int count = 0;
int eh_region = 0;
- int in_libcall_block = 0;
int call_had_abnormal_edge = 0;
rtx prev_call = NULL_RTX;
{
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
|| (GET_RTX_CLASS (code) == 'i'
&& (prev_code == JUMP_INSN
/* Record whether this call created an edge. */
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;
call_had_abnormal_edge = 0;
- if (nonlocal_goto_handler_labels)
- call_had_abnormal_edge = !in_libcall_block;
- else if (eh_region)
+
+ /* If there is a specified EH region, we have an edge. */
+ if (eh_region && region > 0)
+ call_had_abnormal_edge = 1;
+ else
{
- rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
- if (!note || XINT (XEXP (note, 0), 0) != 0)
+ /* If there is a nonlocal goto label and the specified
+ 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;
}
}
else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END)
--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
rtx *bb_eh_end;
{
register rtx insn, next;
- int in_libcall_block = 0;
int call_has_abnormal_edge = 0;
int i = 0;
rtx bb_note = NULL_RTX;
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)
{
/* 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;
- if (nonlocal_goto_handler_labels)
- call_has_abnormal_edge = !in_libcall_block;
- else if (eh_list)
+
+ /* If there is an EH region, we have an edge. */
+ if (eh_list && region > 0)
+ call_has_abnormal_edge = 1;
+ else
{
- rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
- if (!note || XINT (XEXP (note, 0), 0) != 0)
+ /* If there is a nonlocal goto label and the specified
+ 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;
}
}
= gen_rtx_EXPR_LIST (VOIDmode, XEXP (note, 0),
label_value_list);
}
-
- if (find_reg_note (insn, REG_RETVAL, NULL_RTX))
- in_libcall_block = 0;
}
}
x = find_reg_note (insn, REG_EH_REGION, 0);
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));
while (ptr)
but are too complex for DWARF to interpret what they imply. The attached
rtx is used instead of intuition. */
/* 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
- to. a REGION of 0 indicates that a call cannot throw at all.
+ 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.
+ 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
call to rethrow, and specifies which region the rethrow is targetting.
This provides a way to generate the non standard flow edges required
- for a rethrow. */
+ for a rethrow. */
#define REG_NOTES(INSN) ((INSN)->fld[6].rtx)