Hi Torbjörn,

On 9/23/22 10:43, Torbjörn SVENSSON via Gcc-patches wrote:
The cmse-15.c testcase fails at -Os because ICF means that we
generate
secure3:
         b       secure1

which is OK, but does not match the currently expected
secure3:
...
         bx      r[0-3]

gcc/testsuite/ChangeLog:

        * gcc.target/arm/cmse/cmse-15.c: Align with -Os improvements.

Co-Authored-By: Yvan ROUX  <yvan.r...@foss.st.com>
Signed-off-by: Torbjörn SVENSSON  <torbjorn.svens...@foss.st.com>
---
  gcc/testsuite/gcc.target/arm/cmse/cmse-15.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-15.c 
b/gcc/testsuite/gcc.target/arm/cmse/cmse-15.c
index b0fefe561a1..5188f1d697f 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/cmse-15.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-15.c
@@ -144,6 +144,8 @@ int secure2 (s_bar_ptr s_bar_p)
  **    bx      r[0-3]
  ** |
  **    blx     r[0-3]
+** |
+**     b       secure1
  ** )
  **    ...
  */

Yes, that looks OK to me, similar to a patch I made some time ago to the very same file, when ICF became smarter. It seems it is now able to notice that
return (*s_bar_p) ();
in secure3 () is equivalent to the same call in secure1 ().

LGTM, but I'm not a maintainer.

Thanks,

Christophe

Reply via email to