]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2010-05-30 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 30 May 2010 19:52:53 +0000 (19:52 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 30 May 2010 19:52:53 +0000 (19:52 +0000)
PR lto/42975
* tree-eh.c (execute_cleanup_eh_1): Copy from execute_cleanup_eh.
(execute_cleanup_eh): Clear DECL_FUNCTION_PERSONALITY if it is
no longer needed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160059 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-eh.c

index bf40f35f11a2b0529078e5fec7c22046c7efe09a..986aacee4e61b2da7ff74dd1f10b7a59913da020 100644 (file)
@@ -1,3 +1,10 @@
+2010-05-30  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/42975
+       * tree-eh.c (execute_cleanup_eh_1): Copy from execute_cleanup_eh.
+       (execute_cleanup_eh): Clear DECL_FUNCTION_PERSONALITY if it is
+       no longer needed.
+
 2010-05-30  Iain Sandoe  <iains@gcc.gnu.org>
 
        * config/darwin.c (output_objc_section_asm_op): Add comment.
index a7dd72b3da16dbdfdda004907b6c42d66e969b5c..9c17c1e092e461dc7a29d08dcf66921b407e9af6 100644 (file)
@@ -3857,7 +3857,7 @@ cleanup_all_empty_eh (void)
 */
 
 static unsigned int
-execute_cleanup_eh (void)
+execute_cleanup_eh_1 (void)
 {
   /* Do this first: unsplit_all_eh and cleanup_all_empty_eh can die
      looking up unreachable landing pads.  */
@@ -3891,6 +3891,21 @@ execute_cleanup_eh (void)
   return 0;
 }
 
+static unsigned int
+execute_cleanup_eh (void)
+{
+  int ret = execute_cleanup_eh_1 ();
+
+  /* If the function no longer needs an EH personality routine
+     clear it.  This exposes cross-language inlining opportunities
+     and avoids references to a never defined personality routine.  */
+  if (DECL_FUNCTION_PERSONALITY (current_function_decl)
+      && function_needs_eh_personality (cfun) != eh_personality_lang)
+    DECL_FUNCTION_PERSONALITY (current_function_decl) = NULL_TREE;
+
+  return ret;
+}
+
 static bool
 gate_cleanup_eh (void)
 {