From: "Günter Reusing" Newsgroups: comp.os.msdos.djgpp Subject: Re: Optimization Date: Wed, 18 Sep 2002 07:35:49 +0200 Organization: T-Online Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1032327269 06 18768 YFsKbQPES6AP6B 020918 05:34:29 X-Complaints-To: abuse AT t-online DOT com X-Sender: 520022394126-0001 AT t-dialin DOT net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I should have added: The same effect happens with GCC 3.0,3.2 and 3.2. > Can anyone help on optimization of C++ code. > With -O3 and all other optimization options I tried I'm stuck with redundant > code. > A typical example (output after compiler and assembler run) : > > /APP > fsincos > /NO_APP > sall $3, %ecx > movl (%eax), %esi > * fsts -56(%ebp) > fxch %st(1) > ** fsts -52(%ebp) > addl %ecx, %esi > * movl -56(%ebp), %eax > ** movl -52(%ebp), %ebx > ** movl %ebx, 4(%esi) > * movl %eax, (%esi) > movl 8(%ebp), %eax > leal 0(,%edi,8), %ebx > fld %st(1) > fxch %st(1) > > The lines marked with * repective ** show unneccesarry redundant moves. > Which options can solve that? > > >