This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/56726] i386: MALLOC_ABI_ALIGNMENT is too small (usually)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]