This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Use-and-clobber insns and REG_DEAD notes
- From: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 6 Jul 2003 00:30:57 +0200 (MET DST)
- Subject: Use-and-clobber insns and REG_DEAD notes
Hello,
I'm trying to implement an add-with-carry insn and running
into a problem because the my pattern both uses and clobbers
(not sets!) the condition code register.
There appears to be confusion how such insns are supposed to
be treated w.r.t. REG_DEAD notes. Should there be one for
the CC register in such an insn or not? For use-and-set
patterns it is clear that there will be no REG_DEAD note
(only the REG_UNUSED note). However, for use-and-clobber
patterns there is a discrepancy (which causes an assertion
failure in the scheduler later on):
flow.c generates a REG_DEAD note for that insn (and a
REG_UNUSED note as well). However, when some other insn
is combined into it, combine.c thinks it does not need to
distribute the REG_DEAD note into the insn (because
dead_or_set_p returns true), so after combine the note
is gone.
Which of the two is right?
Bye,
Ulrich
--
Dr. Ulrich Weigand
weigand@informatik.uni-erlangen.de