On 17/05/18 09:29, Kyrill Tkachov wrote: > > On 16/05/18 10:22, Jérôme Lambourg wrote: >> Hello Kyrill, >> >>> Thanks for the patch! To validate it your changes you can also look >>> at the disassembly >>> of the cmse.c binary in the build tree. If the binary changes with >>> your patch then that >>> would indicate some trouble. >> Good idea. So I just did that and the assembly of both objects are >> identical >> (before and after the patch). >> >>> There are places in arm_cmse.h that use intptr_t. You should replace >>> those as well. >>> Look for the cmse_nsfptr_create and cmse_is_nsfptr macros... >> Indeed, good catch. I did not see those as this part is not included >> in the armv8-m. >> >> Below the updated patch and modified changelog. > > Thanks this looks good with one nit below. > >> 2018-05-16 Jerome Lambourg <lambo...@adacore.com> >> gcc/ >> * config/arm/arm_cmse.h (cmse_nsfptr_create, cmse_is_nsfptr): Remove >> #include <stdint.h>. Replace intptr_t with __INTPTR_TYPE__. >> >> libgcc/ >> * config/arm/cmse.c (cmse_check_address_range): Replace >> UINTPTR_MAX with __UINTPTR_MAX__ and uintptr_t with __UINTPTR_TYPE__. >> > > @@ -51,7 +51,8 @@ > > /* Execute the right variant of the TT instructions. */ > pe = pb + size - 1; > - const int singleCheck = (((uintptr_t) pb ^ (uintptr_t) pe) < 32); > + const int singleCheck = > + (((__UINTPTR_TYPE__) pb ^ (__UINTPTR_TYPE__) pe) < 32); > > The "=" should go on the next line together with the initialisation. > > Ok for trunk with that fixed. > Thanks, > Kyrill Hi,
Is it OK to backport this to gcc-7? Applies cleanly and I ran the cmse tests. Cheers, Andre