From 6dece9913f459f46c86d383e0da2ea544ce73f63 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 12 Jan 2024 10:10:20 +0100 Subject: libgcc: Use may_alias attribute in bitint handlers As discussed on IRC, the following patch uses may_alias attribute, so that on targets like aarch64 where abi_limb_mode != limb_mode the library accesses the limbs (half limbs of the ABI) in the arrays with conservative alias set. 2024-01-12 Jakub Jelinek * libgcc2.h (UBILtype): New typedef with may_alias attribute. (__mulbitint3, __divmodbitint4): Use UBILtype * instead of UWtype * and const UBILtype * instead of const UWtype *. * libgcc2.c (bitint_reduce_prec, bitint_mul_1, bitint_addmul_1, __mulbitint3, bitint_negate, bitint_submul_1, __divmodbitint4): Likewise. * soft-fp/bitint.h (UBILtype): Change define into a typedef with may_alias attribute. --- libgcc/soft-fp/bitint.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libgcc/soft-fp') diff --git a/libgcc/soft-fp/bitint.h b/libgcc/soft-fp/bitint.h index 20cd41b..cb4d822 100644 --- a/libgcc/soft-fp/bitint.h +++ b/libgcc/soft-fp/bitint.h @@ -33,19 +33,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if BIL_UNITS_PER_WORD == 8 #define BIL_TYPE_SIZE (8 * __CHAR_BIT__) #define BILtype DItype -#define UBILtype UDItype +typedef UDItype __attribute__ ((__may_alias__)) UBILtype; #elif BIL_UNITS_PER_WORD == 4 #define BIL_TYPE_SIZE (4 * __CHAR_BIT__) #define BILtype SItype -#define UBILtype USItype +typedef USItype __attribute__ ((__may_alias__)) UBILtype; #elif BIL_UNITS_PER_WORD == 2 #define BIL_TYPE_SIZE (2 * __CHAR_BIT__) #define BILtype HItype -#define UBILtype UHItype +typedef UHItype __attribute__ ((__may_alias__)) UBILtype; #else #define BIL_TYPE_SIZE __CHAR_BIT__ #define BILtype QItype -#define UBILtype UQItype +typedef UQItype __attribute__ ((__may_alias__)) UBILtype; #endif /* If *P is zero or sign extended (the latter only for PREC < 0) from -- cgit v1.1