This exposes the newly added support for type-generic GCC atomic builtins to the user through the System.Atomic_Primitives package, where a generic version of the existing routines is added. This also uses this support in the implementation of the System.Atomic_Operations packages.
Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch12.adb (Analyze_Subprogram_Instantiation): Also propagate an interface name on an intrinsic subprogram. Remove obsolete comment. * libgnat/s-atopri.ads (Atomic_Load): New generic intrinsic function (Atomic_Load_8): Rewrite into instantiation. (Atomic_Load_16): Likewise. (Atomic_Load_32): Likewise. (Atomic_Load_64): Likewise. (Sync_Compare_And_Swap): New generic intrinsic function. (Sync_Compare_And_Swap_8): Rewrite into instantiation. (Sync_Compare_And_Swap_16): Likewise. (Sync_Compare_And_Swap_32): Likewise. (Sync_Compare_And_Swap_64): Likewise. (Lock_Free_Read): New generic inline function. (Lock_Free_Read_8): Rewrite into instantiation. (Lock_Free_Read_16): Likewise. (Lock_Free_Read_32): Likewise. (Lock_Free_Read_64): Likewise. (Lock_Free_Try_Write): New generic inline function. (Lock_Free_Try_Write_8): Rewrite into instantiation. (Lock_Free_Try_Write_16): Likewise. (Lock_Free_Try_Write_32): Likewise. (Lock_Free_Try_Write_64): Likewise. * libgnat/s-atopri.adb (Lock_Free_Read): New function body. (Lock_Free_Read_8): Delete. (Lock_Free_Read_16): Likewise. (Lock_Free_Read_32): Likewise. (Lock_Free_Read_64): Likewise. (Lock_Free_Try_Write): New function body. (Lock_Free_Try_Write_8): Delete. (Lock_Free_Try_Write_16): Likewise. (Lock_Free_Try_Write_32): Likewise. (Lock_Free_Try_Write_64): Likewise. * libgnat/s-aoinar.adb (Atomic_Fetch_And_Add): Use type-generic GCC atomic builtin and tidy up implementation. (Atomic_Fetch_And_Subtract): Likewise. * libgnat/s-aomoar.adb (Atomic_Fetch_And_Add): Likewise. (Atomic_Fetch_And_Subtract): Likewise. * libgnat/s-atopex.adb (Atomic_Exchange): Likewise. (Atomic_Compare_And_Exchange): Likewise.
patch.diff.gz
Description: application/gzip