https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105745
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Ugh, that is a lame limitation. Does mingw support any of the other aligned allocators (memalign, posix_memalign or aligned_alloc) that can be freed just with free? If not, I guess easiest fix would be to move the HAVE__ALIGNED_MALLOC support as last option before fallback instead of first, make sure GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC is not defined for HAVE__ALIGNED_MALLOC if no other aligned allocator works and use _aligned_free in gomp_aligned_free if HAVE__ALIGNED_MALLOC and not GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC.