This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix c++ builtins wrt nothrow
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 16 May 2005 16:09:13 -0700
- Subject: fix c++ builtins wrt nothrow
Discovered while analysing 21399. The placement of the TREE_NOTHROW
setting meant that *all* builtins would have it set. We're supposed
to be getting that from the attributes.
Fixed thus. Applied to 4.0, since this could affect cleanups after
posix cancellation points.
r~
* decl.c (build_library_fn_1): Move setting TREE_NOTHROW ...
(build_library_fn): ... here.
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1392
diff -u -p -d -r1.1392 decl.c
--- decl.c 7 May 2005 02:29:32 -0000 1.1392
+++ decl.c 16 May 2005 23:04:27 -0000
@@ -3221,7 +3221,6 @@ build_library_fn_1 (tree name, enum tree
DECL_EXTERNAL (fn) = 1;
TREE_PUBLIC (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
- TREE_NOTHROW (fn) = 1;
SET_OVERLOADED_OPERATOR_CODE (fn, operator_code);
SET_DECL_LANGUAGE (fn, lang_c);
/* Runtime library routines are, by definition, available in an
@@ -3238,7 +3237,9 @@ build_library_fn_1 (tree name, enum tree
tree
build_library_fn (tree name, tree type)
{
- return build_library_fn_1 (name, ERROR_MARK, type);
+ tree fn = build_library_fn_1 (name, ERROR_MARK, type);
+ TREE_NOTHROW (fn) = 1;
+ return fn;
}
/* Returns the _DECL for a library function with C++ linkage. */