Possible bug in cse.c affecting pre/post-modify mem access
Jeff Law
law@redhat.com
Mon May 14 20:55:00 GMT 2018
On 05/12/2018 01:35 PM, Bernd Schmidt wrote:
> On 05/12/2018 07:01 PM, Jeff Law wrote:
>
>> No. We're not supposed to have any auto-inc insns prior to the auto-inc
>> pass. A stack push/pop early in the compiler would have to be
>> represented by a PARALLEL.
>>
>> It's been this way forever. It's documented in the internals manual
>> somewhere.
>
> Sorry, but you're misremembering this. Stack pushes/pops were always
> represented with autoinc, these being the only exception to the rule you
> remember. You can easily verify this by looking at a .expand dump from a
> 32-bit i386 compiler - I just did so with 2.95 and 6.4. It's all pre_dec
> for argument passing.
That does sound vaguely familiar. Did we put autoinc notes on the stack
pushes?
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?
Jeff
More information about the Gcc
mailing list