[patch] for PR 16864

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Wed Aug 4 19:13:00 GMT 2004


Hello,

this ICE is caused by the fact that virtual ssa names that are not live
at entry of the function (i.e. are defined in MUST_DEFs that dominate
all uses) do not have default_def set up.

However in this case it is obviously unnecessary to create a phi node
for such a virtual name, since it would be removed in next dce pass
anyway.

Bootstrapped & regtested on i686.

Zdenek

	PR tree-optimization/16864
	* tree-tailcall.c (eliminate_tail_call): Do not create phi nodes
	for ssa names without default_def.

Index: tree-tailcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-tailcall.c,v
retrieving revision 2.19
diff -c -3 -p -r2.19 tree-tailcall.c
*** tree-tailcall.c	28 Jul 2004 05:13:09 -0000	2.19
--- tree-tailcall.c	4 Aug 2004 12:24:55 -0000
*************** eliminate_tail_call (struct tailcall *t)
*** 730,736 ****
        if (!phi)
  	{
  	  tree name = var_ann (param)->default_def;
! 	  tree new_name = make_ssa_name (param, SSA_NAME_DEF_STMT (name));
  
  	  var_ann (param)->default_def = new_name;
  	  phi = create_phi_node (name, first);
--- 730,746 ----
        if (!phi)
  	{
  	  tree name = var_ann (param)->default_def;
! 	  tree new_name;
! 
! 	  if (!name)
! 	    {
! 	      /* It may happen that the tag does not have a default_def in case
! 		 when all uses of it are dominated by a MUST_DEF.  This however
! 		 means that it is not necessary to add a phi node for this
! 		 tag.  */
! 	      continue;
! 	    }
! 	  new_name = make_ssa_name (param, SSA_NAME_DEF_STMT (name));
  
  	  var_ann (param)->default_def = new_name;
  	  phi = create_phi_node (name, first);



More information about the Gcc-patches mailing list