delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/09/18/10:30:44

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Optimization
Date: 18 Sep 2002 11:24:58 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 34
Message-ID: <am9nqa$r5m$1@nets3.rz.RWTH-Aachen.DE>
References: <am8ai9$qli$02$1 AT news DOT t-online DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
Mime-Version: 1.0
X-Trace: nets3.rz.RWTH-Aachen.DE 1032348298 27830 137.226.32.75 (18 Sep 2002 11:24:58 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 18 Sep 2002 11:24:58 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Günter Reusing" <guenter DOT reusing AT web DOT de> wrote:
> Can anyone help on optimization of C++ code.

Maybe someone can, but probably not one of us.  Optimization is not at
all particular to the DJGPP port of GCC.  You really ought to take
this to the GCC developers, instead.

But be sure to not just show assembly output.  They'll need input,
too.  Self-contained, compilable code, that is.  Best if it's
preprocessed already (or doesn't use any #include's).

> With -O3 and all other optimization options I tried I'm stuck with
> redundant code. 
[...]
> The lines marked with * repective ** show unneccesarry redundant moves.
> Which options can solve that?

It's impossible to see from this fragment whether these moves are
redundant or not.  You should at least include an explanation why you
believe they are.

As is, the code places copies of the floats taken from the FPU in
three places, each: one local automatic variable -56(%ebp) /
-52(%ebp), one register %eax, and one (probably) global variable at
(%esi) / -4(%esi).  The copies in registers are overwritten
immediately, but it's far from obvious why the copies in -56(%ebp)
should be "redundant" without seeing the rest of this function's code.




-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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