delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/28/15:31:20

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Wed, 28 Apr 2004 14:30:47 -0500
From: Brian Ford <ford AT vss DOT fsi DOT com>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
cc: tbp <gcc AT ompf DOT org>
Subject: Re: g++ 3.4.0 cygwin, codegen SSE & alignement issues
In-Reply-To: <20040428190846.GA9889@coe.bosbc.com>
Message-ID: <Pine.CYG.4.58.0404281428240.5560@fordpc.vss.fsi.com>
References: <408F2C65 DOT 4090804 AT ompf DOT org> <Pine DOT CYG DOT 4 DOT 58 DOT 0404281232440 DOT 5560 AT fordpc DOT vss DOT fsi DOT com> <20040428190846 DOT GA9889 AT coe DOT bosbc DOT com>
MIME-Version: 1.0
X-IsSubscribed: yes

On Wed, 28 Apr 2004, Christopher Faylor wrote:

> On Wed, Apr 28, 2004 at 12:41:51PM -0500, Brian Ford wrote:
> This patch would only affect non-main threads.  It would not affect the
> main thread.  Wouldn't you need to do the same thing for the main thread?
> I don't understand why it would be different.

Something already does.  I didn't try and track down the what/why.

00401060 <_main>:
   401060:       55                      push   %ebp
   401061:       b8 10 00 00 00          mov    $0x10,%eax
   401066:       89 e5                   mov    %esp,%ebp
   401068:       83 ec 08                sub    $0x8,%esp
   40106b:       83 e4 f0                and    $0xfffffff0,%esp <-- SEE

This problem doesn't happen for the main thread.  I'll try to pin the who
down if you like.

> >2004-04-28  DJ Delorie  <dj AT redhat DOT com>
> >
> >        * init.cc (threadfunc_fe): Hack to make thread stacks always 16
> >	byte aligned.
> >
> >Index: init.cc
> >===================================================================
> >RCS file: /cvs/src/src/winsup/cygwin/init.cc,v
> >retrieving revision 1.32
> >diff -u -p -r1.32 init.cc
> >--- init.cc     22 Mar 2004 18:30:38 -0000      1.32
> >+++ init.cc     28 Apr 2004 17:38:03 -0000
> >@@ -27,6 +27,8 @@ HANDLE sync_startup;
> > static void WINAPI
> > threadfunc_fe (VOID *arg)
> > {
> >+  (void)__builtin_return_address(1);
> >+  asm volatile ("andl $-16,%%esp" ::: "%esp");
> >   _cygtls::call ((DWORD (*)  (void *, void *)) (((char **)
> >_tlsbase)[OLDFUNC_OFFSET]), arg);
> > }

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...

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

- Raw text -


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