re PR rtl-optimization/29323 (set_nothrow_function_flags does invalid analysis on...
authorRichard Guenther <rguenther@suse.de>
Tue, 10 Oct 2006 08:27:02 +0000 (08:27 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 10 Oct 2006 08:27:02 +0000 (08:27 +0000)
2006-10-10  Richard Guenther  <rguenther@suse.de>

PR rtl-optimization/29323
* except.c (set_nothrow_function_flags): For functions
that do not bind local bail out early.

* decl.c (finish_function): Set TREE_NOTHROW only for
functions that bind local.

From-SVN: r117598

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/except.c

index 6f0fce1a2acfd2fa91bccc5041e4cba0f254eb63..b8c8d40501c05c995e5b1630842970d0f3733d8d 100644 (file)
@@ -1,3 +1,9 @@
+2006-10-10  Richard Guenther  <rguenther@suse.de>
+
+       PR rtl-optimization/29323
+       * except.c (set_nothrow_function_flags): For functions
+       that do not bind local bail out early.
+
 2006-10-10  Ben Elliston  <bje@au.ibm.com>
 
        * doc/invoke.texi (RS/6000 and PowerPC Options): Add -m to the
index 615f53c49e8cfb6d790c9d497b378757702e2833..253c578c30d27a5aedcd781e11594e22b5a4eb0b 100644 (file)
@@ -1,3 +1,9 @@
+2006-10-10  Richard Guenther  <rguenther@suse.de>
+
+       PR rtl-optimization/29323
+       * decl.c (finish_function): Set TREE_NOTHROW only for
+       functions that bind local.
+
 2006-10-09  Richard Henderson  <rth@redhat.com>
 
        Revert emutls patch.
index 84f2aaa49b3e15dfcf1c45f873b33c3aba6a7dfd..96ecc8691d7a84cb803d2a8bcda59e274e9dd73c 100644 (file)
@@ -11096,7 +11096,8 @@ finish_function (int flags)
   /* If this function can't throw any exceptions, remember that.  */
   if (!processing_template_decl
       && !cp_function_chain->can_throw
-      && !flag_non_call_exceptions)
+      && !flag_non_call_exceptions
+      && targetm.binds_local_p (fndecl))
     TREE_NOTHROW (fndecl) = 1;
 
   /* This must come after expand_function_end because cleanups might
index b344087672b45522f06de084b82faaf1450e08bb..30dafbb8073f24260d2a3e9c1d7d88a41997a133 100644 (file)
@@ -2787,6 +2787,9 @@ set_nothrow_function_flags (void)
 {
   rtx insn;
 
+  if (!targetm.binds_local_p (current_function_decl))
+    return 0;
+
   TREE_NOTHROW (current_function_decl) = 1;
 
   /* Assume cfun->all_throwers_are_sibcalls until we encounter