Mark ifn_va_arg with ECF_NOTHROW
authorTom de Vries <tom@codesourcery.com>
Tue, 21 Apr 2015 08:43:07 +0000 (08:43 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Tue, 21 Apr 2015 08:43:07 +0000 (08:43 +0000)
2015-04-21  Tom de Vries  <tom@codesourcery.com>

PR tree-optimization/65802
* internal-fn.def (VA_ARG): Add ECF_NOTROW to flags.

* g++.dg/pr65802.C: New test.

From-SVN: r222259

gcc/ChangeLog
gcc/internal-fn.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr65802.C [new file with mode: 0644]

index 66856a875c494024b859be4bfe93fad0a73784ac..64e9aae187b558f7749e4fe64e8d17b3d58a6063 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-21  Tom de Vries  <tom@codesourcery.com>
+
+       PR tree-optimization/65802
+       * internal-fn.def (VA_ARG): Add ECF_NOTROW to flags.
+
 2015-04-21  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * common/config/aarch64/aarch64-common.c (AARCH64_CPU_NAME_LENGTH):
index f557c64247ce1c7e252b0f2097a41101c1d9b973..7e193131a7f423321ed6fa435fa41a8acb902238 100644 (file)
@@ -62,4 +62,4 @@ DEF_INTERNAL_FN (ADD_OVERFLOW, ECF_CONST | ECF_LEAF | ECF_NOTHROW, NULL)
 DEF_INTERNAL_FN (SUB_OVERFLOW, ECF_CONST | ECF_LEAF | ECF_NOTHROW, NULL)
 DEF_INTERNAL_FN (MUL_OVERFLOW, ECF_CONST | ECF_LEAF | ECF_NOTHROW, NULL)
 DEF_INTERNAL_FN (TSAN_FUNC_EXIT, ECF_NOVOPS | ECF_LEAF | ECF_NOTHROW, NULL)
-DEF_INTERNAL_FN (VA_ARG, 0, NULL)
+DEF_INTERNAL_FN (VA_ARG, ECF_NOTHROW, NULL)
index db9559152cb46f97ea5598ada423409d97d68792..4ca31e0f2ad1733c577a81cd6eaf1ccc97278631 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-21  Tom de Vries  <tom@codesourcery.com>
+
+       PR tree-optimization/65802
+       * g++.dg/pr65802.C: New test.
+
 2015-04-21  Bin Cheng  <bin.cheng@arm.com>
 
        PR testsuite/65767
diff --git a/gcc/testsuite/g++.dg/pr65802.C b/gcc/testsuite/g++.dg/pr65802.C
new file mode 100644 (file)
index 0000000..26e5317
--- /dev/null
@@ -0,0 +1,29 @@
+// { dg-do compile }
+// { dg-options "-O0" }
+
+typedef int tf ();
+
+struct S
+{
+  tf m_fn1;
+} a;
+
+void
+fn1 ()
+{
+  try
+    {
+      __builtin_va_list c;
+      {
+       int *d = __builtin_va_arg (c, int *);
+       int **e = &d;
+       __asm__("" : "=d"(e));
+       a.m_fn1 ();
+      }
+      a.m_fn1 ();
+    }
+  catch (...)
+    {
+
+    }
+}