[PATCH, GCC/ARM] Fix PR77904: callee-saved register trashed when clobbering sp

Thomas Preudhomme thomas.preudhomme@foss.arm.com
Thu Nov 3 16:52:00 GMT 2016


Hi,

When using a callee-saved register to save the frame pointer the Thumb-1 
prologue fails to save the callee-saved register before that. For ARM and 
Thumb-2 targets the frame pointer is handled as a special case but nothing is 
done for Thumb-1 targets. This patch adds the same logic for Thumb-1 targets.

ChangeLog entries are as follow:

*** gcc/ChangeLog ***

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

         PR target/77904
         * config/arm/arm.c (thumb1_compute_save_reg_mask): mark frame pointer
         in save register mask if it is needed.


*** gcc/testsuite/ChangeLog ***

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

         PR target/77904
         * gcc.target/arm/pr77904.c: New test.


Testing: Testsuite shows no regression when run with arm-none-eabi GCC 
cross-compiler for Cortex-M0 target.

Is this ok for trunk?

Best regards,

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_pr77904.patch
Type: text/x-patch
Size: 1783 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161103/6721a76b/attachment.bin>


More information about the Gcc-patches mailing list