Commit_one_edge_insertion fix

Jan Hubicka hubicka@atrey.karlin.mff.cuni.cz
Fri Oct 29 13:54:00 GMT 1999


Hi
The new gcse code tends to mess up LOOP_BEG notes and force loop to give up
Here is simple fix to flow.c to not emit code between LOOP_BEG and jump to
the ending condition of loop.
Similar happends for the LOOP_END note too, but I didn't made the patch yet.
BTW
adding the staetements to the end of basic block is done at three places
in
gcc (at least gcse, flow and reg-stack).
Maybe it would be nice to write function to return insn to emit insns after.
But I didn't found nice name for it.

Honza

Fri Oct 29 13:50:53 CEST 1999  Jam Hubicka
	* flow.c (commit_one_edge_insertion): Do not emit code between LOOP_BEG
	note and JUMP insn.

*** flow.c.old	Fri Oct 29 10:58:15 1999
--- flow.c	Fri Oct 29 11:03:00 1999
*************** commit_one_edge_insertion (e)
*** 1585,1590 ****
--- 1585,1593 ----
  	    abort ();
  
  	  before = bb->end;
+ 	  if (GET_CODE ( PREV_INSN (before)) == NOTE
+ 	      && NOTE_LINE_NUMBER ( PREV_INSN (before)) == NOTE_INSN_LOOP_BEG)
+ 	    before = PREV_INSN (bb->end);
  	}
        else
  	{


More information about the Gcc-patches mailing list