http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60092
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #18 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> We could "lower"
> posix_memalign (&ptr, align, size);
> to
> posix_memalign (&ptr, align, size);
> ptr = __builtin_assume_algined (ptr, align);
> and hope for FRE to fix things up enough to make that useful.
I wonder about mm_malloc. I assume for config/i386/pmm_malloc.h, it is already
handled via posix_memalign, but shouldn't one also handle
config/i386/gmm_malloc.h? For instance via
--- a/gcc/config/i386/gmm_malloc.h
+++ b/gcc/config/i386/gmm_malloc.h
@@ -61,7 +61,11 @@ _mm_malloc (size_t size, size_t align)
/* Store the original pointer just before p. */
((void **) aligned_ptr) [-1] = malloc_ptr;
+#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7
+ return __builtin_assume_aligned(aligned_ptr, align);
+#else
return aligned_ptr;
+#endif
}
static __inline__ void