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]

patch for handling NOTE_INSN_DELETED_LABELS in scheduling



the if_convert optimization will sometimes deleted user labels.
if they occur at the beginning of an if or then block, and these
blocks could otherwise be merged, flow will change the
labels to a NOTE_INSN_DELETED_LABEL. If we then run the
extended basic block scheduler, these note all get moved to the
top of the function, and the get emitted in the wrong place.

THis patch adds the NOTE_INSN_DELETED_LABEL note to the
list of notes which are saved during scheduling, and this
allows the label to be emitted properly.

This fixes c-torture 990208-1.c at -O3 on ia64, and it
bootstraps.

OK to check in, and should it go to the 3.0 branch too?

Andrew


Index: haifa-sched.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/haifa-sched.c,v
retrieving revision 1.187.20.1
diff -c -p -r1.187.20.1 haifa-sched.c
*** haifa-sched.c	2001/06/19 04:43:05	1.187.20.1
--- haifa-sched.c	2001/07/19 18:45:33
*************** unlink_other_notes (insn, tail)
*** 1334,1339 ****
--- 1334,1340 ----
  	  && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_END
  	  && NOTE_LINE_NUMBER (insn) != NOTE_INSN_RANGE_BEG
  	  && NOTE_LINE_NUMBER (insn) != NOTE_INSN_RANGE_END
+ 	  && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL
  	  && NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG
  	  && NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_END)
  	{
*************** reemit_notes (insn, last)
*** 1860,1865 ****
--- 1861,1868 ----
  	      if (note_type == NOTE_INSN_EH_REGION_BEG
  		  || note_type == NOTE_INSN_EH_REGION_END)
  		NOTE_EH_HANDLER (last) = INTVAL (XEXP (note, 0));
+ 	      if (note_type == NOTE_INSN_DELETED_LABEL)
+ 		CODE_LABEL_NUMBER (last) = INTVAL (XEXP (note, 0));
  	    }
  	  remove_note (insn, note);
  	}
Index: sched-deps.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/sched-deps.c,v
retrieving revision 1.5
diff -c -p -r1.5 sched-deps.c
*** sched-deps.c	2001/05/23 12:45:40	1.5
--- sched-deps.c	2001/07/19 18:45:33
*************** sched_analyze_insn (deps, x, insn, loop_
*** 1090,1095 ****
--- 1091,1097 ----
  	      || INTVAL (XEXP (link, 0)) == NOTE_INSN_LOOP_END
  	      || INTVAL (XEXP (link, 0)) == NOTE_INSN_EH_REGION_BEG
  	      || INTVAL (XEXP (link, 0)) == NOTE_INSN_EH_REGION_END
+ 	      || INTVAL (XEXP (link, 0)) == NOTE_INSN_DELETED_LABEL
  	      || INTVAL (XEXP (link, 0)) == NOTE_INSN_SETJMP)
  	    schedule_barrier_found = 1;
  
*************** sched_analyze (deps, head, tail)
*** 1365,1370 ****
--- 1373,1379 ----
  		   || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
  		   || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG
  		   || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END
+ 		   || NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL
  		   || (NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP
  		       && GET_CODE (PREV_INSN (insn)) != CALL_INSN)))
  	{
*************** sched_analyze (deps, head, tail)
*** 1374,1380 ****
  	      || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END)
  	    rtx_region = GEN_INT (NOTE_EH_HANDLER (insn));
  	  else
! 	    rtx_region = GEN_INT (0);
  
  	  loop_notes = alloc_EXPR_LIST (REG_SAVE_NOTE,
  					rtx_region,
--- 1383,1392 ----
  	      || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END)
  	    rtx_region = GEN_INT (NOTE_EH_HANDLER (insn));
  	  else
! 	    if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)
! 	      rtx_region = GEN_INT (CODE_LABEL_NUMBER (insn));
! 	    else
! 	      rtx_region = GEN_INT (0);
  
  	  loop_notes = alloc_EXPR_LIST (REG_SAVE_NOTE,
  					rtx_region,
Index: sched-rgn.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/sched-rgn.c,v
retrieving revision 1.9.14.1
diff -c -p -r1.9.14.1 sched-rgn.c
*** sched-rgn.c	2001/06/19 04:43:10	1.9.14.1
--- sched-rgn.c	2001/07/19 18:45:33
*************** process_insn (insn)
*** 9124,9129 ****
--- 9124,9130 ----
  	      || NOTE_LINE_NUMBER (insn->insn) == NOTE_INSN_LOOP_END
  	      || NOTE_LINE_NUMBER (insn->insn) == NOTE_INSN_EH_REGION_BEG
  	      || NOTE_LINE_NUMBER (insn->insn) == NOTE_INSN_EH_REGION_END
+ 	      || NOTE_LINE_NUMBER (insn->insn) == NOTE_INSN_DELETED_LABEL
  	      || NOTE_LINE_NUMBER (insn->insn) == NOTE_INSN_SETJMP)))
      abort ();
  
*************** unroll (start_insn, bound_insn, start_no
*** 9683,9688 ****
--- 9684,9690 ----
  		   || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
  		   || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG
  		   || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END
+ 		   || NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL
  		   || NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP)
  	    abort ();
  	}
*************** may_be_pipelined_p (start_insn, bound_in
*** 9979,9984 ****
--- 9981,9987 ----
  	      || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
  	      || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG
  	      || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END
+ 	      || NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL
  	      || NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP))
  	return FALSE;
        else if (code == NOTE


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