Skip to content

Commit

Permalink
Suppress Wsync-alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 committed Apr 28, 2024
1 parent 4ddc7fe commit cdc7344
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 44 deletions.
1 change: 1 addition & 0 deletions src/coreclr/CMakeLists.txt
Expand Up @@ -206,6 +206,7 @@ if(CLR_CMAKE_HOST_UNIX)
# warnings and errors to be suppressed.
# Suppress these warnings here to avoid breaking the build.
add_compile_options($<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wno-null-arithmetic>)
add_compile_options($<$<COMPILE_LANG_AND_ID:CXX,Clang>:-Wno-sync-alignment>)
add_compile_options($<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-conversion-null>)
add_compile_options($<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-pointer-arith>)

Expand Down
44 changes: 0 additions & 44 deletions src/coreclr/pal/inc/pal.h
Expand Up @@ -3404,17 +3404,6 @@ EXTERN_C PALIMPORT inline RETURN_TYPE PALAPI METHOD_DECL \

#endif // HOST_ARM64

#ifdef TARGET_X86
#define Define_InterlockMethodAligned(RETURN_TYPE, METHOD_DECL, METHOD_INVOC, INTRINSIC_NAME, ALIGNMENT) \
EXTERN_C PALIMPORT inline RETURN_TYPE PALAPI METHOD_DECL \
{ \
ALIGNMENT; \
RETURN_TYPE result = INTRINSIC_NAME; \
PAL_InterlockedOperationBarrier(); \
return result; \
}
#endif

/*++
Function:
InterlockedAdd
Expand Down Expand Up @@ -3475,22 +3464,12 @@ Define_InterlockMethod(
__sync_add_and_fetch(lpAddend, (LONG)1)
)

#ifdef TARGET_X86
Define_InterlockMethodAligned(
LONGLONG,
InterlockedIncrement64(IN OUT LONGLONG volatile *lpAddend),
InterlockedIncrement64(lpAddend),
__sync_add_and_fetch(&lAddendAligned, (LONGLONG)1),
LONGLONG volatile DECLSPEC_ALIGN(8) lAddendAligned = *lpAddend
)
#else
Define_InterlockMethod(
LONGLONG,
InterlockedIncrement64(IN OUT LONGLONG volatile *lpAddend),
InterlockedIncrement64(lpAddend),
__sync_add_and_fetch(lpAddend, (LONGLONG)1)
)
#endif

/*++
Function:
Expand Down Expand Up @@ -3520,22 +3499,12 @@ Define_InterlockMethod(

#define InterlockedDecrementRelease InterlockedDecrement

#ifdef TARGET_X86
Define_InterlockMethodAligned(
LONGLONG,
InterlockedDecrement64(IN OUT LONGLONG volatile *lpAddend),
InterlockedDecrement64(lpAddend),
__sync_sub_and_fetch(&lAddendAligned, (LONGLONG)1),
LONGLONG volatile DECLSPEC_ALIGN(8) lAddendAligned = *lpAddend
)
#else
Define_InterlockMethod(
LONGLONG,
InterlockedDecrement64(IN OUT LONGLONG volatile *lpAddend),
InterlockedDecrement64(lpAddend),
__sync_sub_and_fetch(lpAddend, (LONGLONG)1)
)
#endif

/*++
Function:
Expand Down Expand Up @@ -3629,18 +3598,6 @@ Define_InterlockMethod(
#define InterlockedCompareExchangeAcquire InterlockedCompareExchange
#define InterlockedCompareExchangeRelease InterlockedCompareExchange

#ifdef TARGET_X86
Define_InterlockMethodAligned(
LONGLONG,
InterlockedCompareExchange64(IN OUT LONGLONG volatile *Destination, IN LONGLONG Exchange, IN LONGLONG Comperand),
InterlockedCompareExchange64(Destination, Exchange, Comperand),
__sync_val_compare_and_swap(
&DestinationAligned, /* The pointer to a variable whose value is to be compared with. */
Comperand, /* The value to be compared */
Exchange /* The value to be stored */),
LONGLONG volatile DECLSPEC_ALIGN(8) DestinationAligned = *Destination
)
#else
Define_InterlockMethod(
LONGLONG,
InterlockedCompareExchange64(IN OUT LONGLONG volatile *Destination, IN LONGLONG Exchange, IN LONGLONG Comperand),
Expand All @@ -3650,7 +3607,6 @@ Define_InterlockMethod(
Comperand, /* The value to be compared */
Exchange /* The value to be stored */)
)
#endif

/*++
Function:
Expand Down

0 comments on commit cdc7344

Please sign in to comment.