aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-05-30 19:52:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-05-30 19:52:53 +0000
commit66a3e33967b012b5ec524c0c57618fe7408ce440 (patch)
tree8f4e7597676168c07f9f377dec63e2b7b47a0b1e /gcc
parent83bf7f5eb6e8507d1c8fad3e19c1fff801f19b37 (diff)
downloadgcc-66a3e33967b012b5ec524c0c57618fe7408ce440.zip
gcc-66a3e33967b012b5ec524c0c57618fe7408ce440.tar.gz
gcc-66a3e33967b012b5ec524c0c57618fe7408ce440.tar.bz2
re PR middle-end/42975 (eh-cleanup should be able to clear DECL_FUNCTION_PERSONALITY)
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. From-SVN: r160059
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-eh.c17
2 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bf40f35..986aace 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index a7dd72b..9c17c1e 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -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)
{