delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/08/08/11:51:09.1

Date: Sun, 8 Aug 1999 14:06:09 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: pavenis AT lanet DOT lv
cc: Laszlo Molnar <laszlo DOT molnar AT eth DOT ericsson DOT se>, djgpp-workers AT delorie DOT com
Subject: Re: gcc-2.95
In-Reply-To: <B0000097299@stargate.astr.lu.lv>
Message-ID: <Pine.SUN.3.91.990808140548.23423Q@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 5 Aug 1999 pavenis AT lanet DOT lv wrote:
>  On 5 Aug 99, at 16:20, Laszlo Molnar wrote:
>
> > Another
> > idea: maybe you could change the default 8 byte aligment of the stack
> > to 4 when building gcc (if you build it with 2.95). It would make the
> > executable somewhat smaller (and maybe faster? - not sure, just an
> > idea).

Laszlo, I don't understand why are you suggesting a 4-byte alignment
for the stack.  I think it has only disadvantages, since local
variables of types double and long long will be misaligned, so if
anything, it will run slower.  There's no effect on the binary size
(since the stack is sbrk'ed at run time), and not on the size of the
executable in memory (since the alignment works by moving the stack
bottom to 8-byte aligned address without changing the size of the
allocated stack).  Am I missing something?

To recap, we switched to forcing 8-byte alignment of the stack in
v2.02, after people reported that programs sometimes run slower on
Windows (which doesn't ensure 8-byte alignment in memory blocks
returned by its DPMI server).

Anyway, the change necessary for this is in the startup code, not in
the GCC sources.

> Perhaps it's best to stay with defaults for i[34567]86 for release of 
> DJGPP port. All similar changes should be carefully tested and 
> most discussions in latest time were about using even 16 bytes 
> alignment. But all such optimizations are common for all 
> i[34567]86 targets and doing them especially for DJGPP would
> duplicate the same efforts (and I'm not sure we'll do it better)

I couldn't agree more with Andris.

- Raw text -


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