This is the mail archive of the
mailing list for the GCC project.
Question about gcse.c vs cc0
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Tue, 29 May 2012 11:03:26 +0200
- Subject: Question about gcse.c vs cc0
In gcse.c:insert_insn_end_basic_block() I found the following code:
/* FIXME: 'twould be nice to call prev_cc0_setter here but it aborts
if cc0 isn't set. */
note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX);
insn = XEXP (note, 0);
rtx maybe_cc0_setter = prev_nonnote_insn (insn);
&& INSN_P (maybe_cc0_setter)
&& sets_cc0_p (PATTERN (maybe_cc0_setter)))
insn = maybe_cc0_setter;
How can this work? As far as grep understands, only link_cc0_insns
creates REG_CC_SETTER notes, but that function is only called from
reorg.c (and even then, only if it makes a transformation). So NOTE
will always be NULL.
Are REG_CC_SETTER/REG_CC_USER notes supposed to exist before dbr_sched?
P.S. The code goes on to use prev_nonnote_insn, which may cross basic
block boundaries, so prev_nonnote_insn_bb should be used instead.