[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned
--- Comment #78 from jasmin at revisionfx dot com 2010-08-09 01:56 --- I am not exactly sure how to report a bug here - but it seems highly related to this thread (I am pie...@revisionfx.com, since I am not sure if I am auto-subscribed to this thread, and so will get email back about this) It appears (whatever the version) that this construct in 32b linux (below) does not work after -shared (ld...) - does not work means is not aligned anymore to 16 bytes/128 bits boundary. If I compile a library with such code, and link it as in an executable, it seems to work but if I do it as shared object the alignment is not guaranteed anymore. Anyone has an idea about what to do, if this will be addressed... or GNU just assumes 32b will go away? Or the problem is different. All this works fine with Mac OSX gcc -m32 compile by the way. Also, if I compile with Intel CC does that fix the problem for an host that is Intel CC compiled? (As in is it possible that mixed compiler context - host versus dynamic library further cause complications). #define MAX_CONV_KERNEL_SIZE4096 class ConvKernel4f { public: ConvKernel4f ( ); ~ConvKernel4f( ); DATA_ALIGN(float4 mFilterPtr[MAX_CONV_KERNEL_SIZE]); }; -- jasmin at revisionfx dot com changed: What|Removed |Added CC||jasmin at revisionfx dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838
[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned
--- Comment #79 from jasmin at revisionfx dot com 2010-08-11 21:26 --- > I am not exactly sure how to report a bug here Find the answer here: https://bugs.launchpad.net/sbcl/+bug/539632 " Compile with -mpreferred-stack-boundary=2. This will force GCC to compile code that adheres to the ABI and therefore properly adjusts its own stack pointer." that works -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838
[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned
--- Comment #81 from jasmin at revisionfx dot com 2010-08-17 21:03 --- (In reply to comment #80) > Comment #79: > > -mstackrealign does the right thing, it realigns the stack when needed, but > keeps it 16-byte aligned on function output. It should be used. > I don't have that option (-mstackrealign) It's available in gcc linux from what released version? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838
[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned
--- Comment #83 from jasmin at revisionfx dot com 2010-08-24 22:09 --- (In reply to comment #82) > -mstackrealign is available from gcc 4.5.0. So 1) you are right that somehow - mpreferred-stack-boundary=2 does not always work - I found a case where I crash 2) so I compiled gcc 4.5.1 and recompiled and same (with or without -mstackrealign) I am noting there might be a new bug. When (I am a shared library) I call back the host(an exec I run in as a plugin) to check abort I now have a problem with throw. My throw is in a try/catch but somehow seems going into host space by calling it back makes the throw pass through and the host terminates / abort as it gets a throw it does not know anything about. -- I am not equiped right now to test more 32b linux gcc as I don't have a proper host side way of testing this right now. Just raising a flag. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838