Hi All,
In Thumb mode when the function prologue gets expanded, in case of a
multiple register push, additional mov instructions are generated to
save the high registers which result in lr getting overwritten before
it's value can be used to retrieve the return address.
The fix consists of detecting if lr is alive after the prologue, in
which case, the lr register won't be used as a scratch.
Regression tested on arm-none-eabi.
gcc/ChangeLog:
2018-11-23 Mihail Ionescu <mihail.ione...@arm.com>
PR target/88167
* config/arm/arm.c: Add lr liveness check.
gcc/testsuite/ChangeLog
2018-11-23 Mihail Ionescu <mihail.ione...@arm.com>
PR target/88167
* gcc.target/arm/pr88167.c: New test.
If everything is ok for trunk, could someone commit it on my behalf?
Best regards,
Mihail