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]
Other format: [Raw text]

PATCH for middle-end/10336, take 2


OK, apparently avoided_insn can even precede the NOTE_INSN_FUNCTION_BEG.
This third revision should be bulletproof.

Applied to trunk, 3.3.

2003-04-29  Jason Merrill  <jason@redhat.com>

	PR middle-end/10336
	* jump.c (never_reached_warning): Really stop looking if we reach 
	the beginning of the function.

*** jump.c.~1~	2003-04-29 12:32:39.000000000 -0400
--- jump.c	2003-04-29 12:57:54.000000000 -0400
*************** never_reached_warning (avoided_insn, fin
*** 1912,1924 ****
    /* Back up to the first of any NOTEs preceding avoided_insn; flow passes
       us the head of a block, a NOTE_INSN_BASIC_BLOCK, which often follows
       the line note.  */
!   for (insn = PREV_INSN (avoided_insn); ; insn = PREV_INSN (insn))
!     if (GET_CODE (insn) != NOTE
! 	|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
!       {
! 	insn = NEXT_INSN (insn);
  	break;
!       }
  
    /* Scan forwards, looking at LINE_NUMBER notes, until we hit a LABEL
       in case FINISH is NULL, otherwise until we run out of insns.  */
--- 1912,1926 ----
    /* Back up to the first of any NOTEs preceding avoided_insn; flow passes
       us the head of a block, a NOTE_INSN_BASIC_BLOCK, which often follows
       the line note.  */
!   insn = avoided_insn;
!   while (1)
!     {
!       rtx prev = PREV_INSN (insn);
!       if (prev == NULL_RTX
! 	  || GET_CODE (prev) != NOTE)
  	break;
!       insn = prev;
!     }
  
    /* Scan forwards, looking at LINE_NUMBER notes, until we hit a LABEL
       in case FINISH is NULL, otherwise until we run out of insns.  */

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