OSDN Git Service

PR c++/44127
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 May 2010 18:55:22 +0000 (18:55 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:08:33 +0000 (14:08 +0900)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159408 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/gimple.h
gcc/testsuite/g++.dg/eh/terminate1.C

index a5309e1..4a71722 100644 (file)
@@ -1,6 +1,12 @@
 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.
index eca1aaa..2066fa7 100644 (file)
@@ -1,6 +1,10 @@
 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.
 
index 8ecf7eb..e9d21a9 100644 (file)
@@ -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
index cd60bcc..43cc19e 100644 (file)
@@ -7,6 +7,12 @@
 
 // { 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() { }