From 5154e79ae48dfc2706c2268654f9304bc0c85367 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Fri, 22 Jun 2001 16:42:33 +0000 Subject: [PATCH] optabs.c (emit_libcall_block): When using non-call exceptions, don't mark libcalls never throwing. 2001-06-14 Andrew Haley * optabs.c (emit_libcall_block): When using non-call exceptions, don't mark libcalls never throwing. From-SVN: r43504 --- gcc/ChangeLog | 5 +++++ gcc/optabs.c | 39 ++++++++++++++++++++++++++------------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 57da6117b74..573da053303 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-06-14 Andrew Haley + + * optabs.c (emit_libcall_block): When using non-call exceptions, + don't mark libcalls never throwing. + 2001-06-21 Stan Shebs * objc/objc-act.c (hash_init): Use xcalloc. diff --git a/gcc/optabs.c b/gcc/optabs.c index 0e135af12a0..a3e2682a658 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -2820,23 +2820,36 @@ emit_libcall_block (insns, target, result, equiv) into a MEM later. Protect the libcall block from this change. */ if (! REG_P (target) || REG_USERVAR_P (target)) target = gen_reg_rtx (GET_MODE (target)); - + + /* If we're using non-call exceptions, a libcall corresponding to an + operation that may trap may also trap. */ + if (flag_non_call_exceptions && may_trap_p (equiv)) + { + for (insn = insns; insn; insn = NEXT_INSN (insn)) + if (GET_CODE (insn) == CALL_INSN) + { + rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX); + + if (note != 0 && INTVAL (XEXP (note, 0)) <= 0) + remove_note (insn, note); + } + } + else /* look for any CALL_INSNs in this sequence, and attach a REG_EH_REGION reg note to indicate that this call cannot throw or execute a nonlocal goto (unless there is already a REG_EH_REGION note, in which case we update it). */ - - for (insn = insns; insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == CALL_INSN) - { - rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX); - - if (note != 0) - XEXP (note, 0) = GEN_INT (-1); - else - REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, GEN_INT (-1), - REG_NOTES (insn)); - } + for (insn = insns; insn; insn = NEXT_INSN (insn)) + if (GET_CODE (insn) == CALL_INSN) + { + rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX); + + if (note != 0) + XEXP (note, 0) = GEN_INT (-1); + 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 we go. Avoid insns that set pseudos which were referenced in previous -- 2.30.2