From: "Günter Reusing" Newsgroups: comp.os.msdos.djgpp Subject: Optimization Date: Wed, 18 Sep 2002 00:33:19 +0200 Organization: T-Online Lines: 28 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1032301962 02 27314 9JmKbyqGSBYZ5k 020917 22:32:42 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 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?