This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/56726] i386: MALLOC_ABI_ALIGNMENT is too small (usually)
- From: "chip at pobox dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 25 Mar 2013 22:35:57 +0000
- Subject: [Bug target/56726] i386: MALLOC_ABI_ALIGNMENT is too small (usually)
- Auto-submitted: auto-generated
- References: <bug-56726-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56726
--- Comment #4 from Chip Salzenberg <chip at pobox dot com> 2013-03-25 22:35:57 UTC ---
If I'm reading that correctly, it seems to agree with my patch.
It looks like MALLOC_ABI_ALIGNMENT of POINTER_SIZE*2 is always either correct
or smaller than necessary, but never too large. If MALLOC_ABI_ALIGNMENT is
smaller than necessary then optimizations may be missed (depending on the
values). But if it is too large then performance *will* suffer. It might even
cause exceptions from unaligned accesses, but i386 is very forgiving, so it'll
just be slower for no apparent reason.
Perhaps the glibc version differences in malloc should be advertised with
__attribute__ on the malloc declarations. Perhaps a new pragma or attribute is
required to do this 100% right. But in the meantime I like POINTER_SIZE*2.