From: "Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>
To: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>,
gcc-patches@gcc.gnu.org
Cc: Richard.Ball@arm.com
Subject: Re: [PATCH] testsuite: Verify r0-r3 are extended with CMSE
Date: Tue, 30 Apr 2024 17:50:32 +0100 [thread overview]
Message-ID: <07fde3e9-c08a-4a05-839f-86c8a18efec3@arm.com> (raw)
In-Reply-To: <72cdf2f6-44ab-431c-8211-b4021552a3ca@foss.st.com>
On 30/04/2024 16:37, Torbjorn SVENSSON wrote:
>
>
> On 2024-04-30 17:11, Richard Earnshaw (lists) wrote:
>> On 27/04/2024 15:13, Torbjörn SVENSSON wrote:
>>> Add regression test to the existing zero/sign extend tests for CMSE to
>>> verify that r0, r1, r2 and r3 are properly extended, not just r0.
>>>
>>> Test is done using -O0 to ensure the instructions are in a predictable
>>> order.
>>>
>>> gcc/testsuite/ChangeLog:
>>>
>>> * gcc.target/arm/cmse/extend-param.c: Add regression test.
>>>
>>> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
>>> ---
>>> .../gcc.target/arm/cmse/extend-param.c | 20 ++++++++++++++++++-
>>> 1 file changed, 19 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/gcc/testsuite/gcc.target/arm/cmse/extend-param.c b/gcc/testsuite/gcc.target/arm/cmse/extend-param.c
>>> index 01fac786238..b8b8ecbff56 100644
>>> --- a/gcc/testsuite/gcc.target/arm/cmse/extend-param.c
>>> +++ b/gcc/testsuite/gcc.target/arm/cmse/extend-param.c
>>> @@ -93,4 +93,22 @@ __attribute__((cmse_nonsecure_entry)) char boolSecureFunc (bool index) {
>>> return 0;
>>> return array[index];
>>> -}
>>> \ No newline at end of file
>>> +}
>>> +
>>> +/*
>>> +**__acle_se_boolCharShortEnumSecureFunc:
>>> +** ...
>>> +** uxtb r0, r0
>>> +** uxtb r1, r1
>>> +** uxth r2, r2
>>> +** uxtb r3, r3
>>> +** ...
>>> +*/
>>> +__attribute__((cmse_nonsecure_entry,optimize(0))) char boolCharShortEnumSecureFunc (bool a, unsigned char b, unsigned short c, enum offset d) {
>>> +
>>> + size_t index = a + b + c + d;
>>> + if (index >= ARRAY_SIZE)
>>> + return 0;
>>> + return array[index];
>>> +
>>> +}
>>
>> Ok, but please can you add '-fshort-enums' to dg-options to ensure this test still behaves correctly if run with a different default (I missed that last time around).
>
> Ok, I'll add that to extend-param.c. Do you want me to also add it to the extend-return.c test case?
>
> Kind regards,
> Torbjörn
Yes please, if it has the same issue.
R.
next prev parent reply other threads:[~2024-04-30 16:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 15:55 [PATCH] arm: Zero/Sign extends for CMSE security Richard Ball
2024-04-25 10:01 ` Richard Earnshaw (lists)
2024-04-25 11:47 ` Torbjorn SVENSSON
2024-04-25 14:25 ` Richard Ball
2024-04-26 8:39 ` Torbjorn SVENSSON
2024-04-26 9:19 ` Richard Earnshaw (lists)
2024-04-27 14:13 ` [PATCH] testsuite: Verify r0-r3 are extended with CMSE Torbjörn SVENSSON
2024-04-30 15:11 ` Richard Earnshaw (lists)
2024-04-30 15:37 ` Torbjorn SVENSSON
2024-04-30 16:50 ` Richard Earnshaw (lists) [this message]
2024-05-02 10:50 ` [PATCH v2] " Torbjörn SVENSSON
2024-05-06 11:50 ` Torbjorn SVENSSON
2024-05-14 11:01 ` [PING] " Torbjorn SVENSSON
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=07fde3e9-c08a-4a05-839f-86c8a18efec3@arm.com \
--to=richard.earnshaw@arm.com \
--cc=Richard.Ball@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=torbjorn.svensson@foss.st.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).