On Sun, Sep 2, 2012 at 2:09 PM, Reini Urban <rurban@x-ray.at> wrote: > On Sat, Sep 1, 2012 at 9:34 AM, Nicholas Clark <nick@ccl4.org> wrote: >> On Sun, Sep 02, 2012 at 12:14:47AM +1000, Tony Cook wrote: >> OK, thanks. I don't know any x86_64 assembler, nor do I know its alignment >> constrains or whatnot, so I'm not able to work out from this what went >> wrong. And whether it's us doing something dodgy or them. >> >> Is anyone else able to work backwards from this to what the cause is? > > Apple gcc contrary to the default or homebrew gcc defaults to 16bit > stack alignment for performance reasons and easier SSE interaction. > Similar to Sun cc. Oops, -Os only. The normal cause for this failure is -Os on darwin. Only apple gcc and clang default to 16bit stack alignment even with -Os, others not. > Normally this should do no harm, unless you mix non-apple cc compiled > code or if you change struct alignment manually. Or if you mix cflags. > > Our StructCopy relies on the compiler struct copy, which should work ok. > In this case: > movaps (%rcx),%xmm0 > rcx is not properly aligned (0 as first char). SSE code requires 16 > bit alignment. > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13685 > BTW: The normal behaviour should be SIGBUS not SIGSEGV, > but gcc is different. > > Unfortunately I gave my darwin pc away, so I cannot single step > through it. > > If it's not one of these causes I would say it's one of these nasty > compiler bugs, and I would use the old-style StructCopy with this > config. > Or compile with -mno-sse Or remove -Os -- Reini Urban http://cpanel.net/ http://www.perl-compiler.org/