diff mbox

Go patch committed: Don't call cgraph_mark_needed_node

Message ID mcrr4vi6qx7.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor April 20, 2012, 9:20 p.m. UTC
Honza removed the function cgraph_mark_needed_node from mainline.  The
Go frontend called it, but that call was left over from days long ago
when package initialization was run as a global constructor.  Package
initialization is now done by a direct call from the main function
(found in libgo/runtime/go-main.c), so the function is no longer special
from a cgraph point of view.  This patch just removes the call to
cgraph_mark_needed_node.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linx-gnu.  Committed to mainline.

Ian

Comments

Jan Hubicka April 20, 2012, 10:10 p.m. UTC | #1
> Honza removed the function cgraph_mark_needed_node from mainline.  The
> Go frontend called it, but that call was left over from days long ago
> when package initialization was run as a global constructor.  Package
> initialization is now done by a direct call from the main function
> (found in libgo/runtime/go-main.c), so the function is no longer special
> from a cgraph point of view.  This patch just removes the call to
> cgraph_mark_needed_node.  Bootstrapped and ran Go testsuite on
> x86_64-unknown-linx-gnu.  Committed to mainline.
> 
> Ian
> 

> diff -r 2247d6aae86d go/gogo-tree.cc
> --- a/go/gogo-tree.cc	Fri Apr 20 13:09:25 2012 -0700
> +++ b/go/gogo-tree.cc	Fri Apr 20 14:19:43 2012 -0700
> @@ -495,7 +495,6 @@
>    gimplify_function_tree(fndecl);
>  
>    cgraph_add_new_function(fndecl, false);
> -  cgraph_mark_needed_node(cgraph_get_node(fndecl));

Note that cgraph_add_new_function actually calls cgraph_mark_needed_node implicitely.
Thanks for fixing this!
Honza
diff mbox

Patch

diff -r 2247d6aae86d go/gogo-tree.cc
--- a/go/gogo-tree.cc	Fri Apr 20 13:09:25 2012 -0700
+++ b/go/gogo-tree.cc	Fri Apr 20 14:19:43 2012 -0700
@@ -495,7 +495,6 @@ 
   gimplify_function_tree(fndecl);
 
   cgraph_add_new_function(fndecl, false);
-  cgraph_mark_needed_node(cgraph_get_node(fndecl));
 
   current_function_decl = NULL_TREE;
   pop_cfun();