egcs-970828 bug with -fprofile-arcs

Jim Wilson wilson@chestnut.cygnus.com
Thu Sep 4 19:20:00 GMT 1997


	With egcs-970904 plus the patch, there is still a problem if you use -O
	(same test file).  Here is a backtrace:

Ok.  I see now that we need some additional tests.  Here is another patch.

Thu Sep  4 19:15:17 1997  Jim Wilson  <wilson@cygnus.com>

	* profile.c (output_arc_profiler): Check next_insert_after for non
	NULL before deferencing it.

*** profile.c~	Wed Sep  3 16:09:09 1997
--- profile.c	Thu Sep  4 19:09:22 1997
*************** output_arc_profiler (arcno, insert_after
*** 1537,1548 ****
        rtx next_insert_after = next_nonnote_insn (insert_after);
  
        /* The first insn after the call may be a stack pop, skip it.  */
!       if (GET_CODE (next_insert_after) == INSN
  	  && GET_CODE (PATTERN (next_insert_after)) == SET
  	  && SET_DEST (PATTERN (next_insert_after)) == stack_pointer_rtx)
  	next_insert_after = next_nonnote_insn (next_insert_after);
  
!       if (GET_CODE (next_insert_after) == INSN)
  	{
  	  if (GET_CODE (PATTERN (insert_after)) == SET)
  	    return_reg = SET_DEST (PATTERN (insert_after));
--- 1537,1550 ----
        rtx next_insert_after = next_nonnote_insn (insert_after);
  
        /* The first insn after the call may be a stack pop, skip it.  */
!       if (next_insert_after
! 	  && GET_CODE (next_insert_after) == INSN
  	  && GET_CODE (PATTERN (next_insert_after)) == SET
  	  && SET_DEST (PATTERN (next_insert_after)) == stack_pointer_rtx)
  	next_insert_after = next_nonnote_insn (next_insert_after);
  
!       if (next_insert_after
! 	  && GET_CODE (next_insert_after) == INSN)
  	{
  	  if (GET_CODE (PATTERN (insert_after)) == SET)
  	    return_reg = SET_DEST (PATTERN (insert_after));



More information about the Gcc-bugs mailing list