This is the mail archive of the
mailing list for the GCC project.
Re: condition codes, haifa-sched and virtual-stack-vars
Alexandre Oliva <email@example.com> writes:
> How about having a pre-reload move pattern that clobbers CC, split
> after reload into one that does not, so that sched2 could put the move
> between compare and branch should it indeed not affect CC?
I liked your idea best (less invasive than Jeff's idea of
reworking conditional branch patterns), and it works!
In the "movsi" expander, I added this bit:
if (REG_P (src)
&& REGNO (src) >= FIRST_PSEUDO_REGISTER
&& REGNO (src) <= LAST_VIRTUAL_REGISTER)
emit_insn (gen_movsi_virtual_reg (dest, src));
In the md file, *after* the normal movsi insn (so the normal takes
precedence), I added this pattern:
[(parallel [(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:SI 1 "register_operand" "r"))
(clobber (reg:CC CC_REGNUM))])]
[(set (match_dup 0)
Thanks very much Alexandre & Jeff!