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]

[tree-ssa] Remove legacy code from out-of-ssa translation


While working on the ability to take a subset of variables out of SSA
form (necessary for better jump threading) I was consistently seeing
the out-of-ssa code clobber the LHS of MODIFY_EXPRs when the LHS was
an SSA_NAME which we were _not_ translating out of SSA form.

The underlying problem was some legacy code in tree-ssa.c.  replace_variable
is supposed to be responsible for replacing an SSA_NAME with its underlying
_DECL node when we take the DECL out of SSA form.

Unfortunately, the old method of simply overwriting the destination was
accidentally left in the source.  So we always overwrote the LHS of our
MODIFY_EXPRs, even for variables we were not taking out of SSA form.  Opps.

Bootstrapped and regression tested on i686-pc-linux-gnu.

	* tree-ssa.c (rewrite_trees): Do not unconditionally overwrite
	variables set by statements.  Let replace_variable do any
	required rewriting.


Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.172
diff -c -3 -p -r1.1.4.172 tree-ssa.c
*** tree-ssa.c	4 Dec 2003 05:33:19 -0000	1.1.4.172
--- tree-ssa.c	5 Dec 2003 02:42:44 -0000
*************** rewrite_trees (var_map map, tree *values
*** 2462,2468 ****
  	      for (i = 0; i < num_defs; i++)
  		{
  		  tree *def_p = VARRAY_TREE_PTR (ops, i);
! 		  *def_p = var_to_partition_to_var (map, *def_p);
  		  if (replace_variable (map, def_p, NULL))
  		    changed = true;
  
--- 2462,2468 ----
  	      for (i = 0; i < num_defs; i++)
  		{
  		  tree *def_p = VARRAY_TREE_PTR (ops, i);
! 
  		  if (replace_variable (map, def_p, NULL))
  		    changed = true;
  





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