2010-05-14 Jason Merrill <jason@redhat.com>
PR c++/44127
+ * gimple.h (enum gf_mask): Add GF_CALL_NOTHROW.
+ (gimple_call_set_nothrow): New.
+ * gimple.c (gimple_build_call_from_tree): Call it.
+ (gimple_call_flags): Set ECF_NOTHROW from GF_CALL_NOTHROW.
+
+ PR c++/44127
* gimplify.c (gimplify_seq_add_stmt): No longer static.
* gimple.h: Declare it.
* gimple.c (gimple_build_eh_filter): No ops.
2010-05-14 Jason Merrill <jason@redhat.com>
PR c++/44127
+ * except.c (dtor_nothrow): Return nonzero for type with
+ trivial destructor.
+
+ PR c++/44127
* cp-gimplify.c (gimplify_must_not_throw_expr): Use
gimple_build_eh_must_not_throw.
GF_CALL_RETURN_SLOT_OPT = 1 << 2,
GF_CALL_TAILCALL = 1 << 3,
GF_CALL_VA_ARG_PACK = 1 << 4,
+ GF_CALL_NOTHROW = 1 << 5,
GF_OMP_PARALLEL_COMBINED = 1 << 0,
/* True on an GIMPLE_OMP_RETURN statement if the return does not require
}
+/* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
+ even if the called function can throw in other cases. */
+
+static inline void
+gimple_call_set_nothrow (gimple s, bool nothrow_p)
+{
+ GIMPLE_CHECK (s, GIMPLE_CALL);
+ if (nothrow_p)
+ s->gsbase.subcode |= GF_CALL_NOTHROW;
+ else
+ s->gsbase.subcode &= ~GF_CALL_NOTHROW;
+}
+
/* Return true if S is a nothrow call. */
static inline bool
// { dg-final { scan-assembler-not "_ZSt9terminatev" } }
+// Also there should only be two EH call sites: #0 for throw A() and #1 for
+// _Unwind_Resume. We don't want call site info for __cxa_end_catch, since
+// ~A is trivial.
+
+// { dg-final { scan-assembler-not "LEHB2" } }
+
struct A
{
A() { }