[Bug target/95646] [GCC 9/10] arm-none-eabi function attribute 'cmse_nonsecure_entry' wipes register values with -Os

2021-05-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95646

--- Comment #7 from CVS Commits  ---
The releases/gcc-10 branch has been updated by SRINATH PARVATHANENI
:

https://gcc.gnu.org/g:d218fed53d811212b015a08cd2e1214000813fbf

commit r10-9807-gd218fed53d811212b015a08cd2e1214000813fbf
Author: Andre Vieira 
Date:   Mon Sep 14 09:03:08 2020 +0100

arm: Fix testisms introduced with fix for pr target/95646

This patch changes the test to use the effective-target machinery disables
the
error message "ARMv8-M Security Extensions incompatible with selected FPU"
when
-mfloat-abi=soft.
Further changes 'asm' to '__asm__' to avoid failures with '-std=' options.

gcc/ChangeLog:
2020-07-06  Andre Vieira  

* config/arm/arm.c (arm_options_perform_arch_sanity_checks): Do not
check +D32 for CMSE if -mfloat-abi=soft

gcc/testsuite/ChangeLog:
2020-07-06  Andre Vieira  

* gcc.target/arm/pr95646.c: Fix testism.

(cherry picked from commit 80297f897758f59071968ddff2a04a8d11481117)

[Bug target/95646] [GCC 9/10] arm-none-eabi function attribute 'cmse_nonsecure_entry' wipes register values with -Os

2021-05-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95646

--- Comment #6 from CVS Commits  ---
The releases/gcc-10 branch has been updated by SRINATH PARVATHANENI
:

https://gcc.gnu.org/g:f1370bf2aa6cac4ab6235d8480b0a5d4f85ca54e

commit r10-9806-gf1370bf2aa6cac4ab6235d8480b0a5d4f85ca54e
Author: Srinath Parvathaneni 
Date:   Thu May 6 10:46:45 2021 +0100

arm: 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.

gcc/ChangeLog:
2020-06-19  Andre Vieira  

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  

PR target/95646
* gcc.target/arm/pr95646.c: New test.

(cherry picked from commit 5f426554fd804d65509875d706d8b8bc3a48393b)

[Bug target/95646] [GCC 9/10] arm-none-eabi function attribute 'cmse_nonsecure_entry' wipes register values with -Os

2021-05-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95646

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

[Bug target/95646] [GCC 9/10] arm-none-eabi function attribute 'cmse_nonsecure_entry' wipes register values with -Os

2021-01-25 Thread xinyu.zhang at arm dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95646

xinyu.zhang at arm dot com changed:

   What|Removed |Added

 CC||xinyu.zhang at arm dot com

--- Comment #5 from xinyu.zhang at arm dot com ---
Could this bug be fixed in next version? If so, when could the new version be
released?

[Bug target/95646] [GCC 9/10] arm-none-eabi function attribute 'cmse_nonsecure_entry' wipes register values with -Os

2021-01-25 Thread avieira at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95646

avieira at gcc dot gnu.org changed:

   What|Removed |Added

Summary|arm-none-eabi function  |[GCC 9/10] arm-none-eabi
   |attribute   |function attribute
   |'cmse_nonsecure_entry'  |'cmse_nonsecure_entry'
   |wipes register values with  |wipes register values with
   |-Os |-Os

--- Comment #4 from avieira at gcc dot gnu.org ---
Changed title to reflect that  this still needs backports to GCC 9 and 10.