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: HAIFA scheduler bug?


The problem here is that jump.c is using the REG_DEAD notes to decide what
instructions can be deleted when it makes a change, but REG_DEAD notes are not
valid after reload.  This causes jump to mistakenly delete some instructions
that are still needed.

This invalid REG_DEAD note came from a scheduling change that haifa-sched made.
It reversed the order of two instructions, both using the same pseudo, where
the second one had a REG_DEAD note.  When jump deleted the first insn with
the REG_DEAD note, it thought it could also delete the insn storing into the
pseudo, but this is not correct.

I think the problem has always been there, and that we were just lucky that
we haven't run into it more often.

The example doesn't fail with the current sources because we get slightly
different RTL (due I think to reload changes), and the code in jump.c in
delete_computation has a == rtl test which fails in this case.  The bug is
still there though.

Perhaps we should just add a new pass before the second jump pass to recompute
the REG_DEAD notes?

Jim


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