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/78444] Wrong prologue stack alignment for implicit dtor on x86_64-darwin*


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78444

--- Comment #9 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #8)
> (In reply to Uroš Bizjak from comment #7)
> > (In reply to Iain Sandoe from comment #6)
> > > for sysV5 psABI targets, the call site requirement is 64 for m32 and 126/256
> > > for m64.
> > sysV5 requires 128bit alignment at the call site, but on linux no runtime
> > mechanism enforces this requirement. So, if it is possible to prove that the
> > called function doesn't need 128bit alignment, we can misalign the caller to
> > word size without consequences. From the trail of this PR, I suspect this is
> > not the case on Darwin.
> 
> Correct;
> Darwin's dynamic loader enforces the alignment requirement.

The revised patch passes bootstrap, and the test case compiles [will reg-test
on Darwin and Linux and then re-post].

NOTE: My understanding is that the intention of this ABI constraint is so that
the callee can make assumptions about stack alignment when using it for vector
items.

The caller doesn't, in general, know whether the callee might use vectors - and
thus to some extent saying it's ok to break ABI if no-one catches you [ ;-) ]
is possibly not enough.

Having said that, this seems to be a corner-case - this is the only time I've
seen it fire on Darwin.

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