This is the mail archive of the
mailing list for the GCC project.
Is regmove.c:discover_flags_reg still needed?
- From: Daniel Jacobowitz <drow at false dot org>
- To: gcc at gcc dot gnu dot org
- Cc: rth at redhat dot com
- Date: Sat, 5 Jun 2004 13:48:24 -0400
- Subject: Is regmove.c:discover_flags_reg still needed?
I noticed a lot of HImodes on INSNs today and went to figure out what it
meant. In rtl.texi there's an index entry claiming to explain it but only
QImode and TImode are documented. The only place I can find that might be
doing it is regmove.
But looking at this code, I found something odd. discover_flags_reg was
introduced in 1999, and has done this ever since:
tmp = gen_rtx_REG (word_mode, 10000);
tmp = gen_add3_insn (tmp, tmp, GEN_INT (2));
/* If we get something that isn't a simple set, or a
[(set ..) (clobber ..)], this whole function will go wrong. */
if (GET_CODE (tmp) == SET)
else if (GET_CODE (tmp) == PARALLEL)
But GET_CODE of the result of gen_add3_insn is generally going to be INSN.
I went back to a Mar. 1999 snapshot to check, and it was a SET; my guess is
that the changes to not emit needless SEQUENCE rtl changes the result of
gen_sequence for a single insn. But discover_flags_reg has probably been
returning pc_rtx (i.e. "confused") since then. It's easy to fix this but
that suggests the code is no longer necessary...