[testsuite,arm] Fix cmse-15.c expected output

Message ID 20220923084330.4131742-1-torbjorn.svensson@foss.st.com
State Accepted, archived
Headers
Series [testsuite,arm] Fix cmse-15.c expected output |

Checks

Context Check Description
snail/gcc-patches-check success Github commit url

Commit Message

Torbjorn SVENSSON Sept. 23, 2022, 8:43 a.m. UTC
  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.roux@foss.st.com>
Signed-off-by: Torbjörn SVENSSON  <torbjorn.svensson@foss.st.com>
---
 gcc/testsuite/gcc.target/arm/cmse/cmse-15.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Christophe Lyon Sept. 29, 2022, 2:30 p.m. UTC | #1
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.roux@foss.st.com>
> Signed-off-by: Torbjörn SVENSSON  <torbjorn.svensson@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
  
Richard Earnshaw Oct. 3, 2022, 2:36 p.m. UTC | #2
On 23/09/2022 09: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.

OK.

R.
> 
> Co-Authored-By: Yvan ROUX  <yvan.roux@foss.st.com>
> Signed-off-by: Torbjörn SVENSSON  <torbjorn.svensson@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
>   ** )
>   **	...
>   */
  

Patch

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
 ** )
 **	...
 */