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

Bug in ra-colorize.c:merge_moves?


Hi,

this is merge_moves from ra-colorize.c which has somewhat broken list
handling IMHO. Look at the line marked with XXX, this changes ml->next
but the for-loop at the place marked with YYY will later on try to move
to the next element that previously followed ml by setting ml to ml->next.

void
merge_moves (u, v)
     struct web *u, *v;
{
  regset seen;
  struct move_list *ml;

  seen = BITMAP_XMALLOC ();
  for (ml = u->moves; ml; ml = ml->next)
    bitmap_set_bit (seen, INSN_UID (ml->move->insn));
  for (ml = v->moves; ml; ml = ml->next /* YYY */ )
    {
      if (! bitmap_bit_p (seen, INSN_UID (ml->move->insn)))
        {
          ml->next = u->moves;  /* XXX */
          u->moves = ml;
        }
    }
  BITMAP_XFREE (seen);
  v->moves = NULL;
}

    regards  Christian

-- 
THAT'S ALL FOLKS!


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