Patchwork Fix PR47423

login
register
mail settings
Submitter Richard Guenther
Date Jan. 26, 2011, 11:28 a.m.
Message ID <alpine.LNX.2.00.1101261228050.17230@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/80500/
State New
Headers show

Comments

Richard Guenther - Jan. 26, 2011, 11:28 a.m.
This makes us properly record the reference to the personality function
and thus avoids pass-through for libsubc++ and LTO.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2011-01-26  Richard Guenther  <rguenther@suse.de>

	PR lto/47423
	* cgraphbuild.c (record_eh_tables): Record reference to personality
	function.
H.J. Lu - Jan. 27, 2011, 10:42 p.m.
On Wed, Jan 26, 2011 at 3:28 AM, Richard Guenther <rguenther@suse.de> wrote:
>
> This makes us properly record the reference to the personality function
> and thus avoids pass-through for libsubc++ and LTO.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
>
> Richard.
>
> 2011-01-26  Richard Guenther  <rguenther@suse.de>
>
>        PR lto/47423
>        * cgraphbuild.c (record_eh_tables): Record reference to personality
>        function.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47497

Patch

Index: gcc/cgraphbuild.c
===================================================================
--- gcc/cgraphbuild.c	(revision 169283)
+++ gcc/cgraphbuild.c	(working copy)
@@ -141,6 +141,11 @@  record_eh_tables (struct cgraph_node *no
 {
   eh_region i;
 
+  if (DECL_FUNCTION_PERSONALITY (node->decl))
+    ipa_record_reference (node, NULL,
+			  cgraph_node (DECL_FUNCTION_PERSONALITY (node->decl)),
+			  NULL, IPA_REF_ADDR, NULL);
+
   i = fun->eh->region_tree;
   if (!i)
     return;