From 2a5145b0dd7f1e10431c6d93c8cc9848cef1e6a3 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@google.com>
Date: Mon, 4 Nov 2013 20:29:36 +0000
Subject: builtins.def (ATTR_NOTHROWCALL_LEAF_LIST): Define.

gcc/:
	* builtins.def (ATTR_NOTHROWCALL_LEAF_LIST): Define.
	* sync-builtins.def: Use ATTR_NOTHROWCALL_LEAF_LIST for all sync
	builtins that take pointers.
	* lto-opts.c (lto_write_options): Write -fnon-call-exceptions
	if set.
	* lto-wrapper.c (merge_and_complain): Collect
	OPT_fnon_call_exceptions.
	(run_gcc): Pass -fnon-call-exceptions.
gcc/testsuite/:
	* g++.dg/ext/sync-4.C: New test.

From-SVN: r204360
---
 gcc/builtins.def | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'gcc/builtins.def')

diff --git a/gcc/builtins.def b/gcc/builtins.def
index e2d8849..3082548 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -213,6 +213,12 @@ along with GCC; see the file COPYING3.  If not see
 #undef ATTR_MATHFN_FPROUNDING_STORE
 #define ATTR_MATHFN_FPROUNDING_STORE ATTR_NOTHROW_LEAF_LIST
 
+/* Define an attribute list for leaf functions that do not throw
+   exceptions normally, but may throw exceptions when using
+   -fnon-call-exceptions.  */
+#define ATTR_NOTHROWCALL_LEAF_LIST (flag_non_call_exceptions ? \
+	ATTR_LEAF_LIST : ATTR_NOTHROW_LEAF_LIST)
+
 /* Make sure 0 is not a legitimate builtin.  */
 DEF_BUILTIN_STUB(BUILT_IN_NONE, (const char *)0)
 
-- 
cgit v1.1

