Patchwork Cgraph alias reorg 1/14

login
register
mail settings
Submitter Jan Hubicka
Date June 9, 2011, 11:28 p.m.
Message ID <20110609232841.GA28776@kam.mff.cuni.cz>
Download mbox | patch
Permalink /patch/99819/
State New
Headers show

Comments

Jan Hubicka - June 9, 2011, 11:28 p.m.
Hi,
there is bug in record_eh_tables that fires in one of C++ testcases where
personality function is present in the same unit and GCC happily optimizes it
out because it fails to set address_taken flag.

Bootstrapped/regtested x86_64-linux, will commit it shortly.

	* cgraphbuild.c (record_eh_tables): Mark personality function as having
	address taken.

Patch

Index: cgraphbuild.c
===================================================================
--- cgraphbuild.c	(revision 174804)
+++ cgraphbuild.c	(working copy)
@@ -149,9 +149,13 @@  record_eh_tables (struct cgraph_node *no
   eh_region i;
 
   if (DECL_FUNCTION_PERSONALITY (node->decl))
-    ipa_record_reference (node, NULL,
-	       cgraph_get_create_node (DECL_FUNCTION_PERSONALITY (node->decl)),
-	       NULL, IPA_REF_ADDR, NULL);
+    {
+      struct cgraph_node *per_node;
+
+      per_node = cgraph_get_create_node (DECL_FUNCTION_PERSONALITY (node->decl));
+      ipa_record_reference (node, NULL, per_node, NULL, IPA_REF_ADDR, NULL);
+      cgraph_mark_address_taken_node (per_node);
+    }
 
   i = fun->eh->region_tree;
   if (!i)