[Bug target/89794] wrong code with -Og -fno-forward-propagate
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89794 --- Comment #4 from Richard Earnshaw --- (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.
[Bug target/89794] wrong code with -Og -fno-forward-propagate
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89794 Jakub Jelinek changed: What|Removed |Added CC||ktkachov at gcc dot gnu.org, ||ramana at gcc dot gnu.org, ||rearnsha at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- 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.
[Bug target/89794] wrong code with -Og -fno-forward-propagate
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89794 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2019-03-25 CC||jakub at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from Jakub Jelinek --- ICEs already in r217911, so likely started with the introduction of __builtin_sub_overflow and before that has been just latent.
[Bug target/89794] wrong code with -Og -fno-forward-propagate
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89794 Andrew Pinski changed: What|Removed |Added Component|rtl-optimization|target --- Comment #1 from Andrew Pinski --- Most likely related to PR 89434.