delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/17/15:55:39

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
Message-ID: <20030217205514.36613.qmail@web21402.mail.yahoo.com>
Date: Tue, 18 Feb 2003 07:55:14 +1100 (EST)
From: =?iso-8859-1?q?Danny=20Smith?= <danny_r_smith_2001 AT yahoo DOT co DOT nz>
Subject: RE:size limit for static arrays in cygwin/gcc
To: cygwin AT cygwin DOT com
Cc: rrschulz AT cris DOT com
MIME-Version: 1.0

Randall R Schulz <rrschulz at cris dot com>  wrote:

> A couple of months ago, someone reported on how local (stack)
> allocations larger than a certain threshold were allocated on the heap.
> In fact, you, Danny, contributed materially to that thread: Subject
> "Strange behaviour of gcc" starting with a posting by
> fabrizio_ge-wolit AT tiscali DOT it on Dec. 24, 2002. 
> 

No that's not quite right:

Stack allocations larger than one page (4KB) cause gcc to probe the stack.
The allocation is still static

I think, also, the stack probe is automatically called in main, to force
alignment of stack to a page boundary.

Be aware, there is a bug in GCC-3.2 with respect to _alloca and optimization 
(particulary-fomit-frame-pointer), reported on this list by someone called Fish
and  on GCC lists.  It is fixed (at least in part) in 3.3 and higher. 

> In that case Fabrizio
> wanted to avoid the dependence that heap allocation created on the
> runtime or C library. That was C/C++ code and I don't know where this
> allocation strategy is implemented--i.e., whether it's in a
> language-specific front-end or a language-independent back-end of GCC
> (and here we should emphasise the official name: the GNU Compiler
> Collection, not the GNU C Compiler as many believe it to mean)

The stack probe default is target-specific, language-independent.

Danny


http://mobile.yahoo.com.au - Yahoo! Mobile
- Exchange IMs with Messenger friends on your Telstra or Vodafone mobile phone.

--
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