------- Comment #18 from hjl dot tools at gmail dot com 2008-02-13 15:39 ------- (In reply to comment #17) > > It is to be expected that this proposal usually has no effect on > Darwin, because the problem it is trying to solve, of local variables > that require alignment greater than the default, does not usually > exist on Darwin.
attribute may increase alignment larger than 128bit and it won't work on Darwin. > > Under the definitions in your proposal, on Darwin, STACK_BOUNDARY > should be 128, because 128 is the "minimum stack boundary" on Darwin, > and this is also the value "preferred by hardware". There is a On x86, STACK_BOUNDARY is the stack size change when pop/push is used on register by gcc. Some special instructions on some hardware require 512bit alignment. It doesn't make those hardwares to use 512 as STACK_BOUNDARY. > contradiction in your proposal in which it says that it is "preferred > by hardware" but also the "minimum stack boundary"; on many x86 > platforms, the hardware would really prefer 128 bits, but the ABI > actually specifies a smaller value. > On i386, gcc uses 128bit stack alignment for all OSes as specified by PREFERRED_STACK_BOUNDARY, which controls stack alignment, including Linux and Darwin. The only difference is gcc doesn't conform to Linux psABI and gcc on Darwin does. There is no need at all for Darwin to use 128 for STACK_BOUNDARY to get 128bit stack alignment because gcc does it already, independent of STACK_BOUNDARY. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34621