delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/27/01:12: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
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3C539A28.3030200@computer.org>
Date: Sat, 26 Jan 2002 22:11:52 -0800
From: Tim Prince <tprince AT computer DOT org>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011126 Netscape6/6.2.1
X-Accept-Language: en-us
MIME-Version: 1.0
To: Pepe Perez <overflow62 AT hotmail DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: Memory
References: <F55wzNNsk2Yl2RodUIX00008764 AT hotmail DOT com>

Pepe Perez wrote:

 > hello, before anything else I don't speak English, I am Argentinean,
 >  I  am writing this with the help of a translator, so know how to
 > excuse my  language.
 >
 > Making a couple of tests with CYGWIN and the compiler GCC 2.95-3.5
 > was  with which I am reserved bad the memory. A char buffer[5] it
 > occupies me  24 bytes!!!!!!!!!!. This checked it when seeing the
 > exit assembler of  this program:
 >
 > main () { char buffer[5]; }
 >
 > It is seen that it subtracts him 24 to ESP, when he would have to 
subtract
 >  him 8. To that this is???
 >
 >> From already thank you!!
 >
This is more likely a gcc issue than a cygwin one.  Did you try the gcc 
option -mpreferred-stack-boundary=2 ?  This would suggest to gcc not to 
attempt to maintain 16-byte alignment, which could be futile, as cygwin 
binutils is set up to maintain only a 4-byte stack alignment.  The 
argument of -mpreferred-stack-boundary is log base 2 of the intended 
stack alignment.  gcc defaults to stack alignment of 16 with full 
optimization, as observance of such alignments is required for code (on 
P-II/P-III, but not P4) and for data objects larger than 8 bytes, in 
order to obtain full performance.  I understand that gcc is planning to 
make 4-byte alignment the default for -Os, but that is a change 
subsequent to gcc-2.95.  8-byte alignment is needed for reasonable 
performance with data of type double, so people may wish to consider 
over-riding the defaults, once they have a g++ library which doesn't break.


-- 
Tim Prince
tprince AT computer DOT org



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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