Date: Sun, 1 Feb 1998 18:40:30 -0800 (PST) Message-Id: <199802020240.SAA15916@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: SOLYOM Andras , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Compiler error! (and something about Virtual memory) Precedence: bulk At 11:10 2/1/1998 +0100, SOLYOM Andras wrote: >In this same program I have discovered a compiler error with -O3. > >I have this little code in my program [snipped] >When compiled with -O3 the first fread() has never been executed: it was missing from >the code! Without -O3 it worked fine. I am using gcc 2.7.2.1. First, make sure that this is not a bug in your code. I didn't see the complete source; it is possible the compiler decided it was dead code and eliminated it. Also try compiling with -Wall and see if the compiler prints any warnings that are relevant. If you decide that it is not: Send a bug report. The GCC docs explain this quite well, but I'll sum it up: * Strip the source file to the minimum that reproduces the bug. For instance, you can probably remove every function but the offending one. * Preprocess your source file. Compile with all the same switches as before, and add `-E', and use DOS redirection or `-o' to send the output to a file. * Send e-mail to (the docs give a different address which I think has changed, or soon may) including: - Preprocessed source, generated above - Version of GCC you used - Platform you run it on (DJGPP in this case) - Compiler options you used - Perhaps the generated assembly from the compilation (`-S'), with an explanation of where the error is - Any changes you made to GCC - Anything else you think is relevant > >So you have been warned... Sending a bug report will be even more helpful than warning people, since this way it will (hopefully) get fixed and people won't have to worry about it at all. Nate Eldredge eldredge AT ap DOT net