This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR42975
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 30 May 2010 21:49:28 +0200 (CEST)
- Subject: [PATCH] Fix PR42975
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
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.
Index: gcc/tree-eh.c
===================================================================
*** gcc/tree-eh.c (revision 156493)
--- gcc/tree-eh.c (working copy)
*************** cleanup_all_empty_eh (void)
*** 3796,3802 ****
*/
static unsigned int
! execute_cleanup_eh (void)
{
/* Do this first: unsplit_all_eh and cleanup_all_empty_eh can die
looking up unreachable landing pads. */
--- 3796,3802 ----
*/
static unsigned int
! execute_cleanup_eh_1 (void)
{
/* Do this first: unsplit_all_eh and cleanup_all_empty_eh can die
looking up unreachable landing pads. */
*************** execute_cleanup_eh (void)
*** 3830,3835 ****
--- 3830,3850 ----
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)
{