diff options
author | Andre Simoes Dias Vieira <andre.simoesdiasvieira@arm.com> | 2020-06-23 15:20:17 +0100 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:14:34 -0300 |
commit | 24229d91e9598297adc0b3401db894a4fb10939a (patch) | |
tree | f033fc3ee3e38ca6c6b427f7e2375eb8c8f66964 /gcc/fortran | |
parent | 691f47153bc1e2da5cfe9c905ad42028b52b0e47 (diff) | |
download | gcc-24229d91e9598297adc0b3401db894a4fb10939a.zip gcc-24229d91e9598297adc0b3401db894a4fb10939a.tar.gz gcc-24229d91e9598297adc0b3401db894a4fb10939a.tar.bz2 |
arm: PR target/95646: Do not clobber callee saved registers with CMSE
As reported in bugzilla when the -mcmse option is used while compiling for size
(-Os) with a thumb-1 target the generated code will clear the registers r7-r10.
These however are callee saved and should be preserved accross ABI boundaries.
The reason this happens is because these registers are made "fixed" when
optimising for size with Thumb-1 in a way to make sure they are not used, as
pushing and popping hi-registers requires extra moves to and from LO_REGS.
To fix this, this patch uses 'callee_saved_reg_p', which accounts for this
optimisation, instead of 'call_used_or_fixed_reg_p'. Be aware of
'callee_saved_reg_p''s definition, as it does still take call used registers
into account, which aren't callee_saved in my opinion, so it is a rather
misnoemer, works in our advantage here though as it does exactly what we need.
Regression tested on arm-none-eabi.
Is this OK for trunk? (Will eventually backport to previous versions if stable.)
gcc/ChangeLog:
2020-06-19 Andre Vieira <andre.simoesdiasvieira@arm.com>
PR target/95646
* config/arm/arm.c: (cmse_nonsecure_entry_clear_before_return): Use
'callee_saved_reg_p' instead of 'calL_used_or_fixed_reg_p'.
gcc/testsuite/ChangeLog:
2020-06-19 Andre Vieira <andre.simoesdiasvieira@arm.com>
PR target/95646
* gcc.target/arm/pr95646.c: New test.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions