https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77933
--- Comment #5 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> --- Author: thopre01 Date: Thu Nov 17 20:12:13 2016 New Revision: 242559 URL: https://gcc.gnu.org/viewcvs?rev=242559&root=gcc&view=rev Log: Fix PR77933: stack corruption on ARM when using high registers and LR 2016-11-17 Thomas Preud'homme <thomas.preudho...@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. Added: trunk/gcc/testsuite/gcc.target/arm/pr77933-1.c trunk/gcc/testsuite/gcc.target/arm/pr77933-2.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/arm/arm.c trunk/gcc/testsuite/ChangeLog