On 04/14/2016 07:10 PM, Olivier Hainque wrote: > >> On 14 Apr 2016, at 18:50, Jeff Law <l...@redhat.com> wrote: >> >> I thought we had code to handle this case specially, but I can't immediately >> find it in sched-deps.c. > > Unless I misunderstood what you were exactly looking for, > the special code is in alias.c. E.g. write_dependence_p: > > /* (mem:BLK (scratch)) is a special mechanism to conflict with everything. > This is used in epilogue deallocation functions. */ > ...
Ok thanks. I've verified that the dependencies are also generated when using this expression in a clobber. > Emitting just that alone isn't enough though. The first attempt > I made did that and failed because the whole > > reg-restore > reg-restore > tie (mem blockage only) > > sequence was allowed to move past the stack pointer reset when > it's performed as a mere register to register move. > > So I ended up adding the clobber mem:blk scratch to the existing > tie parallel, which references the stack pointer register as > well so is forbidden to move past it's update. I've seen the same on S/390 when restoring the stack pointer from a floating point reg. But I think it is not limited to reg-reg stack pointer restores. Potentially this could also happen with the stack pointer decrement in the prologue which could also get moved across a mem only barrier. Bye, -Andreas-