delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/01/09/12:37:04

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 9 Jan 2012 18:36:05 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 16 byte pthread stack alignments
Message-ID: <20120109173605.GA25130@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20111221094211 DOT GH23547 AT calimero DOT vinschen DOT de> <4EF1F937 DOT 9040107 AT gmail DOT com> <20111221154104 DOT GB11841 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 1112211020000 DOT 3076 AT PC1163-8460-XP DOT flightsafety DOT com> <20111221165053 DOT GA9699 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 1112221245050 DOT 748 AT PC1163-8460-XP DOT flightsafety DOT com> <20111223135247 DOT GM31936 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 1112271735200 DOT 748 AT PC1163-8460-XP DOT flightsafety DOT com> <20120109141345 DOT GK15470 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 1201090937510 DOT 2448 AT PC1163-8460-XP DOT flightsafety DOT com>
MIME-Version: 1.0
In-Reply-To: <Pine.CYG.4.58.1201090937510.2448@PC1163-8460-XP.flightsafety.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019