From: SourceForge.net <no...@so...> - 2010-03-11 10:46:03
|
Bugs item #2967395, was opened at 2010-03-10 15:12 Message generated for change (Comment added) made by thierryoslo You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2967395&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc Group: None >Status: Closed Resolution: Works For Me Priority: 5 Private: No Submitted By: Thierry Bastian (thierryoslo) Assigned to: Nobody/Anonymous (nobody) Summary: Crash on sse2 instructions Initial Comment: OS: Windows 7 Enterprise 64 bit Compiler: Configured with: ../gcc-4.4.0/configure --enable-languages=c,ada,c++,fortran,jav a,objc,obj-c++ --disable-sjlj-exceptions --enable-shared --enable-libgcj --enabl e-libgomp --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enab le-version-specific-runtime-libs --prefix=/mingw --with-gmp=/mingw/src/gmp/root --with-mpfr=/mingw/src/mpfr/root --build=mingw32 Thread model: win32 gcc version 4.4.0 (GCC) GNU ld (GNU Binutils) 2.19.1 shell: cmd.exe To reproduce the problem, run the attached program: you can simply compile it with gcc -msse2 main.c (avoid optimizations here; since I don't really use the result of the SSE operation they would be optimized away). If you run it with the debugger (gdb), you'll see it crashes on the last sse2 instruction (_mm_andnot_si128) for no good reason. This seems to happen when the call to the SSE comes from the Windows callback. Only this SSE instruction seems to cause a problem on our side (even though I haven't tested all of them). For that reason we had to deactivate SSE2 optimizations in our library (Qt) for mingw. Note: I would be very interested in a workaround if you have one. ---------------------------------------------------------------------- >Comment By: Thierry Bastian (thierryoslo) Date: 2010-03-11 11:46 Message: Great. Thanks for the quick feedback. It looks like finally Qt will be supporting SSE on mingw. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2010-03-10 21:20 Message: Add __attribute__ ((force_align_arg_pointer)) to your definition of MyWndProc like so: LRESULT CALLBACK __attribute__ ((force_align_arg_pointer)) MyWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) As it says in the gcc docs: On the Intel x86, the @code{force_align_arg_pointer} attribute may be applied to individual function definitions, generating an alternate prologue and epilogue that realigns the runtime stack if necessary. This supports mixing legacy codes that run with a 4-byte aligned stack with modern codes that keep a 16-byte stack for SSE compatibility. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2967395&group_id=2435 |