This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/16890] [cygwin/mingw32] __m128 automatic variables misaligned


------- Additional Comments From matt dot daws at cantab dot net  2004-08-18 16:49 -------
Sorry: I have confirmed my analysis, at least in some sense.  If I manually
inline the function foo() into main() (i.e. cut-n-paste) then the resulting
binary does segfault.  This is because the assembly output is the same, but the
stack is now actually aligned (rather than aligned +/-8).  Of course, this
follows from the assembly output: the "andl $16, %%esp" aligns the stack, but
*we have already* copied %esp to %ebp, so that %ebp is not aligned in main().

After playing with threads in MinGW, one gets similar problems in threads. 
Basically, it seems that proper functions get a stack aligned +/-8, but that
main() and any function called via a new thread command will have a stack which
is truly aligned.  Of course, the compiler cannot know what is a true function,
and what will be called by a thread.

Can anyone tell me if this is correct?

--Matt

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16890


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]