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]

Re: Flowgraph bug


> Did you manage to reproduce this?
Yes, it exposes bug I fixed two years ago on cfg branch...  Here is
updated patch.  The problem is that we may miss BB when looking for
destination of fallthru edge in the case BB is empty.  OK for
mainline/3.3 branch?

Mon Apr 21 00:10:35 CEST 2003  Jan Hubicka  <jh at suse dot cz>
	* cfgbuild.c (make_edges):  Do not use next_nonnote_insn when
	looking for fallthru edge.
Index: cfgbuild.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgbuild.c,v
retrieving revision 1.34
diff -c -3 -p -r1.34 cfgbuild.c
*** cfgbuild.c	30 Mar 2003 20:46:56 -0000	1.34
--- cfgbuild.c	20 Apr 2003 22:10:27 -0000
*************** make_edges (label_value_list, min, max, 
*** 439,453 ****
  	}
  
        /* Find out if we can drop through to the next block.  */
!       insn = next_nonnote_insn (insn);
        if (!insn || (bb->next_bb == EXIT_BLOCK_PTR && force_fallthru))
  	cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
        else if (bb->next_bb != EXIT_BLOCK_PTR)
  	{
! 	  rtx tmp = bb->next_bb->head;
! 	  if (GET_CODE (tmp) == NOTE)
! 	    tmp = next_nonnote_insn (tmp);
! 	  if (force_fallthru || insn == tmp)
  	    cached_make_edge (edge_cache, bb, bb->next_bb, EDGE_FALLTHRU);
  	}
      }
--- 439,455 ----
  	}
  
        /* Find out if we can drop through to the next block.  */
!       insn = NEXT_INSN (insn);
!       while (insn
! 	     && GET_CODE (insn) == NOTE
! 	     && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK)
! 	insn = NEXT_INSN (insn);
! 
        if (!insn || (bb->next_bb == EXIT_BLOCK_PTR && force_fallthru))
  	cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
        else if (bb->next_bb != EXIT_BLOCK_PTR)
  	{
! 	  if (force_fallthru || insn == bb->next_bb->head)
  	    cached_make_edge (edge_cache, bb, bb->next_bb, EDGE_FALLTHRU);
  	}
      }


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