This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] don't emit REG_EH_REGION when not using exceptions
- From: Dan Nicolaescu <dann at godzilla dot ICS dot UCI dot EDU>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Henderson <rth at redhat dot com>
- Date: Thu, 21 Feb 2002 16:14:00 -0800
- Subject: [patch] don't emit REG_EH_REGION when not using exceptions
The debugging dumps for the example in optimization/5739 contain stuff
like:
(call_insn 121 104 138 (call_placeholder 115 106 0 0 (call_insn/u 116 115 118 (p
arallel[
(set (reg:DF 32 %f0)
(call (mem:SI (symbol_ref:SI ("mycos")) [0 S4 A32])
(const_int 0 [0x0])))
(clobber (reg:SI 15 %o7))
] ) -1 (nil)
(expr_list:REG_EH_REGION (const_int -1 [0xffffffffffffffff])
(nil))
(expr_list (use (reg:DF 8 %o0))
(nil)))) -1 (nil)
(nil)
(nil))
Note the REG_EH_REGION.
For a normal C compilation there's no reason to have REG_EH_REGION
notes.
The patch below fixes the problem, in the sense that it does not emit
REG_EH_REGION if exceptions are not in use.
It does not fix PR optimization/5739.
2002-02-21 Dan Nicolaescu <dann@ics.uci.edu>
* optabs.c (emit_libcall_block): Don't mess with REG_EH_REGION
*** optabs.c.~1.122.~ Wed Jan 23 15:03:42 2002
--- optabs.c Thu Feb 21 15:59:12 2002
***************
*** 2862,2871 ****
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)
--- 2862,2874 ----
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));
!
! /* Don't do anything if not using exceptions. */
! if (! flag_exceptions)
! ;
/* If we're using non-call exceptions, a libcall corresponding to an
operation that may trap may also trap. */
! else if (flag_non_call_exceptions && may_trap_p (equiv))
{
for (insn = insns; insn; insn = NEXT_INSN (insn))
if (GET_CODE (insn) == CALL_INSN)