Sender: nate AT cartsys DOT com Message-ID: <35A2F822.A7348571@cartsys.com> Date: Tue, 07 Jul 1998 21:40:02 -0700 From: Nate Eldredge MIME-Version: 1.0 To: soltesz AT hotmail DOT com CC: djgpp AT delorie DOT com Subject: Re: gcc optimizing bug References: <35A27937 DOT E89D5F1B AT hotmail DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Archee/CoNTRACT wrote: > > hi ! > > I use many ASM in my demos. > When I switch on -O9 it produces a crashing exe. > I gave only -O2, than it worked. > What can by wrong ? Is this regular GCC, or PGCC? PGCC is apparently unstable at very high -O levels. For regular GCC, nothing above -O3 has any additional effect. > How can I reach the best optimizing without any danger ? > > How can I use gcc with optimizing without bugz ? Nobody knows what bugs may exist in GCC, so your questions cannot be answered. > What registers can I modify in an ASM code ? In inline asm, you must inform the compiler of all registers you clobber. In an external asm function, you can modify eax, ecx, edx, and the FPU registers; all others must be saved and restored. Perhaps that is the cause of your crash? In the case of inline asm, there were a few subtle bugs in GCC 2.7.2.1; you might upgrade to 2.8.1, if you haven't, and see if that helps. Otherwise, compile with -S and check that the code is actually correct. I haven't checked whether they're fixed, because I lost the test cases. -- Nate Eldredge nate AT cartsys DOT com