aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.h
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-05-14 14:55:22 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-05-14 14:55:22 -0400
commit9bb1a81bb3cd328f6a8a6128534f3c9b490fac4c (patch)
tree35fed41760bd91f12cf6b65723674cbbc0fcc28b /gcc/gimple.h
parent786f715dc6869bac7a3018e880a4ffde41940422 (diff)
downloadgcc-9bb1a81bb3cd328f6a8a6128534f3c9b490fac4c.zip
gcc-9bb1a81bb3cd328f6a8a6128534f3c9b490fac4c.tar.gz
gcc-9bb1a81bb3cd328f6a8a6128534f3c9b490fac4c.tar.bz2
re PR c++/44127 (G++ emits unnecessary EH code)
PR c++/44127 gcc: * 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. gcc/cp: * except.c (dtor_nothrow): Return nonzero for type with trivial destructor. From-SVN: r159408
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r--gcc/gimple.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 8ecf7eb..e9d21a9 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -106,6 +106,7 @@ enum gf_mask {
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
@@ -2213,6 +2214,19 @@ gimple_call_noreturn_p (gimple s)
}
+/* 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