From: Jason Merrill Date: Thu, 23 Jun 2011 16:52:56 +0000 (-0400) Subject: optimize.c (maybe_clone_body): Set linkage flags before cgraph_same_body_alias. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d72ce0c110efa0597e1620f8dd946a14191b9b83;p=gcc.git optimize.c (maybe_clone_body): Set linkage flags before cgraph_same_body_alias. * optimize.c (maybe_clone_body): Set linkage flags before cgraph_same_body_alias. From-SVN: r175341 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index da39680df0e..cb230e25871 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2011-06-23 Jason Merrill + * optimize.c (maybe_clone_body): Set linkage flags before + cgraph_same_body_alias. + PR c++/49440 * class.c (set_linkage_according_to_type): Just check TREE_PUBLIC on the type's name. diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index 87302dc933d..b9e3551b40c 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -310,8 +310,11 @@ maybe_clone_body (tree fn) || (HAVE_COMDAT_GROUP && DECL_WEAK (fns[0]))) && (flag_syntax_only - || cgraph_same_body_alias (cgraph_get_node (fns[0]), clone, - fns[0]))) + /* Set linkage flags appropriately before + cgraph_create_function_alias looks at them. */ + || (expand_or_defer_fn_1 (clone) + && cgraph_same_body_alias (cgraph_get_node (fns[0]), + clone, fns[0])))) { alias = true; if (DECL_ONE_ONLY (fns[0]))