i386 clang optimisation problem with stack alignment

Tijl Coosemans tijl at FreeBSD.org
Tue Sep 10 16:16:17 UTC 2013


Hi,

I've attached a small test program extracted from multimedia/gstreamer-ffmpeg
(libavcodec/h264_cabac.c:ff_h264_init_cabac_states(H264Context *h)).

When you compile and run it like this on FreeBSD/i386, it results in a
SIGBUS:

% cc -o paddd paddd.c -O3 -msse2 -fPIE -fomit-frame-pointer 
% ./paddd
Bus error

The reason is this instruction where %esp isn't 16-byte aligned:
paddd   (%esp), %xmm7

Is this an upstream bug or is this because of local changes (to make the
stack 4 byte aligned by default or something)?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20130910/2c301d2a/attachment.sig>


More information about the freebsd-toolchain mailing list