This is the mail archive of the gcc-bugs@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: middle-end/1719: Abort in local-alloc.c




  In message <14954.63258.226935.484978@sibyl.beware.dropbear.id.au>you write:
  > I believe I now have a fix for the above bug report I just filed.
  > The problem appears to be that regclass.c (scan_one_insn)
  > makes modifications after the register usage is calculated.
  > This function correctly increments REF_N_SETS, but it should also
  > increment REF_N_REFS.
  > 
  > Here is a ChangeLog entry:
  > 
  > Mon Jan 22 00:55:08 2001  Ian Dall  <ian@gateway.beware.dropbear.id.au>
  > 
  > 	* regclass.c (scan_one_insn): Increment register reference count
  >  	when insering new insn.
Pretty close.

REG_N_REFS is supposed to scaled based on the loop depth of the reference;
something like this:

           REG_N_REFS (i) += (optimize_size ? 1  : pbi->bb->loop_depth + 1);

So you need to get at the loop depth of the insn in question.  Hopefully
that information is available at the time you need it.

I'd also have the code to update REG_N_REFS immediately follow the code to
update REG_N_SETS.

jeff


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