This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/77330] __float128 segfaults on 32-bit x86 due to 8-byte malloc alignment
- From: "mikulas at artax dot karlin.mff.cuni.cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 23 Aug 2016 13:18:24 +0000
- Subject: [Bug target/77330] __float128 segfaults on 32-bit x86 due to 8-byte malloc alignment
- Auto-submitted: auto-generated
- References: <bug-77330-4@http.gcc.gnu.org/bugzilla/>
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.