optabs.c (emit_libcall_block): When using non-call exceptions, don't mark libcalls...
authorAndrew Haley <aph@cambridge.redhat.com>
Fri, 22 Jun 2001 16:42:33 +0000 (16:42 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Fri, 22 Jun 2001 16:42:33 +0000 (16:42 +0000)
2001-06-14  Andrew Haley  <aph@cambridge.redhat.com>

        * optabs.c (emit_libcall_block): When using non-call exceptions,
        don't mark libcalls never throwing.

From-SVN: r43504

gcc/ChangeLog
gcc/optabs.c

index 57da611..573da05 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-14  Andrew Haley  <aph@cambridge.redhat.com>
+
+       * optabs.c (emit_libcall_block): When using non-call exceptions,
+       don't mark libcalls never throwing.
+
 2001-06-21  Stan Shebs  <shebs@apple.com>
 
        * objc/objc-act.c (hash_init): Use xcalloc.
index 0e135af..a3e2682 100644 (file)
@@ -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