[Bug target/77330] __float128 segfaults on 32-bit x86 due to 8-byte malloc alignment

mikulas at artax dot karlin.mff.cuni.cz gcc-bugzilla@gcc.gnu.org
Tue Aug 23 13:18:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77330

--- Comment #2 from mikulas at artax dot karlin.mff.cuni.cz ---
Glibc doesn't support types __float128 and decimal float. Only GCC does.

Glibc can't be responsible for decisions made by the GCC developers. Glibc has
been aliging allocated memory on 8 bytes on 32-bit architectures since ever. It
was GCC decision to introduce these new types and it was GCC decision that
these types have 16-byte alignment. GCC could have defined them as 16-byte
values with 8-byte alignment.

When copying general data structures, GCC understand that the memory may be
aligned only on 8 bytes and uses MOVLPS / MOVHPS instructions instead of
MOVAPS. But with __float128, _Decimal128 and SSE vectors, it mistakenly
believes that they are 16-byte aligned.


More information about the Gcc-bugs mailing list