On Sat, Feb 11, 2012 at 1:26 AM, Richard Henderson <r...@redhat.com> wrote: > 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.
Unfortunately, we need to update all uses of flag register with a new, compatible mode, as well, similar to how compatible mode is handled in CSE2 pass with cse_condition_code_reg in cse.c The postreload compare elimination pass should be extended to handle compare elimination for targets that expose FLAGS_REG early through SELECT_CC_MODE, taking into account the fact that flags reg can live past BB boundaries. Uros.