diff options
| author | Simon Wallis <simon.wallis2@arm.com> | 2023-08-09 08:27:03 +0100 | 
|---|---|---|
| committer | Simon Wallis <simon.wallis2@arm.com> | 2023-08-09 08:40:35 +0100 | 
| commit | 33b9634394de673fce8a60281979df8328687a81 (patch) | |
| tree | 83885298fa6697f67220bad2c5a4d17948d6834f /clang/lib/Frontend/CompilerInvocation.cpp | |
| parent | 0a315be2a46f35bb990dd6c8418a189daec15350 (diff) | |
| download | llvm-33b9634394de673fce8a60281979df8328687a81.zip llvm-33b9634394de673fce8a60281979df8328687a81.tar.gz llvm-33b9634394de673fce8a60281979df8328687a81.tar.bz2 | |
[ARM] v6-M XO: save CPSR around LoadStackGuard
For Thumb-1 Execute-Only, expandLoadStackGuardBase generates a tMOVimm32 pseudo when calculating the stack offset.
It does this in a context where the CSPR maybe be live. tMOVimm32 may corrupt CPSR.
To fix this, generate save/restore CPSR around the tMOVimm32 using MRS/MSR to/from a scratch register.
expandLoadStackGuardBase this runs after register allocation, so the scratch register needs to be a physical register.
Use R12 as a scratch register, as is usual when expanding a pseudo.
MSR/MRS are some of the few v6-M instructions which operate on a high register.
New stack-guard test case added which was generating incorrect code without the save/restore CPSR.
Reviewed By: stuij
Differential Revision: https://reviews.llvm.org/D156968
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions
