From: Hans-Bernhard Broeker 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: References: NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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" 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.