"Richard Earnshaw (lists)" <richard.earns...@arm.com> writes:
> On 10/06/2024 15:04, Torbjörn SVENSSON wrote:
>> Properly handle zero and sign extension for Armv8-M.baseline as
>> Cortex-M23 can have the security extension active.
>> Currently, there is an internal compiler error on Cortex-M23 for the
>> epilog processing of sign extension.
>> 
>> This patch addresses the following CVE-2024-0151 for Armv8-M.baseline.
>> 
>> gcc/ChangeLog:
>> 
>>      PR target/115253
>>      * config/arm/arm.cc (cmse_nonsecure_call_inline_register_clear):
>>      Sign extend for Thumb1.
>>      (thumb1_expand_prologue): Add zero/sign extend.
>> 
>> Signed-off-by: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com>
>> Co-authored-by: Yvan ROUX <yvan.r...@foss.st.com>
>> ---
>>  gcc/config/arm/arm.cc | 71 ++++++++++++++++++++++++++++++++++++++-----
>>  1 file changed, 63 insertions(+), 8 deletions(-)
>> 
>> diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc
>> index ea0c963a4d6..e7b4caf1083 100644
>> --- a/gcc/config/arm/arm.cc
>> +++ b/gcc/config/arm/arm.cc
>> [...]
>> +                && known_ge (GET_MODE_SIZE (TYPE_MODE (ret_type)), 2))
>
> You can use known_eq here.  We'll never have any value other than 2, given 
> the known_le (4) above and anyway it doesn't make sense to call extendhisi 
> with any other size.

BTW, I'm surprised we need known_* in arm-specific code.  Is it actually
needed?  Or is this just a conditioned response? ;)  

Richard

Reply via email to