diff mbox

Remove obsolete alias check in cgraph_redirect_edge_call_stmt_to_callee

Message ID 20110711095831.GA9543@virgil.arch.suse.de
State New
Headers show

Commit Message

Martin Jambor July 11, 2011, 9:58 a.m. UTC
Hi,

since (same body) aliases have their own cgraph_nodes, the check for
them in cgraph_redirect_edge_call_stmt_to_callee is now unnecessary
because e->callee is now the alias, not the function node.

The following patch therefore removes it.  Bootstrapped and tested on
x86_64-linux, OK for trunk?

Thanks,

Martin


2011-07-08  Martin Jambor  <mjambor@suse.cz>

	* cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Alias
	check removed.

Comments

Martin Jambor July 27, 2011, 11:24 a.m. UTC | #1
Ping.  (Re-tested this Monday.)

Thanks,

Martin

On Mon, Jul 11, 2011 at 11:58:32AM +0200, Martin Jambor wrote:
> Hi,
> 
> since (same body) aliases have their own cgraph_nodes, the check for
> them in cgraph_redirect_edge_call_stmt_to_callee is now unnecessary
> because e->callee is now the alias, not the function node.
> 
> The following patch therefore removes it.  Bootstrapped and tested on
> x86_64-linux, OK for trunk?
> 
> Thanks,
> 
> Martin
> 
> 
> 2011-07-08  Martin Jambor  <mjambor@suse.cz>
> 
> 	* cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Alias
> 	check removed.
> 
> Index: src/gcc/cgraphunit.c
> ===================================================================
> --- src.orig/gcc/cgraphunit.c
> +++ src/gcc/cgraphunit.c
> @@ -2380,9 +2380,7 @@ cgraph_redirect_edge_call_stmt_to_callee
>  #endif
>  
>    if (e->indirect_unknown_callee
> -      || decl == e->callee->decl
> -      /* Don't update call from same body alias to the real function.  */
> -      || (decl && cgraph_get_node (decl) == cgraph_get_node (e->callee->decl)))
> +      || decl == e->callee->decl)
>      return e->call_stmt;
>  
>  #ifdef ENABLE_CHECKING
diff mbox

Patch

Index: src/gcc/cgraphunit.c
===================================================================
--- src.orig/gcc/cgraphunit.c
+++ src/gcc/cgraphunit.c
@@ -2380,9 +2380,7 @@  cgraph_redirect_edge_call_stmt_to_callee
 #endif
 
   if (e->indirect_unknown_callee
-      || decl == e->callee->decl
-      /* Don't update call from same body alias to the real function.  */
-      || (decl && cgraph_get_node (decl) == cgraph_get_node (e->callee->decl)))
+      || decl == e->callee->decl)
     return e->call_stmt;
 
 #ifdef ENABLE_CHECKING