From: mdruiter AT cs DOT vu DOT nl (Ruiter de M) Newsgroups: comp.os.msdos.djgpp Subject: Re: Question about optimization of DJGPP Date: 22 Apr 1998 12:36:24 GMT Organization: Fac. Wiskunde & Informatica, VU, Amsterdam Lines: 20 Message-ID: <6hko88$bea$1@star.cs.vu.nl> References: <199804130936 DOT LAA13390 AT euronet DOT nl> <01bd68a5$c8e3b260$151601bf AT cb001687> NNTP-Posting-Host: sloep111.cs.vu.nl To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk > > I've made a little program and when I looked in the disassembler > > window while running the program, I saw movl %eax,%eax. Why is > > this instruction there? Did I forget to turn on optimization > > somewhere? Be sure to use -O or -O2 on the command-line. But I don't think that's the problem. Could be because the compiler tries to align jump-labels at 4 (or 8) byte boundaries for speed. Maybe the movl %eax,%eax is faster than two nop's? > Uhm.. It's because the compiler is like stupid and stuff.. No it's not. GCC is (at least one of) the best optimizing portable compiler around. -- Groeten, Michel. http://www.cs.vu.nl/~mdruiter ____________ \ /====\ / "You know, Beavis, you need things that suck, \/ \/ to have things that are cool", Butt-Head.