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]

Re: More ifcvt woes


On Sat, May 13, 2000 at 07:34:09PM +0100, Richard Earnshaw wrote:
> In doing the transformation, the label at the head of block 3 (2a) has its 
> use count decremented by 1 (to zero), but the label is not removed.  
> if_convert then tries
> 
> 	if-then start 1a then 2a join 3a
> 
> but aborts in cond_exec_process_insns since although block 2a now only has 
> one predecessor (which now enters by falling in from above), it still has 
> a code label.

I saw something similar on ia64; I don't recall if the situation
was exactly the same.  Here's the tack I took there.  I don't recall
if a bootstrap completed yesterday -- I got distracted by other work.

> It seems to me that the correct thing to do in this case is to delete the 
> label in dead_or_predicable if its use count reaches zero, and then to 
> ignore deleted insns in the chain.

We should *never* be checking label use counts.  If we got that far
into the if-conversion, then the CFG indicated that the label is
unused (in the cfg sense -- that data sense is still taken care of
by the note_insn_deleted_label).


r~


diff -rup egcs-dist/gcc/ifcvt.c egcs-std/gcc/ifcvt.c
--- egcs-dist/gcc/ifcvt.c	Thu May 11 13:42:25 2000
+++ egcs-std/gcc/ifcvt.c	Fri May 12 16:11:21 2000
@@ -287,6 +300,10 @@ cond_exec_process_if_block (test_bb, the
 
   then_start = then_bb->head;
   then_end = then_bb->end;
+
+  /* Skip a label heading THEN block.  */
+  if (GET_CODE (then_start) == CODE_LABEL)
+    then_start = NEXT_INSN (then_start);
 
   /* Skip a (use (const_int 0)) or branch as the final insn.  */
   if (GET_CODE (then_end) == INSN

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