This is the mail archive of the gcc@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]

Re: reorg vs flow, the saga continues


On Mon, Nov 01, 1999 at 05:30:54AM -0700, Jeffrey A Law wrote:
> When we call update_block, which in turn calls incr_tick_for_insn, which
> blows up with an out of range access trying to get BLOCK_NUM for an insn
> created by reorg.

Oops, I fixed the usage of BLOCK_NUM in mark_target_live_regs but
not in incr_tick_for_insn.  Try the appended.

Ideally, reorg would call set_block_num for each new insn it creates.


r~



Index: resource.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/resource.c,v
retrieving revision 1.19
diff -c -p -d -r1.19 resource.c
*** resource.c	1999/10/28 19:30:02	1.19
--- resource.c	1999/11/01 20:58:30
*************** void
*** 1187,1196 ****
  incr_ticks_for_insn (insn)
       rtx insn;
  {
!   int b = BLOCK_NUM (insn);
! 
!   if (b != -1)
!     bb_ticks[b]++;
  }
  
  /* Add TRIAL to the set of resources used at the end of the current
--- 1187,1197 ----
  incr_ticks_for_insn (insn)
       rtx insn;
  {
!   if (INSN_UID (target) < (int) VARRAY_SIZE (basic_block_for_insn))
!     {
!       int b = BLOCK_NUM (target);
!       bb_ticks[b]++;
!     }
  }
  
  /* Add TRIAL to the set of resources used at the end of the current


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