Bug in gcc/jump.c not correctly handling BARRIER insn.

grahams@rcp.co.uk grahams@rcp.co.uk
Mon May 25 09:25:00 GMT 1998


Hi,

In the ecgs-19980517 snapshot the following code
from thread_jumps @ line 4526 is not handling the
senerio that "prev" may turn out to be a BARRIER


instruction.

if (JUMP_LABEL (b1) != new_label)
{
   rtx prev = PREV_INSN (new_label);

   if (flag_before_loop
      && NOTE_LINE_NUMBER (prev) == NOTE_INSN_LOOP_BEG)
   {
       /* Don't thread to the loop label.  If a loop
          label is reused, loop optimization will
          be disabled for that loop.  */
        new_label = gen_label_rtx ();
        emit_label_after (new_label, PREV_INSN (prev));
   }
   changed |= redirect_jump (b1, new_label);
}

If prev is a BARRIER then NOTE_LINE_NUMBER(prev)
access the 5th element of fld (ie prev->fld[4].rtint) which
is not defined and the test "NOTE_LINE_NUMBER(prev)
== NOTE_INSN_LOOP_BEG" may be a false positive.

Graham





More information about the Gcc-bugs mailing list