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 Fix enable-checking failures in bb-reorder


Hi

Here's a patch to correct enable-checking failures
in bb-reorder.c

The verify_flow_info () prototype really needs to be
moved to a header file but I'm not sure which one.

With this patch applied I have bootstrapped CVS +
"PATCH: bb reorder insn chaining fix" on i686-linux 
configured with --enable-checking

Graham

ChangeLog
	* bb-reorder.c: Add prototype for verify_flow_info ().
	* bb-reorser.c (skip_insns_between_block): Check for a NOTE before using NOTE_LINE_NUMBER ().
	* bb-reorder.c (chain_reorder_blocks): Likewise ...
	* bb-reorder.c (make_reorder_chain): Use INTVAL to obtain probability.

==========================================================================
*** bb-reorder.c	Sat Mar 18 12:34:46 2000
--- bb-reorder.c.new	Sat Mar 18 12:49:39 2000
***************
*** 43,48 ****
--- 43,49 ----
  #include "expr.h"
  #include "obstack.h"
  
+ extern void verify_flow_info PARAMS ((void));
  
  /* The contents of the current function definition are allocated
     in this obstack, and all are freed at the end of the function.
*************** skip_insns_between_block (bb, skip_type)
*** 181,198 ****
  		  && insn == BASIC_BLOCK (bb->index + 1)->head)
  		break;
  
! 	      if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)
  		{
  		  found_block_end = 1;
  		  continue;
  		}
  
! 	      if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)
  		continue;
  
  	      if (GET_CODE (insn) == NOTE
  		  && NOTE_LINE_NUMBER (insn) >= 0
  		  && NEXT_INSN (insn)
  		  && (NOTE_LINE_NUMBER (NEXT_INSN (insn))
  		      == NOTE_INSN_BLOCK_END))
  		continue;
--- 182,202 ----
  		  && insn == BASIC_BLOCK (bb->index + 1)->head)
  		break;
  
! 	      if (GET_CODE (insn) == NOTE
! 		  && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)
  		{
  		  found_block_end = 1;
  		  continue;
  		}
  
! 	      if (GET_CODE (insn) == NOTE
! 		  && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)
  		continue;
  
  	      if (GET_CODE (insn) == NOTE
  		  && NOTE_LINE_NUMBER (insn) >= 0
  		  && NEXT_INSN (insn)
+ 		  && GET_CODE (NEXT_INSN (insn)) == NOTE
  		  && (NOTE_LINE_NUMBER (NEXT_INSN (insn))
  		      == NOTE_INSN_BLOCK_END))
  		continue;
*************** chain_reorder_blocks (e, ceb)
*** 265,271 ****
  
      for (insn = dbh_insn; insn && insn != db->end; insn = NEXT_INSN (insn))
        {
! 	if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG)
  	  {
  	    block_begins += 1;
  	    break;
--- 269,276 ----
  
      for (insn = dbh_insn; insn && insn != db->end; insn = NEXT_INSN (insn))
        {
! 	if (GET_CODE (insn) == NOTE
! 	    && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG)
  	  {
  	    block_begins += 1;
  	    break;
*************** chain_reorder_blocks (e, ceb)
*** 283,289 ****
  	{
  	  if (PREV_INSN (insn) == cebbe_insn)
  	    break;
! 	  if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)
  	    {
  	      block_ends += 1;
  	      continue;
--- 288,295 ----
  	{
  	  if (PREV_INSN (insn) == cebbe_insn)
  	    break;
! 	  if (GET_CODE (insn) == NOTE
! 	      && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)
  	    {
  	      block_ends += 1;
  	      continue;
*************** make_reorder_chain (bb)
*** 506,512 ****
        rtx note = find_reg_note (block_end, REG_BR_PROB, 0);
  
        if (note) 
! 	probability = XINT (XEXP (note, 0), 0);
        else
  	probability = 0;
  
--- 512,518 ----
        rtx note = find_reg_note (block_end, REG_BR_PROB, 0);
  
        if (note) 
! 	probability = INTVAL (XEXP (note, 0));
        else
  	probability = 0;
==================================================================================

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