https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77499
--- Comment #10 from Segher Boessenkool <segher at gcc dot gnu.org> --- (In reply to avieira from comment #9) > > > So I dont know... Only thing I can think of is better "value-range"-like > > > analysis for combine, but that might be too costly? That is what nonzero_bits etc. is about. We could do much better nowadays with the generic DF framework. > > So we are not really looking for combine to combine the shift stmt > > with the xor stmt? Because combine doesn't consider that because of > > the multi-use. > > AFAIK, combine will not combine the shift and xor because they are in > different basic blocks. The multi-use prevents it from tracking the origin > of r112 back to a point where it knows that it its higher bits are all 0. Yes. Cross BB prevents combining insns; multiple use does not (but it does of course make it less likely, and you typically get a 3->2 combination). Is code hoisting making the code better at all here? (At RTL level)