Open dmik opened 10 years ago
I wonder if the best long term solution would be to force stack realign whenever building with SSE2 enabled so we match the Linux semantics. It should be possible to tweak the specs to add -mstackrealign anytime -msse2 is present.
Hi,
On 18/04/14 04:25, StevenLevine wrote:
I wonder if the best long term solution would be to force stack realign whenever building with SSE2 enabled so we match the Linux semantics. It should be possible to tweak the specs to add -mstackrealign anytime -msse2 is present.
I don't disagree - but it seems other platforms have similar issues, see: https://bugs.ruby-lang.org/issues/8349 https://qt.gitorious.org/qt/qtbase/source/25e7fe16504ad4784ea2d75204ffa855ca6d3e1b:mkspecs/win32-g++/qmake.conf https://bugzilla.mozilla.org/show_bug.cgi?id=631252
There's a possible fix for this in GCC 6.1.0 - I just applied the following from cygming.h to emx.h: /* 32-bit Windows aligns the stack on a 4-byte boundary but SSE instructions may require 16-byte alignment. */
Is there a simple testcase?
I rebuilt qtgui4.dll with GCC 6.2.0 without using -mstackrealign and can't reproduce https://trac.netlabs.org/qt4/ticket/187
SSE2 builtins enabled with
-msse2
usem128i
(16-byte) variables to execute SSE2 instructions. This variables must be aligned on a 4 word boundary — otherwise the CPU will generate an access violation exception (SIGSEGV
). However, GCC for OS/2 fails to do so — it doesn't perform any special alignment on them (which usually makes them aligned on a word (4 byte) boundary). This is wrong and needs to be fixed.The version of GCC affected is at least 4.4.x. (including 4.4.6). More details are here http://trac.netlabs.org/qt4/ticket/187 and here https://github.com/bitwiseworks/mozilla-os2/issues/29#issuecomment-40537774.