From: Gero Timann Newsgroups: comp.os.msdos.djgpp Subject: Re: gcc optimizing bug Date: Wed, 08 Jul 1998 00:11:22 +0200 Organization: MediaCompany Goe Lines: 54 Message-ID: <35A29D0A.97A4EE5A@mcis.de> References: <35A27937 DOT E89D5F1B AT hotmail DOT com> NNTP-Posting-Host: x55.mcis.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hello ! Very difficult question. I have had problems with the function-parameter-stack, when i'm calling asm and try several optimation-levels. Solution: C-Function-Header and inline asm-code works fine in all cases. Higher optimation brings more aggressive removeable of "useless" code. Declaration of some vars as volatile can help to keep your necessary code unremoved. Problems like this can only be analysed by using rhgdb or another asm-debugging-tool, but they all need the -g comp-flag, which changes the code too. Difficult, indeed. Oh, which gcc-version do you use? I haven't seen -Ox with values greater than 6.. regards, Gero Archee/CoNTRACT schrieb: > 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 ? > > How can I reach the best optimizing without any danger ? > > How can I use gcc with optimizing without bugz ? > What registers can I modify in an ASM code ? -- ___________________________________________________________________ Dipl.Phys.Gero Timann Schülerstieg 20 37081 Göttingen Germany Tel./Fax: Germany-0551-96782 EMail: geti AT mcis DOT de geti AT spock DOT physik3 DOT gwdg DOT de geti AT online DOT de ____________________________________________________________________