This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


        * 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
 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.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]