On 02/09/2012 03:47 PM, Uros Bizjak wrote: > 2012-02-10 Uros Bizjak <ubiz...@gmail.com> > > * compare-elim.c (find_comparisons_in_bb): Eliminate only compares > having mode compatible with the mode of previous compare. Substitute > compare mode of previous compare with the mode, compatible > with eliminated and previous compare.
This patch is ok for 4.8. For 4.6 and 4.7 I would prefer that we simply not eliminate the compare. I.e. + enum machine_mode src_mode = GET_MODE (src); + /* Eliminate a compare that's redundant with the previous. */ if (last_cmp_valid + && src_mode == last_cmp->orig_mode && rtx_equal_p (last_cmp->in_a, XEXP (src, 0)) && rtx_equal_p (last_cmp->in_b, XEXP (src, 1))) { ... - last_cmp->orig_mode = GET_MODE (SET_DEST (single_set (insn))); + last_cmp->orig_mode = src_mode; For 4.6 and 4.7, there are only two extant users of this pass and neither of them use anything besides CCmode before compare-elim.c does its own manipulation of the modes later. r~