* optimize.c (maybe_clone_body): Set linkage flags before
cgraph_same_body_alias.
From-SVN: r175341
2011-06-23 Jason Merrill <jason@redhat.com>
+ * 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.
|| (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]))