This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][alias-improvements] Remove ipa-cp hack


This removes the inserted update_ssa() call.  The problem was we
missed to copy virtual operands in the gimple_call_copy_skip_args
helper.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to the 
branch.

Richard.


2009-01-30  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_call_copy_skip_args): Copy the virtual operands
	and mark the new statement modified.
	* ipa-cp.c (ipcp_update_callgraph): Do not update SSA form.
	Adjust the SSA_NAME_DEF_STMT of a VDEF to the new statement.

Index: alias-improvements/gcc/gimple.c
===================================================================
*** alias-improvements.orig/gcc/gimple.c	2009-01-30 09:23:03.000000000 +0100
--- alias-improvements/gcc/gimple.c	2009-01-30 09:23:28.000000000 +0100
*************** gimple_call_copy_skip_args (gimple stmt,
*** 3175,3180 ****
--- 3175,3183 ----
    if (gimple_call_lhs (stmt))
      gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
  
+   gimple_set_vuse (new_stmt, gimple_vuse (stmt));
+   gimple_set_vdef (new_stmt, gimple_vdef (stmt));
+ 
    gimple_set_block (new_stmt, gimple_block (stmt));
    if (gimple_has_location (stmt))
      gimple_set_location (new_stmt, gimple_location (stmt));
*************** gimple_call_copy_skip_args (gimple stmt,
*** 3186,3191 ****
--- 3189,3197 ----
    gimple_call_set_return_slot_opt (new_stmt, gimple_call_return_slot_opt_p (stmt));
    gimple_call_set_from_thunk (new_stmt, gimple_call_from_thunk_p (stmt));
    gimple_call_set_va_arg_pack (new_stmt, gimple_call_va_arg_pack_p (stmt));
+ 
+   gimple_set_modified (new_stmt, true);
+ 
    return new_stmt;
  }
  
Index: alias-improvements/gcc/ipa-cp.c
===================================================================
*** alias-improvements.orig/gcc/ipa-cp.c	2009-01-30 09:23:03.000000000 +0100
--- alias-improvements/gcc/ipa-cp.c	2009-01-30 09:26:27.000000000 +0100
*************** ipcp_update_callgraph (void)
*** 969,981 ****
  		
  		new_stmt = gimple_call_copy_skip_args (cs->call_stmt,
  						       args_to_skip);
  		gsi = gsi_for_stmt (cs->call_stmt);
  		gsi_replace (&gsi, new_stmt, true);
  		cgraph_set_call_stmt (cs, new_stmt);
- 		/* ???  We lose pure/const or clobber information during
- 		   cloning so we may end up with different VOPs for
- 		   the call.  See gcc.c-torture/execute/20000113-1.c.  */
- 		update_ssa (TODO_update_ssa);
  	        pop_cfun ();
  		current_function_decl = NULL;
  	      }
--- 969,979 ----
  		
  		new_stmt = gimple_call_copy_skip_args (cs->call_stmt,
  						       args_to_skip);
+ 		if (gimple_vdef (new_stmt))
+ 		  SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
  		gsi = gsi_for_stmt (cs->call_stmt);
  		gsi_replace (&gsi, new_stmt, true);
  		cgraph_set_call_stmt (cs, new_stmt);
  	        pop_cfun ();
  		current_function_decl = NULL;
  	      }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]