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]

make function.c ready to commit multiple entry prologues


Hi
This patch makes function.c ready for multiple entry points.
There is one important problem with gdb:

      /* GDB handles `break f' by setting a breakpoint on the first
	 line note after the prologue.  Which means (1) that if
	 there are line number notes before where we inserted the
	 prologue we should move them, and (2) we should generate a
	 note before the end of the first basic block, if there isn't
	 one already there.  */

This means that we should place the note on first place coommon for both
entry paths.
Problem is that with loop in function body such breakpoint will over in the
loop, so we would be forced to place NOP in separate basic block.

Instead of that I think we should work with gdb folks to make it ready
for multiple entry points.  For now I insert the note always into
first basic block - this makes function to breakpoint on her "main"
entrance and the other entrances will be missed.
With current usage of multiple entry points inside i386.c, this is
no worse than inlining the function.

Honza

Thu Feb 22 16:25:58 CET 2001  Jan Hubicka  <jh@suse.cz>
	* function.c (epilogue_done): Be ready for first basic block not
	containing PROLOGUE_END note.
	(reposition_prologue_and_epilogue_notes): Avoid placing
	PROLOGUE_END note between BASIC_BLOCK.
Index: function.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/function.c,v
retrieving revision 1.251
diff -c -3 -p -r1.251 function.c
*** function.c	2001/02/16 02:30:37	1.251
--- function.c	2001/02/22 15:30:41
*************** epilogue_done:
*** 7384,7391 ****
  	 there are line number notes before where we inserted the
  	 prologue we should move them, and (2) we should generate a
  	 note before the end of the first basic block, if there isn't
! 	 one already there.  */
  
        for (insn = prologue_end; insn; insn = prev)
  	{
  	  prev = PREV_INSN (insn);
--- 7384,7397 ----
  	 there are line number notes before where we inserted the
  	 prologue we should move them, and (2) we should generate a
  	 note before the end of the first basic block, if there isn't
! 	 one already there.
  
+ 	 ??? This behaviour is completely broken when dealing with
+ 	 multiple entry functions.  We simply place the note always
+ 	 into first basic block and let alternate entry points
+ 	 to be missed.
+        */
+ 
        for (insn = prologue_end; insn; insn = prev)
  	{
  	  prev = PREV_INSN (insn);
*************** epilogue_done:
*** 7402,7408 ****
  
        /* Find the last line number note in the first block.  */
        for (insn = BASIC_BLOCK (0)->end;
! 	   insn != prologue_end;
  	   insn = PREV_INSN (insn))
  	if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
  	  break;
--- 7408,7414 ----
  
        /* Find the last line number note in the first block.  */
        for (insn = BASIC_BLOCK (0)->end;
! 	   insn != prologue_end && insn;
  	   insn = PREV_INSN (insn))
  	if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
  	  break;
*************** reposition_prologue_and_epilogue_notes (
*** 7487,7492 ****
--- 7493,7501 ----
  		BLOCK_HEAD (0) = next;
  
  	      remove_insn (note);
+ 	      /* Avoid placing note between CODE_LABEL and BASIC_BLOCK note.  */
+ 	      if (GET_CODE (insn) == CODE_LABEL)
+ 		insn = NEXT_INSN (insn);
  	      add_insn_after (note, insn);
  	    }
  	}


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