https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99068
--- Comment #6 from Segher Boessenkool <segher at gcc dot gnu.org> --- (In reply to Brian Grayson from comment #4) > (In reply to Segher Boessenkool from comment #3) > > Then you get > > > > addi 9,9,-2 > > lhau 10,2(9) > > addi 9,9,2 > > > > which is worse than just > > > > lha 10,0(9) > > addi 9,9,2 > > Why is the second addi needed, in your example? Because I typoed it. > And note that if a > pre-decrement "addi 9,9,-2" is needed to pre-bias the pointer, it is done > once outside the loop, and not in every iteration of the loop. You cannot do that without changing the loop structure. There are various non-trivial other paths into and out of the loop body. Since ivopts has decided to not use pre-increment here (because it is more expensive than not using it), we do not use it. Why do you think having a lhau is better?