public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: 16 byte pthread stack alignments
Date: Mon, 09 Jan 2012 17:36:00 -0000	[thread overview]
Message-ID: <20120109173605.GA25130@calimero.vinschen.de> (raw)
In-Reply-To: <Pine.CYG.4.58.1201090937510.2448@PC1163-8460-XP.flightsafety.com>

On Jan  9 09:41, Brian Ford wrote:
> On Mon, 9 Jan 2012, Corinna Vinschen wrote:
> 
> > On Dec 27 18:06, Brian Ford wrote:
> > > On Fri, 23 Dec 2011, Corinna Vinschen wrote:
> > >
> > > > Sorry, but what I don't get from your reply is if the andl worked or
> > > > not.
> > >
> > > No; by itself, it does not.  Adding a "subl $12, %%esp" following it so
> > > that the stack is 16 byte aligned after the thread arg is pushed does
> > > work.  There are probably more efficient and/or cleaner ways of doing it
> > > though.
> > >
> > > STC attached, but note that it seems to always pass with gcc-4.  Only gcc
> > > 3.4.4 appears to require the extra alignment.
> >
> > Ok, this is even more puzzeling.  The thread function called from the
> > thread_wrapper function is NOT the application thread function, but the
> > Cygwin internal function thread_init_wrapper.  Given that this function
> > is built with the same gcc 4.x compiler as the rest of Cygwin, how on
> > earth can this fail at all? Shouldn't the alignment be always correct on
> > the subsequent call to the application function, given that gcc-4 is
> > supposed to care?
> 
> I'm speculating, but I believe gcc-4 only re-aligns the stack in case an
> instruction in that function requires more strict alignment than the
> default ABI to save overhead.

Maybe.  I applied that patch which also makes gcc 3 happy.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2012-01-09 17:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20 23:45 Brian Ford
2011-12-21  9:42 ` Corinna Vinschen
2011-12-21 10:46   ` Corinna Vinschen
2011-12-21 15:20   ` Dave Korn
2011-12-21 15:41     ` Corinna Vinschen
2011-12-21 16:22       ` Brian Ford
2011-12-21 16:51         ` Corinna Vinschen
2011-12-22 18:51           ` Brian Ford
2011-12-23 13:53             ` Corinna Vinschen
2011-12-28  0:12               ` Brian Ford
2012-01-09 14:14                 ` Corinna Vinschen
2012-01-09 15:41                   ` Brian Ford
2012-01-09 17:36                     ` Corinna Vinschen [this message]
2011-12-21 18:20         ` Brian Ford
2011-12-21 21:25           ` Brian Ford
2011-12-22  9:28             ` Corinna Vinschen
2011-12-22 15:20               ` Brian Ford
2011-12-22 15:32                 ` Corinna Vinschen
2011-12-22 15:40                   ` Corinna Vinschen
2011-12-22 15:50                     ` Brian Ford
2011-12-22 15:48                   ` Brian Ford
2011-12-21 16:13   ` Brian Ford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120109173605.GA25130@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).