Your ECU will learn all the bad habits of you driving, including your bad gas. It won’t “hurt” it to run low octane gas IMAO. However it will suffer performance over a long period of time. If you switch back and forth form low & high octane gas you will prolong the effect of the gradual diminish of the performance. Your ECU is making/seeing adjustment for timing, knock, barometric pressure, and low, med & high fuel trims etc.etc. Unfortunately the bad gas is one thing that is not reset every time you start your car and it may take several tanks to bring the timing backup to the proper performance of what its designed to run at with premium gas.
Dean