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]

Conditional life analysis bug.



I've just committed the following, which fixes the one remaining problem 
when bootstrapping the ARM with conditional execution enabled.

Prior to scheduling we have a basic block with 

bb (live at start ... r7 ...)
	x1 := compare()
	(ce x1) r7 := [xxx]
	(ce x1) r8 := r7
	[yyy] := r7		 {reg_dead(r7)}

After scheduling we have

<i1>	x1 := compare()
<i2>	(ce x1) r7 := [xxx]
<i3>	[yyy] := r7
<i4>	(ce x1) r8 := r7	 {reg_dead(r7)}

When we update flow info with the above sequence, we mark r7 as 
conditionally live before i4, but we fail to remove the conditional 
liveness (to make it unconditionally live) when we process i3, so when we 
process i2, the insn appears to be set for all its conditions and hence we 
consider it to be dead.  We then abort because the new list of live regs 
for the start of the block has changed.  The patch removes a register from 
the conditionally dead list if we see an unconditional use (since it is 
now no-longer conditionally dead).

Bootstrapped on arm-linux and arm-netbsd with my conditional insn patches.

	* flow.c (mark_used_reg): If a register is unconditionally live, 
	remove any conditional death information.


Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.294
diff -p -r1.294 flow.c
*** flow.c	2000/05/26 10:30:47	1.294
--- flow.c	2000/05/29 22:21:57
*************** mark_used_reg (pbi, reg, cond, insn)
*** 5120,5125 ****
--- 5120,5143 ----
  			     (splay_tree_value) rcli);
  	}
      }
+   else if (some_was_live)
+     {
+       splay_tree_node node;
+       struct reg_cond_life_info *rcli;
+ 
+       node = splay_tree_lookup (pbi->reg_cond_dead, regno);
+       if (node != NULL)
+ 	{
+ 	  /* The register was conditionally live previously, but is now
+ 	     unconditionally so.  Remove it from the conditionally dead
+ 	     list, so that a conditional set won't cause us to think
+ 	     it dead.  */
+ 	  rcli = (struct reg_cond_life_info *) node->value;
+ 	  rcli->condition = NULL_RTX;
+ 	  splay_tree_remove (pbi->reg_cond_dead, regno);
+ 	}
+     }
+ 
  #endif
  }
  

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