Mail Archives: djgpp/2002/09/18/10:30:44
"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 -