This is the mail archive of the 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]
Other format: [Raw text]

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:

  rtx tmp;
  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)
    return NULL_RTX;
  else if (GET_CODE (tmp) == PARALLEL)
  return pc_rtx;

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...

Daniel Jacobowitz

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