This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, rtl-optimization]: Fix post-reload compare elimination pre-pass
On Sat, Feb 11, 2012 at 11:01 PM, Richard Henderson <firstname.lastname@example.org> 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  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
> 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.