Fix PR77933: stack corruption on ARM when using high registers and LR
authorThomas Preud'homme <thomas.preudhomme@arm.com>
Thu, 17 Nov 2016 20:12:13 +0000 (20:12 +0000)
committerThomas Preud'homme <thopre01@gcc.gnu.org>
Thu, 17 Nov 2016 20:12:13 +0000 (20:12 +0000)
commit77b384c53f2229b05513fb4b297d4c93da04f01a
tree57d72e555ae16df422d83d7d1b6434b8123f1ac1
parentd9df71be907c93848f4ab31b280080da59cf5b5a
Fix PR77933: stack corruption on ARM when using high registers and LR

2016-11-17  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    PR target/77933
    * config/arm/arm.c (thumb1_expand_prologue): Distinguish between lr
    being live in the function and lr needing to be saved.  Distinguish
    between already saved pushable registers and registers to push.
    Check for LR being an available pushable register.

    gcc/testsuite/
    PR target/77933
    * gcc.target/arm/pr77933-1.c: New test.
    * gcc.target/arm/pr77933-2.c: Likewise.

From-SVN: r242559
gcc/ChangeLog
gcc/config/arm/arm.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr77933-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/pr77933-2.c [new file with mode: 0644]