--- Comment #4 from Richard Earnshaw <rearnsha at gcc dot> ---
(In reply to Jakub Jelinek from comment #3)
> Guess with PR89475 fix this will be latent, unless one disables ccp.
> Anyway, to me this looks like a backend bug.  The function is leaf, but for
> some strange reason LRA uses the lr register and so lr needs to be pushed
> and poped, but that push/pop doesn't seem to be accounted for in the afp to
> sp elimination offset computation.

I'm still seeing it in a build from 2019/04/04, so not latent.

Current suspect is the code in arm_compute_elimination_offset (in arm.c), where
we eliminate from the arg pointer to the stack pointer.  The comment says that
if there has been nothing pushed on the stack at all, then the offset result
should be '-4' (and asserts strongly in the comments that this is the correct
result) --- I don't understand why that should be the case.  However, that code
is essentially 18 years old, so I'm not going to try messing with it until I
understand it better.

Reply via email to