Newsgroups: comp.os.msdos.djgpp From: Kev Subject: RE: Program goes wrong when optimized under gcc 2.8 In-Reply-To: Content-Type: TEXT/PLAIN; charset=US-ASCII Message-ID: Sender: nntp AT acsu DOT buffalo DOT edu NNTP-Posting-Host: freenet.buffalo.edu Organization: Buffalo Free-Net References: Mime-Version: 1.0 Date: Mon, 28 Sep 1998 15:35:27 GMT Lines: 24 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk > > > > When I compile the program like this: gcc -o hot2std.exe hot2std.c > > > > it works perfeclty. > > > > If I try to compile with optimization (gcc -O[1,2 or 3] -o > > hot2std.exe > > > > hot2std.c), I get strange outputs, compared to those of the debug > > > > version. > > Hmmm...I ran across the same bug when compiling in a DOS prompt or a batch file... For some reason, DFE95 Version 3.12 has no problems with parsing the optimization command to GCC...Perhaps a problem with GCC's ability to parse between O and o and thought that you wanted 2 exectutables built from the same source in DOS's command line? Well, Anyways...I usually don't use the -O options...I seem to get better results using: -m486 (Code optimized for 486) -fomit-framepointer (saves an extra register) -malign-doubles (seems to be faster for Pentiums) Oh well, My opinion... Haven't tried to build a makefile with the -O options yet... :)kev