delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/23/07:16:25

Date: Wed, 23 Sep 1998 14:16:21 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "John S. Fine" <johnfine AT erols DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Optimizations
In-Reply-To: <3606914B.62A6@erols.com>
Message-ID: <Pine.SUN.3.91.980923141545.1392P-100000@is>
MIME-Version: 1.0

On Mon, 21 Sep 1998, John S. Fine wrote:

> > One thing that sometimes helps in C is to explicitly tell the compiler
> > that the functions called inside the loop have no side effects, by
> > declaring it with __attribute__((const)).  This is described in GCC docs,
> > and sometimes has a dramatic effect on code generated for loops that call
> > functions.
> 
>   All of my routines in the entire project have side effects.

Then you cannot expect GCC to be clever about optimizing loops that
call these functions.  Perhaps rewriting some of them to avoid side 
effects is something you could consider.

- Raw text -


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