>>>> That makes me wonder if there is a latent bug though. Consider pushing >>>> args to a pure function. Could we then try to CSE the memory reference >>>> and get it wrong because we haven't accounted for the autoinc? >>> >>> Can't know for sure but one would hope something would test for >>> side_effects_p. >> >> If side_effects_p were checked in all the right places, then our port >> (which is more liberal at generating auto-inc insns in early passes) >> wouldn't have cse generate incorrect code, right? > > No, I'd expect you'd also need to make sure cse and other passes > understand the side effects. I think it's best not to emit these insns > early, unless you are prepared to put a lot of effort in to fix up the > early passes. My recommendation is to change the port.
I understand that we should change our port; my point is, if cse behaves incorrectly for _our_ auto-inc insns, wouldn't it also behave incorrectly for _others'_ auto-inc insns such as stack pushes?