This patch fixes the two wrong-code PRs.
The problem is related to the way the noce_emit_cmove helper function
emits conditional moves.
For some targets it re-emits the comparison from the condition block and
then the conditional move
after we have emitted the two basic blocks. Later passes always catch
the redundant comparison and eliminate
it anyway. However, this means that if any of the basic blocks clobber a
register
that is used in that comparison, the comparison will go wrong.
This happens in the testcase where one of the intermediate insns in the
basic block re-used a pseudo reg
that was used in the comparison to store an intermediate result. When
the comparison was re-emitted by
noce_emit_cmove later, it used the clobbered pseudo reg.
PR rtl-optimization/67786
PR rtl-optimization/67787
* ifcvt.c (bb_valid_for_noce_process_p): Reject basic block if
it modifies a reg used in the condition calculation.