On Sat, Feb 11, 2012 at 11:01 PM, Richard Henderson <r...@redhat.com> wrote:

>>>>       * 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
>
> We do?  What subsequent pass really cares?

Yes, please see an example in  [1] how CSE2 pass handles this.

I don't know if this is necessary, but when we merge arithmetic insn
with compare, we _do_ update the flags users, in the same way as CSE2
pass.

> What goes wrong leaving things as they are?

x86 tolerates wrong modes in flags users, so as far as x86 is
concerned, this is allowed. But I don't know if wrong, although
compatible modes, should be generated from a generic pass.

[1] http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00547.htm

Uros.

Reply via email to