Possible bug in cse.c affecting pre/post-modify mem access
Bernd Schmidt
bernds_cb1@t-online.de
Tue May 15 11:16:00 GMT 2018
On 05/15/2018 12:58 PM, A. Skrobov wrote:
>>> 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.
Bernd
More information about the Gcc
mailing list