This is the mail archive of the 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]

flow bugfix

This fixes a recently reported problem on f771 aborting on the x86 with
-O2 -funroll-loops.

Due to optimizations in flow we end up with a conditional branch to the
next instruction.

Merge blocks deletes the conditional branch.  However, flow does not delete
the insn that sets cc0.

This causes indigestion in reg-stack later.

        * flow.c (merge_blocks_nomove): For HAVE_cc0 targets, make sure
        to also delete the cc0 setter when deleting a conditional branch
        to the next block.

Index: flow.c
RCS file: /egcs/carton/cvsfiles/egcs/gcc/flow.c,v
retrieving revision 1.103
diff -c -3 -p -r1.103 flow.c
*** flow.c	1999/03/06 17:19:39	1.103
--- flow.c	1999/03/08 22:39:10
*************** merge_blocks_nomove (a, b)
*** 1821,1827 ****
--- 1821,1840 ----
  	  rtx tmp = a->end;
  	  a->end = prev_nonnote_insn (tmp);
+ #ifdef HAVE_cc0
+ 	  /* If this was a conditional jump, we need to also delete
+ 	     the insn that set cc0.  */
+ 	  if (! simplejump_p (tmp) && condjump_p (tmp))
+ 	    {
+ 	      PUT_CODE (PREV_INSN (tmp), NOTE);
+ 	      NOTE_SOURCE_FILE (PREV_INSN (tmp)) = 0;
+ 	    }
+ #endif
  	  flow_delete_insn (tmp);

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