https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102571
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:ba837323dbda2bca5a1c8a4c78092a88241dcfa3 commit r12-4207-gba837323dbda2bca5a1c8a4c78092a88241dcfa3 Author: Jakub Jelinek <ja...@redhat.com> Date: Wed Oct 6 10:40:12 2021 +0200 openmp: Optimize for OpenMP atomics 2x__builtin_clear_padding+__builtin_memcmp if possible For the few long double types that do have padding bits, e.g. on x86 the clear_type_padding_in_mask computed mask is ff ff ff ff ff ff ff ff ff ff 00 00 for 32-bit and ff ff ff ff ff ff ff ff ff ff 00 00 00 00 00 00 for 64-bit. Instead of doing __builtin_clear_padding on both operands that will clear the last 2 or 6 bytes and then memcmp on the whole 12/16 bytes, we can just memcmp 10 bytes. The code also handles if the padding would be at the start or both at the start and end, but everything on byte boundaries only and non-padding bits being contiguous. This works around a tree-ssa-dse.c bug (but we need to fix it anyway, as libstdc++ won't do this and as it can deal with arbitrary types, it even can't do that generally). 2021-10-06 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/102571 * c-omp.c (c_finish_omp_atomic): Optimize the case where type has padding, but the non-padding bits are contiguous set of bytes by adjusting the memcmp call arguments instead of emitting __builtin_clear_padding and then comparing all the type's bytes.