> I also wonder if compare-elim ought to be helping here. Isn't that the > point here, to eliminate the comparison and instead get it for free as > part of the arithmetic? If so, is it the fact that we have memory > references that prevents compare-elim from kicking in?
Yes, compare-elim doesn't work with memory references but, more radically, it is not enabled for x86 (it is only enabled for aarch64, mn10300 and rx). -- Eric Botcazou